Class: Crisp::Nodes::SymbolLiteral

Inherits:
Primitive
  • Object
show all
Defined in:
lib/crisp/nodes/symbol_literal.rb

Overview

The symbol node

Instance Method Summary collapse

Methods inherited from Primitive

#eval

Methods inherited from Base

#eval, #resolve_and_eval

Instance Method Details

#resolve(env) ⇒ Object

return the value for the key in the env the symbol stays for



6
7
8
9
10
11
12
# File 'lib/crisp/nodes/symbol_literal.rb', line 6

def resolve(env)
  if !env.has_key?(text_value)
    raise Crisp::EnvironmentError, "#{text_value} is unbound"
  end

  env[text_value]
end