Class: StarlarkCompiler::AST::FunctionDeclaration
- Defined in:
- lib/starlark_compiler/ast.rb
Constant Summary
Constants inherited from Node
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, args, body, **kwargs) ⇒ FunctionDeclaration
constructor
A new instance of FunctionDeclaration.
Constructor Details
#initialize(name, args, body, **kwargs) ⇒ FunctionDeclaration
Returns a new instance of FunctionDeclaration.
148 149 150 151 152 153 |
# File 'lib/starlark_compiler/ast.rb', line 148 def initialize(name, args, body, **kwargs) @name = name @args = args.map(&method(:node)) @body = body.map(&method(:node)) @kwargs = kwargs.transform_values(&method(:node)) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
147 148 149 |
# File 'lib/starlark_compiler/ast.rb', line 147 def args @args end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
147 148 149 |
# File 'lib/starlark_compiler/ast.rb', line 147 def body @body end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
147 148 149 |
# File 'lib/starlark_compiler/ast.rb', line 147 def kwargs @kwargs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
147 148 149 |
# File 'lib/starlark_compiler/ast.rb', line 147 def name @name end |