tokenizer: Fix operator tokenization

This commit is contained in:
James Westman 2022-04-30 15:28:56 -05:00
parent 0da0c9399f
commit d09ee2a62b
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
2 changed files with 7 additions and 2 deletions

View file

@ -46,7 +46,7 @@ _tokens = [
(TokenType.WHITESPACE, r"\s+"),
(TokenType.COMMENT, r"\/\*[\s\S]*?\*\/"),
(TokenType.COMMENT, r"\/\/[^\n]*"),
(TokenType.OP, r"[:=\.=\|<>\+\-/\*]+"),
(TokenType.OP, r"<<|>>|=>|::|<|>|:=|\.|\|\||\||\+|\-|\*|=|:|/"),
(TokenType.PUNCTUATION, r"\(|\)|\{|\}|;|\[|\]|\,"),
]
_TOKENS = [(type, re.compile(regex)) for (type, regex) in _tokens]