Class: Jade::Frontend::SemanticAnalysis::Scope

Inherits:
Data
  • Object
show all
Defined in:
lib/jade/frontend/semantic_analysis.rb

Instance Method Summary collapse

Constructor Details

#initialize(bindings: {}) ⇒ Scope

Returns a new instance of Scope.



147
148
149
# File 'lib/jade/frontend/semantic_analysis.rb', line 147

def initialize(bindings: {})
  super
end

Instance Method Details

#bind(name, symbol) ⇒ Object



151
152
153
# File 'lib/jade/frontend/semantic_analysis.rb', line 151

def bind(name, symbol)
  with(bindings: bindings.merge(name => symbol))
end

#lookup(name) ⇒ Object



155
156
157
# File 'lib/jade/frontend/semantic_analysis.rb', line 155

def lookup(name)
  bindings[name]
end