Class: Apricot::Scope

Inherits:
Object show all
Defined in:
lib/apricot/scopes.rb

Direct Known Subclasses

FnScope, LetScope, OverloadScope

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Scope

Returns a new instance of Scope.



52
53
54
55
56
# File 'lib/apricot/scopes.rb', line 52

def initialize(parent)
  @parent = parent
  @variables = {}
  @loop_label = nil
end

Instance Attribute Details

#loop_labelObject

The loop label stores the code location where a (recur) form should jump to.



50
51
52
# File 'lib/apricot/scopes.rb', line 50

def loop_label
  @loop_label
end

#parentObject (readonly)

Returns the value of attribute parent.



47
48
49
# File 'lib/apricot/scopes.rb', line 47

def parent
  @parent
end

#variablesObject (readonly)

Returns the value of attribute variables.



47
48
49
# File 'lib/apricot/scopes.rb', line 47

def variables
  @variables
end