summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2022-06-16 18:02:19 -0500
committerptmcg <ptmcg@austin.rr.com>2022-06-16 18:02:19 -0500
commitc6aa396d58d6d73ad76333bef4b41f5a2ff6f58c (patch)
treeb291c24ea9a241360ff9f3e26780aeca15a9743b
parentaf4ba2cc45afe2fb89ea1ad81317ad8da5c6b89f (diff)
downloadpyparsing-git-c6aa396d58d6d73ad76333bef4b41f5a2ff6f58c.tar.gz
Add CHANGES blurb for Optional/Literal/Empty changes (Issue #412) (PR #413)
-rw-r--r--CHANGES16
1 files changed, 16 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 8a61b83..e7e520f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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!