Exception: FifthedSim::Compiler::CompileError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/fifthed_sim/compiler.rb

Direct Known Subclasses

TransformError

Instance Attribute Summary collapse

Instance Method Summary collapse

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.message
  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

#charObject (readonly)

Returns the value of attribute char.



31
32
33
# File 'lib/fifthed_sim/compiler.rb', line 31

def char
  @char
end

#lineObject (readonly)

Returns the value of attribute line.



30
31
32
# File 'lib/fifthed_sim/compiler.rb', line 30

def line
  @line
end

#tree_causeObject (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