Fixed prettyasserts.py getting confused by escaped-newlines

This is just a messy part of the C grammar.

Also fixed >> and << confusing certain assert expressions, which isn't
surprising.
This commit is contained in:
Christopher Haster
2022-12-19 18:55:24 -06:00
parent 0f72d18b14
commit 37dcee8868

View File

@ -31,7 +31,7 @@ CMP = {
}
LEXEMES = {
'ws': [r'(?:\s|\n|#.*?\n|//.*?\n|/\*.*?\*/)+'],
'ws': [r'(?:\s|\n|#.*?(?<!\\)\n|//.*?(?<!\\)\n|/\*.*?\*/)+'],
'assert': ['assert'],
'arrow': ['=>'],
'string': [r'"(?:\\.|[^"])*"', r"'(?:\\.|[^'])\'"],
@ -39,7 +39,7 @@ LEXEMES = {
'cmp': CMP.keys(),
'logic': ['\&\&', '\|\|'],
'sep': [':', ';', '\{', '\}', ','],
'op': ['->'], # specifically ops that conflict with cmp
'op': ['->', '>>', '<<'], # specifically ops that conflict with cmp
}