Class: Dhaka::ParseErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/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) ⇒ ParseErrorResult

:nodoc:



35
36
37
# File 'lib/parser/parse_result.rb', line 35

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

Instance Attribute Details

#unexpected_tokenObject (readonly)

The token that caused the parse error.



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

def unexpected_token
  @unexpected_token
end

Instance Method Details

#has_error?Boolean

This is true.

Returns:

  • (Boolean)


40
41
42
# File 'lib/parser/parse_result.rb', line 40

def has_error? 
  true
end