1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Better error message for unexpected CALL_END

This commit is contained in:
Simon Lydell 2015-01-12 20:40:59 +01:00
parent bec8f27e8a
commit 62712060c0
3 changed files with 7 additions and 2 deletions

View file

@ -194,7 +194,7 @@
};
endImplicitCall = function() {
stack.pop();
tokens.splice(i, 0, generate('CALL_END', ')'));
tokens.splice(i, 0, generate('CALL_END', ')', ['', 'end of input', token[2]]));
return i += 1;
};
startImplicitObject = function(j, startsLine) {

View file

@ -157,7 +157,7 @@ class exports.Rewriter
endImplicitCall = ->
stack.pop()
tokens.splice i, 0, generate 'CALL_END', ')'
tokens.splice i, 0, generate 'CALL_END', ')', ['', 'end of input', token[2]]
i += 1
startImplicitObject = (j, startsLine = yes) ->

View file

@ -111,6 +111,11 @@ test "#1096: unexpected generated tokens", ->
a:
^
'''
assertErrorFormat 'a +', '''
[stdin]:1:4: error: unexpected end of input
a +
^
'''
# Unexpected implicit object
assertErrorFormat '''
for i in [1]: