From a2969577718d851263d36e30b2e029f3c15d7c29 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 10 Nov 2011 01:09:43 -0500 Subject: [PATCH] fixes #1848: line number reported as NaN in interpolation parse errors --- lib/coffee-script/lexer.js | 4 ++-- src/lexer.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/coffee-script/lexer.js b/lib/coffee-script/lexer.js index 490ebe93..a4178c71 100644 --- a/lib/coffee-script/lexer.js +++ b/lib/coffee-script/lexer.js @@ -507,8 +507,8 @@ } if (len = nested.length) { if (len > 1) { - nested.unshift(['(', '(']); - nested.push([')', ')']); + nested.unshift(['(', '(', this.line]); + nested.push([')', ')', this.line]); } tokens.push(['TOKENS', nested]); } diff --git a/src/lexer.coffee b/src/lexer.coffee index e5cdaec9..7eaebe03 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -458,8 +458,8 @@ exports.Lexer = class Lexer nested.shift() if nested[0]?[0] is 'TERMINATOR' if len = nested.length if len > 1 - nested.unshift ['(', '('] - nested.push [')', ')'] + nested.unshift ['(', '(', @line] + nested.push [')', ')', @line] tokens.push ['TOKENS', nested] i += expr.length pi = i + 1