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:



21
22
23
# File 'lib/parser/parse_result.rb', line 21

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

Instance Attribute Details

#unexpected_tokenObject (readonly)

The token that caused the parse error.



20
21
22
# File 'lib/parser/parse_result.rb', line 20

def unexpected_token
  @unexpected_token
end

Instance Method Details

#has_error?Boolean

This is true.

Returns:

  • (Boolean)


25
26
27
# File 'lib/parser/parse_result.rb', line 25

def has_error? 
  true
end