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.



129
130
131
# File 'lib/lexr.rb', line 129

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

Instance Attribute Details

#characterObject (readonly)

Returns the value of attribute character.



127
128
129
# File 'lib/lexr.rb', line 127

def character
  @character
end

#positionObject (readonly)

Returns the value of attribute position.



127
128
129
# File 'lib/lexr.rb', line 127

def position
  @position
end

Instance Method Details

#inspectObject



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

def inspect
	message
end

#messageObject



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

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