Class: RedParse::DoubleColonNode

Inherits:
ValueNode show all
Defined in:
lib/redparse/node.rb

Overview

obsolete

Constant Summary

Constants included from FlattenedIvars

FlattenedIvars::EXCLUDED_IVARS

Instance Attribute Summary collapse

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 Node

#+, #+@, #==, [], #[]=, #add_parent_links!, #begin_parsetree, create, #data, #deep_copy, #delete_extraneous_ivars!, #delete_linenums!, #depthwalk, #depthwalk_nodes, #error?, #evalable_inspect, #fixup_multiple_assignments!, #fixup_rescue_assignments!, #initialize_ivars, inline_symbols, #inspect, #lhs_unparse, #linerange, #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, #to_parsetree, #to_parsetree_and_warnings, #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(val1, op, val2 = nil) ⇒ DoubleColonNode



1829
1830
1831
1832
1833
1834
# File 'lib/redparse/node.rb', line 1829

def initialize(val1,op,val2=nil)
  val1,op,val2=nil,val1,op unless val2
  val1=val1.ident if VarNode===val1 and /\A#{UCLETTER}/o===val1.ident
  val2=val2.ident if VarNode===val1 and /\A#{UCLETTER}/o===val2.ident
  replace [val1,val2]
end

Instance Attribute Details

#lvalueObject



1851
1852
1853
1854
# File 'lib/redparse/node.rb', line 1851

def lvalue
  return @lvalue if defined? @lvalue
  @lvalue=true
end

Instance Method Details

#imageObject



1836
# File 'lib/redparse/node.rb', line 1836

def image; '(::)' end

#lvalue_parsetree(o) ⇒ Object



1847
1848
1849
# File 'lib/redparse/node.rb', line 1847

def lvalue_parsetree(o)
  [:cdecl,parsetree(o)]
end

#parsetree(o) ⇒ Object



1839
1840
1841
1842
1843
1844
1845
1846
# File 'lib/redparse/node.rb', line 1839

def parsetree(o)
  if namespace
    ns= (String===namespace) ? [:const,namespace.to_sym] : namespace.parsetree(o)
    [:colon2, ns, constant.to_sym]
  else
    [:colon3, constant.to_sym]
  end
end