Exception: Minjs::Lex::ParseError
- Inherits:
-
StandardError
- Object
- StandardError
- Minjs::Lex::ParseError
- Defined in:
- lib/minjs/lex/exceptions.rb
Overview
ParseError
Instance Method Summary collapse
-
#initialize(error_message = nil, lex = nil) ⇒ ParseError
constructor
A new instance of ParseError.
-
#to_s ⇒ Object
to string.
Constructor Details
#initialize(error_message = nil, lex = nil) ⇒ ParseError
Returns a new instance of ParseError.
4 5 6 7 8 9 10 |
# File 'lib/minjs/lex/exceptions.rb', line 4 def initialize( = nil, lex = nil) super() if lex @lex = lex @lex_pos = lex.pos end end |
Instance Method Details
#to_s ⇒ Object
to string
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/minjs/lex/exceptions.rb', line 13 def to_s t = '' t << super t << "\n" if @lex row, col = @lex.row_col(@lex_pos) t << "row: #{row}, col: #{col}\n" t << @lex.debug_str(@lex_pos, row, col) end t end |