Class: RedParse::UnaryStarNode

Inherits:
UnOpNode show all
Defined in:
lib/redparse/node.rb,
lib/redparse/ReduceWithsFor_RedParse_1_9.rb,
lib/redparse/ReduceWithsFor_RedParse_1_8.rb

Direct Known Subclasses

DanglingStarNode

Constant Summary

Constants included from FlattenedIvars

FlattenedIvars::EXCLUDED_IVARS

Instance Attribute Summary collapse

Attributes inherited from UnOpNode

#lvalue

Attributes inherited from Node

#endline, #errors, #offset, #parent, #startline

Attributes included from Stackable::Meta

#boolean_identity_params, #identity_params

Instance Method Summary collapse

Methods inherited from UnOpNode

#arg, #arg=, create, #image, #rip, #to_lisp

Methods inherited from ValueNode

#lvalue, #reducer_method

Methods inherited from Node

#+, #+@, #==, #[]=, #add_parent_links!, #args_rip, #begin_parsetree, #classic_inspect, create, #data, #deep_copy, #delete_extraneous_ivars!, #delete_linenums!, #depthwalk, #depthwalk_nodes, #error?, #evalable_inspect, #fixup_multiple_assignments!, #fixup_rescue_assignments!, #force_stmt_list_rip, #image, #initialize_ivars, inline_symbols, #inspect, #lhs_unparse, #linerange, #lvalue, #lvars_defined_in, #merge_replacement_session, namelist, #negate, #original_brackets_assign, param_names, #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

#identity_name

Constructor Details

#initialize(*args) ⇒ UnaryStarNode

Returns a new instance of UnaryStarNode.



1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
# File 'lib/redparse/node.rb', line 1841

def initialize(*args)
  options=args.pop if Hash===args.last
  if args.size==1
    op="*@"
    val=args.first
  else
    op,val=*args
  end
  op.ident="*@" if op.respond_to? :ident
  args=[op,val]
  args.push options if options
  super(*args)
end

Instance Attribute Details

#after_comma ⇒ Object

Returns the value of attribute after_comma.



1867
1868
1869
# File 'lib/redparse/node.rb', line 1867

def after_comma
  @after_comma
end

Instance Method Details

#all_current_lvars ⇒ Object



1863
1864
1865
1866
# File 'lib/redparse/node.rb', line 1863

def all_current_lvars
  val.respond_to?(:all_current_lvars) ?
    val.all_current_lvars : []
end

#lvalue_parsetree(o) ⇒ Object



1869
1870
1871
# File 'lib/redparse/node.rb', line 1869

def lvalue_parsetree o
  val.lvalue_parsetree(o)
end

#parsetree(o) ⇒ Object



1859
1860
1861
# File 'lib/redparse/node.rb', line 1859

def parsetree(o)
  [:splat, val.rescue_parsetree(o)]
end

#reducer_ident ⇒ Object



17425
17426
17427
# File 'lib/redparse/ReduceWithsFor_RedParse_1_9.rb', line 17425

def reducer_ident
  :UnaryStarNode
end

#unparse(o = default_unparse_options) ⇒ Object



1875
1876
1877
# File 'lib/redparse/node.rb', line 1875

def unparse o=default_unparse_options
  "*"+val.unparse(o)      
end