class RedParse::ListInNode::OpNode

Public Class Methods

new(left,op,right) click to toggle source
Calls superclass method RedParse::ListInNode::RawOpNode::new
# File lib/redparse/node.rb, line 1395
def initialize(left,op,right)
  #@negative_of="="+$1 if /^!([=~])$/===op
  op=op.ident if op.respond_to? :ident
  super left,op,right      
end

Public Instance Methods

opnode_parsetree(o)
Alias for: parsetree
parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 1404
def parsetree(o)
  [:call, 
     left.rescue_parsetree(o), 
     op.to_sym, 
     [:array, right.rescue_parsetree(o)]
  ]
end
Also aliased as: opnode_parsetree
to_lisp() click to toggle source
# File lib/redparse/node.rb, line 1400
def to_lisp
  "(#{op} #{left.to_lisp} #{right.to_lisp})"
end
unparse(o=default_unparse_options) click to toggle source
# File lib/redparse/node.rb, line 1413
def unparse o=default_unparse_options
  result=l=left.unparse(o)
  result+=" " if /\A(?:!|#{LCLETTER})/o===op
  result+=op
  result+=" " if /#{LETTER_DIGIT}\Z/o===op or / \Z/===l
  result+=right.unparse(o)      
end