Class: Kumi::Core::Analyzer::MacroExpander
- Inherits:
-
Object
- Object
- Kumi::Core::Analyzer::MacroExpander
- Defined in:
- lib/kumi/core/analyzer/macro_expander.rb
Overview
Takes a function’s ‘expand` template and pre-normalized NAST arguments, and recursively builds a new NAST tree representing the expansion.
Constant Summary collapse
- NAST =
Kumi::Core::NAST
Class Method Summary collapse
Instance Method Summary collapse
- #expand ⇒ Object
-
#initialize(func, normalized_args, loc, errors) ⇒ MacroExpander
constructor
A new instance of MacroExpander.
Constructor Details
#initialize(func, normalized_args, loc, errors) ⇒ MacroExpander
Returns a new instance of MacroExpander.
15 16 17 18 19 20 |
# File 'lib/kumi/core/analyzer/macro_expander.rb', line 15 def initialize(func, normalized_args, loc, errors) @func = func @normalized_args = normalized_args @loc = loc @errors = errors end |
Class Method Details
.expand(func, normalized_args, loc, errors) ⇒ Object
11 12 13 |
# File 'lib/kumi/core/analyzer/macro_expander.rb', line 11 def self.(func, normalized_args, loc, errors) new(func, normalized_args, loc, errors). end |
Instance Method Details
#expand ⇒ Object
22 23 24 |
# File 'lib/kumi/core/analyzer/macro_expander.rb', line 22 def build_nast_node(@func.) end |