Class: Chelsy::Macro
Overview
AST node represents a macro invocation with or without arguments.
Instance Attribute Summary collapse
-
#args ⇒ Enumerable
readonly
Arguments.
-
#name ⇒ Symbol
readonly
Macro name.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(name, args = nil, **rest) ⇒ Macro
constructor
initialize instance.
Constructor Details
#initialize(name, args = nil, **rest) ⇒ Macro
initialize instance.
1167 1168 1169 1170 1171 1172 |
# File 'lib/chelsy/ast.rb', line 1167 def initialize(name, args=nil, **rest) @name = Syntax::Ident.ensure(name) @args = args.map {|a| Syntax::Expr.ensure(a) } if args super **rest end |
Instance Attribute Details
#args ⇒ Enumerable (readonly)
1158 1159 1160 |
# File 'lib/chelsy/ast.rb', line 1158 def args @args end |
#name ⇒ Symbol (readonly)
1158 1159 1160 |
# File 'lib/chelsy/ast.rb', line 1158 def name @name end |