Exception: MilkTea::LexError
- Inherits:
-
StandardError
- Object
- StandardError
- MilkTea::LexError
- Defined in:
- lib/milk_tea/core/lexer.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(message, line:, column:, path: nil) ⇒ LexError
constructor
A new instance of LexError.
Constructor Details
#initialize(message, line:, column:, path: nil) ⇒ LexError
Returns a new instance of LexError.
17 18 19 20 21 22 23 24 |
# File 'lib/milk_tea/core/lexer.rb', line 17 def initialize(, line:, column:, path: nil) @line = line @column = column @path = path location = [path, "#{line}:#{column}"].compact.join(":") super(location.empty? ? : "#{} at #{location}") end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
15 16 17 |
# File 'lib/milk_tea/core/lexer.rb', line 15 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
15 16 17 |
# File 'lib/milk_tea/core/lexer.rb', line 15 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
15 16 17 |
# File 'lib/milk_tea/core/lexer.rb', line 15 def path @path end |
Instance Method Details
#code ⇒ Object
26 27 28 |
# File 'lib/milk_tea/core/lexer.rb', line 26 def code "lex/error" end |