Class: Dhaka::ParseErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/dhaka/parser/parse_result.rb

Overview

Returned on unsuccessful parsing of the input token stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unexpected_token, parser_state) ⇒ ParseErrorResult

:nodoc:



32
33
34
35
# File 'lib/dhaka/parser/parse_result.rb', line 32

def initialize(unexpected_token, parser_state) #:nodoc:
  @unexpected_token = unexpected_token
  @parser_state = parser_state
end

Instance Attribute Details

#parser_stateObject (readonly)

Returns the value of attribute parser_state.



30
31
32
# File 'lib/dhaka/parser/parse_result.rb', line 30

def parser_state
  @parser_state
end

#unexpected_tokenObject (readonly)

Returns the value of attribute unexpected_token.



30
31
32
# File 'lib/dhaka/parser/parse_result.rb', line 30

def unexpected_token
  @unexpected_token
end

Instance Method Details

#has_error?Boolean

This is true.

Returns:

  • (Boolean)


38
39
40
# File 'lib/dhaka/parser/parse_result.rb', line 38

def has_error? 
  true
end

#inspectObject

:nodoc:



42
43
44
# File 'lib/dhaka/parser/parse_result.rb', line 42

def inspect #:nodoc:
  "<Dhaka::ParseErrorResult unexpected_token=#{unexpected_token.inspect}>"
end