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:
parent
bec8f27e8a
commit
62712060c0
3 changed files with 7 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) ->
|
||||
|
|
|
@ -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]:
|
||||
|
|
Loading…
Reference in a new issue