Class: Rubasteme::AST::IdentifierDefinitionNode
Instance Method Summary
collapse
Methods inherited from ListNode
#elements, #empty?, #first, #rest
Methods inherited from BranchNode
#<<, #[], #[]=, #each, #size, #to_a
Methods inherited from Node
#to_a, #to_s, #type
Constructor Details
255
256
257
258
259
|
# File 'lib/rubasteme/ast/branch_node.rb', line 255
def initialize(_ = nil)
super(2, _)
end
|
Instance Method Details
#body ⇒ Object
281
282
283
|
# File 'lib/rubasteme/ast/branch_node.rb', line 281
def body
lambda? ? expression.body : nil
end
|
277
278
279
|
# File 'lib/rubasteme/ast/branch_node.rb', line 277
def def_formals
lambda? ? expression.formals : nil
end
|
#expression ⇒ Object
269
270
271
|
# File 'lib/rubasteme/ast/branch_node.rb', line 269
def expression
@nodes[1]
end
|
#expression=(node) ⇒ Object
273
274
275
|
# File 'lib/rubasteme/ast/branch_node.rb', line 273
def expression=(node)
@nodes[1] = node
end
|
#identifier ⇒ Object
261
262
263
|
# File 'lib/rubasteme/ast/branch_node.rb', line 261
def identifier
@nodes[0]
end
|
#identifier=(node) ⇒ Object
265
266
267
|
# File 'lib/rubasteme/ast/branch_node.rb', line 265
def identifier=(node)
@nodes[0] = node
end
|