Class: Rubinius::AST::OpAssign2
- Defined in:
- lib/compiler/ast/operators.rb
Instance Attribute Summary collapse
-
#assign ⇒ Object
Returns the value of attribute assign.
-
#name ⇒ Object
Returns the value of attribute name.
-
#op ⇒ Object
Returns the value of attribute op.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, receiver, name, op, value) ⇒ OpAssign2
constructor
A new instance of OpAssign2.
- #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, receiver, name, op, value) ⇒ OpAssign2
Returns a new instance of OpAssign2.
64 65 66 67 68 69 70 71 |
# File 'lib/compiler/ast/operators.rb', line 64 def initialize(line, receiver, name, op, value) @line = line @receiver = receiver @name = name @op = op @value = value @assign = name.to_s[-1] == ?= ? name : :"#{name}=" end |
Instance Attribute Details
#assign ⇒ Object
Returns the value of attribute assign.
62 63 64 |
# File 'lib/compiler/ast/operators.rb', line 62 def assign @assign end |
#name ⇒ Object
Returns the value of attribute name.
62 63 64 |
# File 'lib/compiler/ast/operators.rb', line 62 def name @name end |
#op ⇒ Object
Returns the value of attribute op.
62 63 64 |
# File 'lib/compiler/ast/operators.rb', line 62 def op @op end |
#receiver ⇒ Object
Returns the value of attribute receiver.
62 63 64 |
# File 'lib/compiler/ast/operators.rb', line 62 def receiver @receiver end |
#value ⇒ Object
Returns the value of attribute value.
62 63 64 |
# File 'lib/compiler/ast/operators.rb', line 62 def value @value end |
Instance Method Details
#to_sexp ⇒ Object
73 74 75 76 |
# File 'lib/compiler/ast/operators.rb', line 73 def to_sexp op = @op == :or ? :"||" : :"&&" [:op_asgn2, @receiver.to_sexp, :"#{@name}=", op, @value.to_sexp] end |