From 7524aa9f0f48e6edf02e2d7d980cf769e229ec45 Mon Sep 17 00:00:00 2001 From: "Jon J. C" Date: Wed, 18 Oct 2023 13:20:00 +0200 Subject: [PATCH] Adapt classical PEG syntax to arpeggio equivalent. Some tests fail --- src/peg/testpeg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/peg/testpeg.py b/src/peg/testpeg.py index 685e8fc..1725e10 100644 --- a/src/peg/testpeg.py +++ b/src/peg/testpeg.py @@ -48,7 +48,10 @@ def get_parser(debug=False, root='query_specification'): peg_rules = re.sub('#', '// ', peg_rules) # adapt character range syntax - peg_rules = re.sub("'\\[", "r'[", peg_rules) + peg_rules = re.sub("\\[", "r'[", peg_rules) + peg_rules = re.sub("\\!r'\\[", "r'[^", peg_rules) + peg_rules = re.sub("\\]", "]'", peg_rules) + peg_rules = re.sub("EOF <-[^;]*;", "", peg_rules) return ParserPEG(peg_rules, root,