Class: TRuby::ParserCombinator::Fail

Inherits:
Parser
  • Object
show all
Defined in:
lib/t_ruby/parser_combinator.rb

Overview

Always fail

Instance Method Summary collapse

Methods inherited from Parser

#<<, #>>, #between, #flat_map, #label, #lookahead, #many, #many1, #map, #not_followed_by, #optional, #sep_by, #sep_by1, #|

Constructor Details

#initialize(message) ⇒ Fail



205
206
207
# File 'lib/t_ruby/parser_combinator.rb', line 205

def initialize(message)
  @message = message
end

Instance Method Details

#parse(input, position = 0) ⇒ Object



209
210
211
# File 'lib/t_ruby/parser_combinator.rb', line 209

def parse(input, position = 0)
  ParseResult.failure(@message, input, position)
end