Fixes #1066 -- interpolated strings are not implicit funcs

This commit is contained in:
Jeremy Ashkenas
2013-03-05 21:28:29 +13:00
parent 355754ed20
commit de8ec2beb0
5 changed files with 14 additions and 6 deletions

View File

@@ -589,7 +589,10 @@ exports.Lexer = class Lexer
@tokens.push token
else
@error "Unexpected #{tag}"
@token ')', ')', offsetInChunk + lexedLength, 0 if interpolated
if interpolated
rparen = @makeToken ')', ')', offsetInChunk + lexedLength, 0
rparen.stringEnd = true
@tokens.push rparen
tokens
# Pairs up a closing token, ensuring that all listed pairs of tokens are

View File

@@ -213,7 +213,7 @@ class exports.Rewriter
# Recognize standard implicit calls like
# f a, f() b, f? c, h[0] d etc.
if (tag in IMPLICIT_FUNC and token.spaced or
if (tag in IMPLICIT_FUNC and token.spaced and not token.stringEnd or
tag is '?' and i > 0 and not tokens[i - 1].spaced) and
(nextTag in IMPLICIT_CALL or
nextTag in IMPLICIT_UNSPACED_CALL and