Support forwardslash characters in identifiers (#9249)

Closes #8377.
This commit is contained in:
Alexander King
2021-11-01 02:54:18 -04:00
committed by GitHub
parent 11bb9205d7
commit 31c207a0b5
4 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ expression: expr? EOF
expr: and_expr ('or' and_expr)*
and_expr: not_expr ('and' not_expr)*
not_expr: 'not' not_expr | '(' expr ')' | ident
ident: (\w|:|\+|-|\.|\[|\]|\\)+
ident: (\w|:|\+|-|\.|\[|\]|\\|/)+
The semantics are:
@@ -88,7 +88,7 @@ class Scanner:
yield Token(TokenType.RPAREN, ")", pos)
pos += 1
else:
match = re.match(r"(:?\w|:|\+|-|\.|\[|\]|\\)+", input[pos:])
match = re.match(r"(:?\w|:|\+|-|\.|\[|\]|\\|/)+", input[pos:])
if match:
value = match.group(0)
if value == "or":