Class: TRuby::ParserCombinator::EndOfInput
- Defined in:
- lib/t_ruby/parser_combinator.rb
Overview
Parse end of input
Instance Method Summary collapse
Methods inherited from Parser
#<<, #>>, #between, #flat_map, #label, #lookahead, #many, #many1, #map, #not_followed_by, #optional, #sep_by, #sep_by1, #|
Instance Method Details
#parse(input, position = 0) ⇒ Object
183 184 185 186 187 188 189 |
# File 'lib/t_ruby/parser_combinator.rb', line 183 def parse(input, position = 0) if position >= input.length ParseResult.success(nil, input, position) else ParseResult.failure("Expected end of input", input, position) end end |