Class: Dhaka::TokenizerErrorResult

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

Overview

Returned when tokenizing fails due to an unexpected character in the input stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unexpected_char_index) ⇒ TokenizerErrorResult

Returns a new instance of TokenizerErrorResult.



29
30
31
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 29

def initialize(unexpected_char_index)
  @unexpected_char_index = unexpected_char_index
end

Instance Attribute Details

#unexpected_char_indexObject (readonly)

The index of the character that caused the error.



27
28
29
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 27

def unexpected_char_index
  @unexpected_char_index
end

Instance Method Details

#has_error?Boolean

Returns true.

Returns:

  • (Boolean)


34
35
36
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 34

def has_error?
  true
end