Module: L43Peg::Combinators
- Extended by:
- Combinators
- Included in:
- L43Peg, Combinators, Parsers::IntParser, Parsers::StringParser, Parsers::SymbolParser
- Defined in:
- lib/l43_peg/combinators.rb,
lib/l43_peg/combinators/map.rb,
lib/l43_peg/combinators/lazy.rb,
lib/l43_peg/combinators/many.rb,
lib/l43_peg/combinators/boxed.rb,
lib/l43_peg/combinators/maybe.rb,
lib/l43_peg/combinators/choice.rb,
lib/l43_peg/combinators/ignore.rb,
lib/l43_peg/combinators/satisfy.rb,
lib/l43_peg/combinators/sequence.rb,
lib/l43_peg/combinators/map_error.rb,
lib/l43_peg/combinators/debug_parser.rb
Defined Under Namespace
Modules: Boxed, Choice, DebugParser, Ignore, Lazy, Many, Map, MapError, Maybe, Satisfy, Sequence
Instance Method Summary
collapse
-
#boxed(parser, box, name: nil, &mapper) ⇒ Object
-
#choice(*parsers, name: nil) ⇒ Object
-
#debug_parser(parser:, name:, level:) ⇒ Object
-
#ignore(parser, name: nil) ⇒ Object
-
#lazy(name: nil, &parser) ⇒ Object
-
#many(parser, name: nil, min: 0, max: nil) ⇒ Object
-
#map(parser, name: nil, fn: nil, box: nil, &mapper) ⇒ Object
-
#map_error(parser, name: nil, reason: nil) ⇒ Object
-
#maybe(parser, name: nil, &mapper) ⇒ Object
-
#satisfy(parser, name: nil, fn: nil, &satisfier) ⇒ Object
-
#sequence(*parsers, name: nil, flatten: false, join: false, box: nil, &mapper) ⇒ Object
Instance Method Details
#boxed(parser, box, name: nil, &mapper) ⇒ Object
17
18
|
# File 'lib/l43_peg/combinators.rb', line 17
def boxed(parser, box, name: nil, &mapper) =
Boxed.boxed(parser, box, name:, &mapper)
|
#choice(*parsers, name: nil) ⇒ Object
20
21
|
# File 'lib/l43_peg/combinators.rb', line 20
def choice(*parsers, name: nil) =
Choice.choice(*parsers, name:)
|
#debug_parser(parser:, name:, level:) ⇒ Object
23
24
|
# File 'lib/l43_peg/combinators.rb', line 23
def debug_parser(parser:, name:, level:) =
DebugParser.debug_parser(parser:, name:, level:)
|
#ignore(parser, name: nil) ⇒ Object
26
27
|
# File 'lib/l43_peg/combinators.rb', line 26
def ignore(parser, name: nil) =
Ignore.ignore(parser, name:)
|
#lazy(name: nil, &parser) ⇒ Object
29
|
# File 'lib/l43_peg/combinators.rb', line 29
def lazy(name: nil, &parser) = Lazy.lazy(name:, &parser)
|
#many(parser, name: nil, min: 0, max: nil) ⇒ Object
31
32
|
# File 'lib/l43_peg/combinators.rb', line 31
def many(parser, name: nil, min: 0, max: nil) =
Many.many(parser, name:, min:, max:)
|
#map(parser, name: nil, fn: nil, box: nil, &mapper) ⇒ Object
34
35
|
# File 'lib/l43_peg/combinators.rb', line 34
def map(parser, name: nil, fn: nil, box: nil, &mapper) =
Map.map(parser, name:, fn:, box:, &mapper)
|
#map_error(parser, name: nil, reason: nil) ⇒ Object
37
38
|
# File 'lib/l43_peg/combinators.rb', line 37
def map_error(parser, name: nil, reason: nil) =
MapError.map_error(parser, name:, reason:)
|
#maybe(parser, name: nil, &mapper) ⇒ Object
40
41
|
# File 'lib/l43_peg/combinators.rb', line 40
def maybe(parser, name: nil, &mapper) =
Maybe.maybe(parser, name:, &mapper)
|
#satisfy(parser, name: nil, fn: nil, &satisfier) ⇒ Object
43
44
|
# File 'lib/l43_peg/combinators.rb', line 43
def satisfy(parser, name: nil, fn: nil, &satisfier) =
Satisfy.satisfy(parser, name:, fn:, &satisfier)
|
#sequence(*parsers, name: nil, flatten: false, join: false, box: nil, &mapper) ⇒ Object
46
47
|
# File 'lib/l43_peg/combinators.rb', line 46
def sequence(*parsers, name: nil, flatten: false, join: false, box: nil, &mapper) =
Sequence.sequence(*parsers, name:, flatten:, join:, box:, &mapper)
|