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