Exception: RLTK::LexingError
- Defined in:
- lib/rltk/lexer.rb
Overview
A LexingError exception is raised when an input stream contains a substring that isn’t matched by any of a lexer’s rules.
Instance Method Summary collapse
-
#initialize(stream_offset, line_number, line_offset, remainder) ⇒ LexingError
constructor
A new instance of LexingError.
-
#to_s ⇒ String
String representation of the error.
Constructor Details
#initialize(stream_offset, line_number, line_offset, remainder) ⇒ LexingError
Returns a new instance of LexingError.
30 31 32 33 34 35 |
# File 'lib/rltk/lexer.rb', line 30 def initialize(stream_offset, line_number, line_offset, remainder) @stream_offset = stream_offset @line_number = line_number @line_offset = line_offset @remainder = remainder end |
Instance Method Details
#to_s ⇒ String
Returns String representation of the error.
38 39 40 |
# File 'lib/rltk/lexer.rb', line 38 def to_s "#{super()}: #{@remainder}" end |