mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Adding IDENTIFIER and STRING to NOT_SPACED_REGEX
This commit is contained in:
parent
841463da8e
commit
9a71bb17fd
3 changed files with 4 additions and 2 deletions
|
@ -642,7 +642,7 @@
|
||||||
RELATION = ['IN', 'OF', 'INSTANCEOF'];
|
RELATION = ['IN', 'OF', 'INSTANCEOF'];
|
||||||
BOOL = ['TRUE', 'FALSE', 'NULL', 'UNDEFINED'];
|
BOOL = ['TRUE', 'FALSE', 'NULL', 'UNDEFINED'];
|
||||||
NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']'];
|
NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']'];
|
||||||
NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS');
|
NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
|
||||||
CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
|
CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
|
||||||
INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL');
|
INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL');
|
||||||
LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
|
LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
|
||||||
|
|
|
@ -647,7 +647,7 @@ NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']']
|
||||||
|
|
||||||
# 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'
|
NOT_SPACED_REGEX = NOT_REGEX.concat ')', '}', 'THIS', 'IDENTIFIER', 'STRING'
|
||||||
|
|
||||||
# Tokens which could legitimately be invoked or indexed. A opening
|
# Tokens which could legitimately be invoked or indexed. A 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
|
||||||
|
|
|
@ -45,5 +45,7 @@ eq /0/['source'], ///#{0}///['source']
|
||||||
i = 5
|
i = 5
|
||||||
eq (1000)/200/i, 1
|
eq (1000)/200/i, 1
|
||||||
|
|
||||||
|
eq i/i/i, 0.2
|
||||||
|
|
||||||
#584: Unescaped slashes in character classes.
|
#584: Unescaped slashes in character classes.
|
||||||
ok /:\/[/]goog/.test 'http://google.com'
|
ok /:\/[/]goog/.test 'http://google.com'
|
||||||
|
|
Loading…
Reference in a new issue