Class: Rubinius::AST::While
- Defined in:
- lib/compiler/ast/control_flow.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#check_first ⇒ Object
Returns the value of attribute check_first.
-
#condition ⇒ Object
Returns the value of attribute condition.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, condition, body, check_first) ⇒ While
constructor
A new instance of While.
- #sexp_name ⇒ Object
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, condition, body, check_first) ⇒ While
Returns a new instance of While.
154 155 156 157 158 159 |
# File 'lib/compiler/ast/control_flow.rb', line 154 def initialize(line, condition, body, check_first) @line = line @condition = condition @body = body || NilLiteral.new(line) @check_first = check_first end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
152 153 154 |
# File 'lib/compiler/ast/control_flow.rb', line 152 def body @body end |
#check_first ⇒ Object
Returns the value of attribute check_first.
152 153 154 |
# File 'lib/compiler/ast/control_flow.rb', line 152 def check_first @check_first end |
#condition ⇒ Object
Returns the value of attribute condition.
152 153 154 |
# File 'lib/compiler/ast/control_flow.rb', line 152 def condition @condition end |
Instance Method Details
#sexp_name ⇒ Object
161 162 163 |
# File 'lib/compiler/ast/control_flow.rb', line 161 def sexp_name :while end |
#to_sexp ⇒ Object
165 166 167 |
# File 'lib/compiler/ast/control_flow.rb', line 165 def to_sexp [sexp_name, @condition.to_sexp, @body.to_sexp, @check_first] end |