mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fix #2944
This commit is contained in:
parent
3b38153759
commit
1917bb69ed
3 changed files with 8 additions and 5 deletions
|
@ -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'];
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -79,3 +79,6 @@ test "#1066: interpolated strings are not implicit functions", ->
|
||||||
|
|
||||||
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/'
|
Loading…
Add table
Reference in a new issue