diff options
author | ptmcg <ptmcg@austin.rr.com> | 2020-04-07 15:25:08 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2020-04-07 15:25:08 -0500 |
commit | 72f2c5a67b4a26f584104b9ff63e1f272f54c5df (patch) | |
tree | 029f9fbacee8f4b378d3a9759979c5d2c60826d9 /examples/invRegex.py | |
parent | 1881e43c10c34c0d24a6e3ecea7b4da710f9c790 (diff) | |
download | pyparsing-git-72f2c5a67b4a26f584104b9ff63e1f272f54c5df.tar.gz |
enable packrat parsing in all examples using infixNotation
Diffstat (limited to 'examples/invRegex.py')
-rw-r--r-- | examples/invRegex.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/invRegex.py b/examples/invRegex.py index f0bfe31..b9d6cfb 100644 --- a/examples/invRegex.py +++ b/examples/invRegex.py @@ -30,6 +30,8 @@ from pyparsing import ( srange,
)
+ParserElement.enablePackrat()
+
class CharacterRangeEmitter:
def __init__(self, chars):
@@ -279,9 +281,7 @@ def main(): [ABCDEFG](?:#|##|b|bb)?(?:maj|min|m|sus|aug|dim)?[0-9]?(?:/[ABCDEFG](?:#|##|b|bb)?)?
(Fri|Mon|S(atur|un)|T(hur|ue)s|Wednes)day
A(pril|ugust)|((Dec|Nov|Sept)em|Octo)ber|(Febr|Jan)uary|Ju(ly|ne)|Ma(rch|y)
- """.split(
- "\n"
- )
+ """.splitlines()
for t in tests:
t = t.strip()
|