class Dhallish::Ast::VariableNode
Attributes
varname[RW]
Public Class Methods
new(varname)
click to toggle source
# File lib/ast.rb, line 104 def initialize(varname) @varname = varname end
Public Instance Methods
compute_type(ctx)
click to toggle source
returns a Type for a defined Variable @varname that does not have Type 'Type' returns a Value of Type 'Type' if @varname is a Typevariable
# File lib/ast.rb, line 110 def compute_type(ctx) assert ("Undefined Variable \"#{@varname}\"") { !ctx[@varname].nil? } type = ctx[@varname] assert ("WTF?!") { Types::is_a_type? type } ctx[@varname] end
evaluate(ctx)
click to toggle source
# File lib/ast.rb, line 117 def evaluate(ctx) ctx[@varname] end