Exception: FifthedSim::Compiler::CompileError
- Inherits:
-
StandardError
- Object
- StandardError
- FifthedSim::Compiler::CompileError
- Defined in:
- lib/fifthed_sim/compiler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#char ⇒ Object
readonly
Returns the value of attribute char.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#tree_cause ⇒ Object
readonly
Returns the value of attribute tree_cause.
Instance Method Summary collapse
-
#initialize(err) ⇒ CompileError
constructor
A new instance of CompileError.
Constructor Details
#initialize(err) ⇒ CompileError
Returns a new instance of CompileError.
23 24 25 26 27 28 29 |
# File 'lib/fifthed_sim/compiler.rb', line 23 def initialize(err) msg = err. super(msg) @line = msg.match(/line (\d+)/)[1].to_i @char = msg.match(/char (\d+)/)[1].to_i @tree_cause = err.cause.ascii_tree end |
Instance Attribute Details
#char ⇒ Object (readonly)
Returns the value of attribute char.
31 32 33 |
# File 'lib/fifthed_sim/compiler.rb', line 31 def char @char end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
30 31 32 |
# File 'lib/fifthed_sim/compiler.rb', line 30 def line @line end |
#tree_cause ⇒ Object (readonly)
Returns the value of attribute tree_cause.
32 33 34 |
# File 'lib/fifthed_sim/compiler.rb', line 32 def tree_cause @tree_cause end |