Method: Atomy::Module#compile

Defined in:
lib/atomy/module.rb

#compile(gen, node) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/atomy/module.rb', line 35

def compile(gen, node)
  gen.set_line(node.line) if node.respond_to?(:line) && node.line

  expanded = node
  while expanded.is_a?(Atomy::Grammar::AST::Node)
    expanded = expand(expanded)
  end

  expanded.bytecode(gen, self)
rescue
  puts "when compiling: #{node}"
  raise
end