class RedParse::ListInNode::AccessorAssignNode

Public Instance Methods

parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 2802
def parsetree(o)
  op=op().ident.chomp('=')
  rcvr=left.parsetree(o)
  prop=property.ident.<<(?=).to_sym
  rhs=right.parsetree(o)
  if op.empty?
    [:attrasgn, rcvr, prop, [:array, args] ]
  else
    [:op_asgn2, rcvr,prop,  op.to_sym, args]
  end
end
to_lisp() click to toggle source
# File lib/redparse/node.rb, line 2790
def to_lisp
  if op.ident=='='
    "(#{left.to_lisp} #{property.ident}= #{right.to_lisp})"
  else
    op=op().ident.chomp('=')
    varname=nil
    "(let #{varname=huh} #{left.to_lisp} "+
      "(#{varname} #{property.ident}= "+
        "(#{op} (#{varname} #{property.ident}) #{right.to_lisp})))"
  end
end