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.



120
121
122
# File 'lib/lexr.rb', line 120

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

Instance Attribute Details

#characterObject (readonly)

Returns the value of attribute character.



118
119
120
# File 'lib/lexr.rb', line 118

def character
  @character
end

#positionObject (readonly)

Returns the value of attribute position.



118
119
120
# File 'lib/lexr.rb', line 118

def position
  @position
end

Instance Method Details

#inspectObject



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

def inspect
	message
end

#messageObject



124
125
126
# File 'lib/lexr.rb', line 124

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