From 37dcee8868f3aff4ffe2e68cc71be1dd8117a2ea Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Mon, 19 Dec 2022 18:55:24 -0600 Subject: [PATCH] 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. --- scripts/prettyasserts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prettyasserts.py b/scripts/prettyasserts.py index 3a62d360..655211c3 100755 --- a/scripts/prettyasserts.py +++ b/scripts/prettyasserts.py @@ -31,7 +31,7 @@ CMP = { } LEXEMES = { - 'ws': [r'(?:\s|\n|#.*?\n|//.*?\n|/\*.*?\*/)+'], + 'ws': [r'(?:\s|\n|#.*?(?'], '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 }