Class: Jade::Frontend::SemanticAnalysis::Scope
- Inherits:
-
Data
- Object
- Data
- Jade::Frontend::SemanticAnalysis::Scope
- Defined in:
- lib/jade/frontend/semantic_analysis.rb
Instance Method Summary collapse
- #bind(name, symbol) ⇒ Object
-
#initialize(bindings: {}) ⇒ Scope
constructor
A new instance of Scope.
- #lookup(name) ⇒ Object
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 |