Class: Rubinius::AST::Break
- Defined in:
- lib/compiler/ast/control_flow.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, expr) ⇒ Break
constructor
A new instance of Break.
- #jump_error(g, name) ⇒ Object
- #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, expr) ⇒ Break
Returns a new instance of Break.
220 221 222 223 |
# File 'lib/compiler/ast/control_flow.rb', line 220 def initialize(line, expr) @line = line @value = expr || NilLiteral.new(line) end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
218 219 220 |
# File 'lib/compiler/ast/control_flow.rb', line 218 def value @value end |
Instance Method Details
#jump_error(g, name) ⇒ Object
225 226 227 228 229 |
# File 'lib/compiler/ast/control_flow.rb', line 225 def jump_error(g, name) g.push_rubinius g.push_literal name g.send :jump_error, 1 end |
#sexp_name ⇒ Object
231 232 233 |
# File 'lib/compiler/ast/control_flow.rb', line 231 def sexp_name :break end |
#to_sexp ⇒ Object
235 236 237 238 239 |
# File 'lib/compiler/ast/control_flow.rb', line 235 def to_sexp sexp = [sexp_name] sexp << @value.to_sexp if @value sexp end |