Class: CodeTools::AST::OpAssignAnd
- Defined in:
- lib/rubinius/ast/operators.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
- #defined(g) ⇒ Object
-
#initialize(line, left, right) ⇒ OpAssignAnd
constructor
A new instance of OpAssignAnd.
- #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, #or_bytecode, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, left, right) ⇒ OpAssignAnd
Returns a new instance of OpAssignAnd.
400 401 402 403 404 |
# File 'lib/rubinius/ast/operators.rb', line 400 def initialize(line, left, right) @line = line @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
398 399 400 |
# File 'lib/rubinius/ast/operators.rb', line 398 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
398 399 400 |
# File 'lib/rubinius/ast/operators.rb', line 398 def right @right end |
Instance Method Details
#bytecode(g) ⇒ Object
406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/rubinius/ast/operators.rb', line 406 def bytecode(g) pos(g) @left.bytecode(g) lbl = g.new_label g.dup g.gif lbl g.pop @right.bytecode(g) lbl.set! end |
#defined(g) ⇒ Object
418 419 420 |
# File 'lib/rubinius/ast/operators.rb', line 418 def defined(g) g.push_literal "assignment" end |
#sexp_name ⇒ Object
422 423 424 |
# File 'lib/rubinius/ast/operators.rb', line 422 def sexp_name :op_asgn_and end |
#to_sexp ⇒ Object
426 427 428 |
# File 'lib/rubinius/ast/operators.rb', line 426 def to_sexp [sexp_name, @left.to_sexp, @right.to_sexp] end |