1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
This commit is contained in:
Nami-Doc 2013-04-21 12:27:30 +02:00
parent 3b38153759
commit 1917bb69ed
3 changed files with 8 additions and 5 deletions

View file

@ -876,9 +876,9 @@
BOOL = ['TRUE', 'FALSE']; BOOL = ['TRUE', 'FALSE'];
NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']']; NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--'];
NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']');
CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];

View file

@ -846,11 +846,11 @@ BOOL = ['TRUE', 'FALSE']
# See: http://www.mozilla.org/js/language/js20-2002-04/rationale/syntax.html#regular-expressions # See: http://www.mozilla.org/js/language/js20-2002-04/rationale/syntax.html#regular-expressions
# #
# Our list is shorter, due to sans-parentheses method calls. # Our list is shorter, due to sans-parentheses method calls.
NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']'] NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--']
# If the previous token is not spaced, there are more preceding tokens that # If the previous token is not spaced, there are more preceding tokens that
# force a division parse: # force a division parse:
NOT_SPACED_REGEX = NOT_REGEX.concat ')', '}', 'THIS', 'IDENTIFIER', 'STRING' NOT_SPACED_REGEX = NOT_REGEX.concat ')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']'
# Tokens which could legitimately be invoked or indexed. An opening # Tokens which could legitimately be invoked or indexed. An opening
# parentheses or bracket following these tokens will be recorded as the start # parentheses or bracket following these tokens will be recorded as the start

View file

@ -78,4 +78,7 @@ test "#1066: interpolated strings are not implicit functions", ->
cantCompile '"int#{er}polated" arg' cantCompile '"int#{er}polated" arg'
test "#2846: while with empty body", -> test "#2846: while with empty body", ->
CoffeeScript.compile 'while 1 then', {sourceMap: true} CoffeeScript.compile 'while 1 then', {sourceMap: true}
test "#2944: implicit call with a regex argument", ->
CoffeeScript.compile 'o[key] /regex/'