Class: Kapusta::Compiler::MacroExpander
- Inherits:
-
Object
- Object
- Kapusta::Compiler::MacroExpander
- Defined in:
- lib/kapusta/compiler/macro_expander.rb
Defined Under Namespace
Classes: Error
Class Method Summary collapse
Instance Method Summary collapse
- #expand_all(forms) ⇒ Object
-
#initialize(path: nil, loading: nil) ⇒ MacroExpander
constructor
A new instance of MacroExpander.
Constructor Details
#initialize(path: nil, loading: nil) ⇒ MacroExpander
Returns a new instance of MacroExpander.
22 23 24 25 26 |
# File 'lib/kapusta/compiler/macro_expander.rb', line 22 def initialize(path: nil, loading: nil) @macros = {} @path = path @loading = loading || [] end |
Class Method Details
.fresh_gensym(prefix) ⇒ Object
13 14 15 |
# File 'lib/kapusta/compiler/macro_expander.rb', line 13 def fresh_gensym(prefix) MacroGensym.fresh_gensym(prefix) end |
.fresh_local_gensym(prefix) ⇒ Object
17 18 19 |
# File 'lib/kapusta/compiler/macro_expander.rb', line 17 def fresh_local_gensym(prefix) MacroGensym.fresh_local_gensym(prefix) end |
Instance Method Details
#expand_all(forms) ⇒ Object
28 29 30 |
# File 'lib/kapusta/compiler/macro_expander.rb', line 28 def (forms) forms.flat_map { |form| (form) } end |