Exception: Lexr::UnmatchableTextError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lexr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(character, position) ⇒ UnmatchableTextError

Returns a new instance of UnmatchableTextError.



134
135
136
# File 'lib/lexr.rb', line 134

def initialize(character, position)
  @character, @position = character, position
end

Instance Attribute Details

#characterObject (readonly)

Returns the value of attribute character.



132
133
134
# File 'lib/lexr.rb', line 132

def character
  @character
end

#positionObject (readonly)

Returns the value of attribute position.



132
133
134
# File 'lib/lexr.rb', line 132

def position
  @position
end

Instance Method Details

#inspectObject



142
143
144
# File 'lib/lexr.rb', line 142

def inspect
  message
end

#messageObject



138
139
140
# File 'lib/lexr.rb', line 138

def message
  "Unexpected character '#{character}' at position #{position + 1}"
end