Module: L43Peg

Extended by:
L43Peg
Includes:
Combinators, Parsers
Included in:
L43Peg
Defined in:
lib/l43_peg.rb,
lib/l43_peg/box.rb,
lib/l43_peg/input.rb,
lib/l43_peg/errors.rb,
lib/l43_peg/parser.rb,
lib/l43_peg/tokens.rb,
lib/l43_peg/failure.rb,
lib/l43_peg/mappers.rb,
lib/l43_peg/parsers.rb,
lib/l43_peg/success.rb,
lib/l43_peg/version.rb,
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/parsers/ws_parser.rb,
lib/l43_peg/combinators/choice.rb,
lib/l43_peg/combinators/ignore.rb,
lib/l43_peg/parsers/end_parser.rb,
lib/l43_peg/parsers/eol_parser.rb,
lib/l43_peg/parsers/int_parser.rb,
lib/l43_peg/parsers/rgx_parser.rb,
lib/l43_peg/combinators/satisfy.rb,
lib/l43_peg/parsers/char_parser.rb,
lib/l43_peg/parsers/list_parser.rb,
lib/l43_peg/parsers/name_parser.rb,
lib/l43_peg/combinators/sequence.rb,
lib/l43_peg/combinators/map_error.rb,
lib/l43_peg/parsers/escape_parser.rb,
lib/l43_peg/parsers/string_parser.rb,
lib/l43_peg/parsers/symbol_parser.rb,
lib/l43_peg/parsers/failure_parser.rb,
lib/l43_peg/parsers/literal_parser.rb,
lib/l43_peg/parsers/success_parser.rb,
lib/l43_peg/combinators/debug_parser.rb

Defined Under Namespace

Modules: Box, BoxFactory, Combinators, Errors, Mappers, Parsers Classes: Failure, Input, Parser, Success, Tokens

Constant Summary collapse

BadParserResult =
Class.new(RuntimeError)
NotABox =
Class.new(RuntimeError)
VERSION =
'0.2.1'

Instance Method Summary collapse

Methods included from Combinators

#boxed, #choice, #debug_parser, #ignore, #lazy, #many, #map, #map_error, #satisfy, #sequence

Methods included from Parsers

#char_parser, #end_parser, #eol_parser, #escape_parser, #failure_parser, #int_parser, #list_parser, #literal_parser, #name_parser, #rgx_parser, #string_parser, #success_parser, #symbol_parser, #ws_parser

Instance Method Details

#parse(input, with: parser, col: 1, lnb: 1) ⇒ Object



18
19
20
21
22
# File 'lib/l43_peg.rb', line 18

def parse(input, with: parser, col: 1, lnb: 1)
  input = Input.new(src: input, col:, lnb:) unless Input === input
  with = Parsers.send with if Symbol === with
  with.(input)
end