# File lib/puppet/parser/lexer.rb, line 520
520:   def slurpstring(terminators,escapes=%w{ \\  $ ' " n t s }+["\n"],ignore_invalid_escapes=false)
521:     # we search for the next quote that isn't preceded by a
522:     # backslash; the caret is there to match empty strings
523:     str = @scanner.scan_until(/([^\\]|^|[^\\])([\\]{2})*[#{terminators}]/) or lex_error "Unclosed quote after '#{last}' in '#{rest}'"
524:     @line += str.count("\n") # literal carriage returns add to the line count.
525:     str.gsub!(/\\(.)/m) {
526:       ch = $1
527:       if escapes.include? ch
528:         case ch
529:         when 'n'; "\n"
530:         when 't'; "\t"
531:         when 's'; " "
532:         when "\n": ''
533:         else      ch
534:         end
535:       else
536:         Puppet.warning "Unrecognised escape sequence '\\#{ch}'#{file && " in file #{file}"}#{line && " at line #{line}"}" unless ignore_invalid_escapes
537:         "\\#{ch}"
538:       end
539:     }
540:     [ str[0..-2],str[-1,1] ]
541:   end