class RedParse::VarNameToken

Attributes

endline[RW]
lvalue[RW]

Public Instance Methods

all_current_lvars() click to toggle source
# File lib/redparse/node.rb, line 324
def all_current_lvars
  lvar_type==:current ? [ident] : []
end
delete_extraneous_ivars!() click to toggle source
# File lib/redparse/node.rb, line 341
def delete_extraneous_ivars!
  huh
end
dup() click to toggle source
Calls superclass method
# File lib/redparse/node.rb, line 330
def dup
  result=super
  result.ident=@ident.dup
  return result
end
lhs_unparse(o=default_unparse_options;)
Alias for: unparse
lvalue_parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 315
def lvalue_parsetree(o)
  [varname2assigntype, ident.to_sym]
end
old_unused_lvalue() click to toggle source
# File lib/redparse/node.rb, line 319
def old_unused_lvalue #i think this is the correct way, but its overridded below
  return @lvalue if defined? @lvalue
  @lvalue=true
end
parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 270
def parsetree(o)
  type=case ident[0]
   when ?$ 
     case ident[1]
     when ?1..?9; return [:nth_ref,ident[1..-1].to_i]
     when ?&,?+,?`,?'; return [:back_ref,ident[1].chr.to_sym] #`
     else :gvar
     end
   when ?@ 
     if ident[1]==?@
       :cvar
     else
       :ivar
     end
   when ?A..?Z; :const
   else 
     case lvar_type
     when :local; :lvar
     when :block; :dvar
     when :current; :dvar#_curr
     else fail
     end
   end
   return [type,ident.to_sym]
end
unparse(o=default_unparse_options;) click to toggle source
# File lib/redparse/node.rb, line 338
def unparse o=default_unparse_options; ident end
Also aliased as: lhs_unparse
varname2assigntype() click to toggle source
# File lib/redparse/node.rb, line 296
def varname2assigntype
    case ident[0]
    when ?$; :gasgn
    when ?@;
      if ident[1]!=?@;  :iasgn
      elsif in_def;     :cvasgn
      else              :cvdecl
      end
    when ?A..?Z; :cdecl
    else 
      case lvar_type
      when :local; :lasgn
      when :block; :dasgn
      when :current; :dasgn_curr
      else fail
      end
    end
end
walk() { |nil,nil,nil,self| ... } click to toggle source
# File lib/redparse/node.rb, line 345
def walk
  yield nil,nil,nil,self
end