class Yadriggy::Identifier

Identifier.

Public Class Methods

new(sexp) click to toggle source
Calls superclass method Yadriggy::IdentifierOrCall::new
# File lib/yadriggy/ast.rb, line 112
def initialize(sexp)
  super(sexp)
end
tags() click to toggle source
# File lib/yadriggy/ast.rb, line 110
def self.tags() [:@ident, :@op] end

Public Instance Methods

accept(evaluator) click to toggle source

A method for Visitor pattern. @param [Eval] evaluator the visitor of Visitor pattern. @return [void]

# File lib/yadriggy/ast.rb, line 119
def accept(evaluator)
  evaluator.identifier(self)
end
value() click to toggle source
# File lib/yadriggy/ast_value.rb, line 67
def value()
  c = root.context
  if c.is_a?(Proc)
    if c.binding.local_variable_defined?(name)
      c.binding.local_variable_get(name)
    else
      Undef
    end
  else # c is Method or UnboundMethod
    Undef
  end
end