Exception: FifthedSim::Compiler::TransformError

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

Instance Attribute Summary collapse

Attributes inherited from CompileError

#char, #line, #tree_cause

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ TransformError

Returns a new instance of TransformError.



36
37
38
39
40
41
42
43
# File 'lib/fifthed_sim/compiler.rb', line 36

def initialize(hash)
  @message = "Could not transform"
  if hash.is_a? Hash
    @source_hash = hash
    @line, @char = hash.values.keep_if{|x| x.is_a? Parslet::Slice}
      .first.line_and_column
  end
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



45
46
47
# File 'lib/fifthed_sim/compiler.rb', line 45

def message
  @message
end

#source_hashObject (readonly)

Returns the value of attribute source_hash.



45
46
47
# File 'lib/fifthed_sim/compiler.rb', line 45

def source_hash
  @source_hash
end