Class: RLSL::Prism::IR::Return

Inherits:
Node
  • Object
show all
Defined in:
lib/rlsl/prism/ir/control_flow.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods inherited from Node

#accept, visits

Constructor Details

#initialize(expression) ⇒ Return

Returns a new instance of Return.



25
26
27
28
29
# File 'lib/rlsl/prism/ir/control_flow.rb', line 25

def initialize(expression)
  super()
  @expression = expression
  @type = expression&.type
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



21
22
23
# File 'lib/rlsl/prism/ir/control_flow.rb', line 21

def expression
  @expression
end