diff options
author | ptmcg <ptmcg@austin.rr.com> | 2022-06-16 18:02:19 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2022-06-16 18:02:19 -0500 |
commit | c6aa396d58d6d73ad76333bef4b41f5a2ff6f58c (patch) | |
tree | b291c24ea9a241360ff9f3e26780aeca15a9743b | |
parent | af4ba2cc45afe2fb89ea1ad81317ad8da5c6b89f (diff) | |
download | pyparsing-git-c6aa396d58d6d73ad76333bef4b41f5a2ff6f58c.tar.gz |
Add CHANGES blurb for Optional/Literal/Empty changes (Issue #412) (PR #413)
-rw-r--r-- | CHANGES | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -4,6 +4,22 @@ Change Log Version 3.0.10 - (in development) --------------------------------- +- API ENHANCEMENT: `Optional(expr)` may now be written as `expr | ""` + + This will make this code: + + "{" + Optional(Literal("A") | Literal("a")) + "}" + + writable as: + + "{" + (Literal("A") | Literal("a") | "") + "}" + + Some related changes implemented as part of this work: + - Literal("") now internally generates an Empty() (and no longer raises an exception) + - Empty is now a subclass of Literal + + Suggested by Antony Lee (issue #412), PR (#413) by Devin J. Pohly. + - Fixed bug in `Word` when `max=2`. Also added performance enhancement when specifying `exact` argument. Reported in issue #409 by panda-34, nice catch! |