class RedParse::ListInNode::HereDocNode

Attributes

list_to_append[RW]

Public Class Methods

new(token) click to toggle source
Calls superclass method RedParse::ListInNode::StringNode::new
# File lib/redparse/node.rb, line 4029
def initialize(token)
  token.node=self
  super(token)
  @startline=token.string.startline
end

Public Instance Methods

flattened_ivars_equal?(other) click to toggle source

ignore instance vars in here documents when testing equality

# File lib/redparse/node.rb, line 4054
def flattened_ivars_equal?(other) 
  StringNode===other
end
saw_body!() click to toggle source

attr :token

# File lib/redparse/node.rb, line 4037
def saw_body!     #not used
  replace with_string_data(token)
  @char=token.quote
  if @list_to_append
    size%2==1 and token << @list_to_append.shift
    push( *@list_to_append )
    remove_instance_variable :@list_to_append
  end
end
translate_escapes(x) click to toggle source
# File lib/redparse/node.rb, line 4047
def translate_escapes x
  return x if @char=="'"
  super
end
unparse(o=default_unparse_options) click to toggle source
# File lib/redparse/node.rb, line 4058
def unparse o=default_unparse_options
  lead=unparse_nl(self,o,'',"\\\n")
  inner=unparse_interior o,@char,@char,
          case @char
          when "'" #single-quoted here doc is a special case;
                   #\ and ' are not special within it
                   #(and therefore always escaped if converted to normal squote str)
                   /['\\]/ 
          when '"'; /#{DQ_EVEN}"/
          when "`"; /#{DQ_EVEN}`/
          else fail
          end 
  
  [lead,@char, inner, @char].join
end