Class: RedParse::RawOpNode
- Defined in:
- lib/redparse/node.rb,
lib/redparse/node.rb,
lib/redparse/ReduceWithsFor_RedParse_1_9.rb,
lib/redparse/ReduceWithsFor_RedParse_1_8.rb
Overview
forward decls
Direct Known Subclasses
ArrowOpNode, IfOpNode, LogicalNode, OpNode, RangeNode, RescueOpNode, UnlessOpNode, UntilOpNode, WhileOpNode
Constant Summary
Constants included from FlattenedIvars
FlattenedIvars::EXCLUDED_IVARS
Instance Attribute Summary
Attributes inherited from Node
#endline, #errors, #offset, #parent, #startline
Attributes included from Stackable::Meta
#boolean_identity_params, #identity_params
Class Method Summary collapse
-
.create(left, op, right) ⇒ Object
def initialize_copy other rebuild(other.left,other.op,other.right) end.
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(*args) ⇒ RawOpNode
constructor
A new instance of RawOpNode.
- #raw_unparse(o) ⇒ Object
- #reducer_ident ⇒ Object
Methods inherited from ValueNode
Methods inherited from Node
#+, #+@, #==, [], #[]=, #add_parent_links!, #args_rip, #begin_parsetree, #classic_inspect, #data, #deep_copy, #delete_extraneous_ivars!, #delete_linenums!, #depthwalk, #depthwalk_nodes, #error?, #evalable_inspect, #fixup_multiple_assignments!, #fixup_rescue_assignments!, #force_stmt_list_rip, #initialize_ivars, inline_symbols, #inspect, #lhs_unparse, #linerange, #lvalue, #lvars_defined_in, #merge_replacement_session, namelist, #negate, #original_brackets_assign, param_names, #parsetree, #parsetrees, #pretty_print, #prohibit_fixup, #replace_ivars_and_self, #replace_value, #rescue_parsetree, #rfind, #rfind_all, #rgrep, #rip_and_rescues, #rip_explode!, #short_inspect, #stmts_rip, #to_parsetree, #to_parsetree_and_warnings, #to_ruby, #to_s, #unary, #walk, #xform_tree!
Methods included from Stackable::Meta
#build_exemplars, #enumerate_exemplars, #identity_param
Methods included from FlattenedIvars
#flattened_ivars, #flattened_ivars_equal?
Methods included from Stackable
Constructor Details
#initialize(*args) ⇒ RawOpNode
Returns a new instance of RawOpNode.
1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 |
# File 'lib/redparse/node.rb', line 1358 def initialize(*args) =args.pop if Hash===args.last if args.size==2 left,right=*args op=nil else left,op,right=*args end if op.respond_to? :ident @offset=op.offset op=op.ident end args=left,op,right args.push if super( *args ) end |
Class Method Details
.create(left, op, right) ⇒ Object
def initialize_copy other
rebuild(other.left,other.op,other.right)
end
1379 1380 1381 1382 1383 |
# File 'lib/redparse/node.rb', line 1379 def self.create(left,op,right) op_s=op.ident k=OP2CLASS[op_s]||OpNode k.new(left,op,right) end |
Instance Method Details
#image ⇒ Object
1385 |
# File 'lib/redparse/node.rb', line 1385 def image; "(#{op})" end |
#raw_unparse(o) ⇒ Object
1387 1388 1389 1390 1391 |
# File 'lib/redparse/node.rb', line 1387 def raw_unparse o l=left.unparse(o) l[/(~| \Z)/] and maybesp=" " [l,op,maybesp,right.unparse(o)].to_s end |
#reducer_ident ⇒ Object
17560 17561 17562 |
# File 'lib/redparse/ReduceWithsFor_RedParse_1_9.rb', line 17560 def reducer_ident :RawOpNode end |