Adding IDENTIFIER and STRING to NOT_SPACED_REGEX

This commit is contained in:
Jeremy Ashkenas 2010-11-09 22:46:37 -05:00
parent 841463da8e
commit 9a71bb17fd
3 changed files with 4 additions and 2 deletions

View File

@ -642,7 +642,7 @@
RELATION = ['IN', 'OF', 'INSTANCEOF'];
BOOL = ['TRUE', 'FALSE', 'NULL', 'UNDEFINED'];
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'];
INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL');
LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];

View File

@ -647,7 +647,7 @@ NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']']
# If the previous token is not spaced, there are more preceding tokens that
# 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
# parentheses or bracket following these tokens will be recorded as the start

View File

@ -45,5 +45,7 @@ eq /0/['source'], ///#{0}///['source']
i = 5
eq (1000)/200/i, 1
eq i/i/i, 0.2
#584: Unescaped slashes in character classes.
ok /:\/[/]goog/.test 'http://google.com'