Class: Riml::Compiler::GetVariableNodeVisitor

Inherits:
ScopedVisitor show all
Defined in:
lib/riml/compiler.rb

Overview

scope_modifier, name

Instance Method Summary collapse

Methods inherited from Visitor

#initialize, #visit

Constructor Details

This class inherits a constructor from Riml::Compiler::Visitor

Instance Method Details

#compile(node) ⇒ Object



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/riml/compiler.rb', line 340

def compile(node)
  set_modifier(node)

  if node.scope && node.scope.function?
    if splat = node.scope.function.splat
      check_for_splat_match!(node, splat)
    end
  end

  if node.question_existence?
    node.compiled_output = %Q{exists("#{node.full_name}")}
  else
    node.compiled_output = "#{node.full_name}"
  end
end