Exception: MilkTea::LoweringError
- Inherits:
-
StandardError
- Object
- StandardError
- MilkTea::LoweringError
- Defined in:
- lib/milk_tea/core/lowering.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(msg = nil, line: nil, column: nil, path: nil) ⇒ LoweringError
constructor
A new instance of LoweringError.
- #to_diagnostic(path: nil) ⇒ Object
Constructor Details
#initialize(msg = nil, line: nil, column: nil, path: nil) ⇒ LoweringError
Returns a new instance of LoweringError.
52 53 54 55 56 57 |
# File 'lib/milk_tea/core/lowering.rb', line 52 def initialize(msg = nil, line: nil, column: nil, path: nil) super(msg) @line = line @column = column @path = path end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
50 51 52 |
# File 'lib/milk_tea/core/lowering.rb', line 50 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
50 51 52 |
# File 'lib/milk_tea/core/lowering.rb', line 50 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
50 51 52 |
# File 'lib/milk_tea/core/lowering.rb', line 50 def path @path end |
Instance Method Details
#code ⇒ Object
59 60 61 |
# File 'lib/milk_tea/core/lowering.rb', line 59 def code "lowering/internal" end |
#to_diagnostic(path: nil) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/milk_tea/core/lowering.rb', line 63 def to_diagnostic(path: nil) Diagnostic.new( path: @path || path, line: @line, column: @column, length: nil, code: code, message: , severity: :error, ) end |