fixing Issue #545 ... whitespace-only heredocs.

This commit is contained in:
Jeremy Ashkenas 2010-08-11 00:02:49 -04:00
parent 7142131f3d
commit 12493779b9
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@
return false;
}
quote = match[1].substr(0, 1);
doc = this.sanitizeHeredoc(match[2] || match[4], {
doc = this.sanitizeHeredoc(match[2] || match[4] || '', {
quote: quote
});
this.interpolateString(quote + doc + quote, {

View File

@ -130,7 +130,7 @@ exports.Lexer = class Lexer
heredocToken: ->
return false unless match = @chunk.match(HEREDOC)
quote = match[1].substr 0, 1
doc = @sanitizeHeredoc match[2] or match[4], {quote}
doc = @sanitizeHeredoc match[2] or match[4] or '', {quote}
@interpolateString quote + doc + quote, heredoc: yes
@line += count match[1], "\n"
@i += match[1].length