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/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, 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
-
#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
16
17
|
# File 'lib/l43_peg/combinators.rb', line 16
def boxed(parser, box, name: nil, &mapper) =
Boxed.boxed(parser, box, name:, &mapper)
|
#choice(*parsers, name: nil) ⇒ Object
19
20
|
# File 'lib/l43_peg/combinators.rb', line 19
def choice(*parsers, name: nil) =
Choice.choice(*parsers, name:)
|
#debug_parser(parser:, name:, level:) ⇒ Object
22
23
|
# File 'lib/l43_peg/combinators.rb', line 22
def debug_parser(parser:, name:, level:) =
DebugParser.debug_parser(parser:, name:, level:)
|
#ignore(parser, name: nil) ⇒ Object
25
26
|
# File 'lib/l43_peg/combinators.rb', line 25
def ignore(parser, name: nil) =
Ignore.ignore(parser, name:)
|
#lazy(name: nil, &parser) ⇒ Object
28
|
# File 'lib/l43_peg/combinators.rb', line 28
def lazy(name: nil, &parser) = Lazy.lazy(name:, &parser)
|
#many(parser, name: nil, min: 0, max: nil) ⇒ Object
30
31
|
# File 'lib/l43_peg/combinators.rb', line 30
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
33
34
|
# File 'lib/l43_peg/combinators.rb', line 33
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
36
37
|
# File 'lib/l43_peg/combinators.rb', line 36
def map_error(parser, name: nil, reason: nil) =
MapError.map_error(parser, name:, reason:)
|
#satisfy(parser, name: nil, fn: nil, &satisfier) ⇒ Object
39
40
|
# File 'lib/l43_peg/combinators.rb', line 39
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
42
43
|
# File 'lib/l43_peg/combinators.rb', line 42
def sequence(*parsers, name: nil, flatten: false, join: false, box: nil, &mapper) =
Sequence.sequence(*parsers, name:, flatten:, join:, box:, &mapper)
|