From 12493779b9da29d96c949f092d0923cb25a7971f Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 11 Aug 2010 00:02:49 -0400 Subject: [PATCH] fixing Issue #545 ... whitespace-only heredocs. --- lib/lexer.js | 2 +- src/lexer.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lexer.js b/lib/lexer.js index 8cf3c9bf..c23e2d33 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -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, { diff --git a/src/lexer.coffee b/src/lexer.coffee index 364592f8..3a70fd72 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -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