summaryrefslogtreecommitdiff
path: root/examples/rosettacode.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2021-08-01 12:57:10 -0500
committerptmcg <ptmcg@austin.rr.com>2021-08-01 12:57:10 -0500
commitf22dcdc9be6aebf7defc1ef43e39c53921ba7566 (patch)
treed40b225f53c90a0b4676c59323251c9c2c825df6 /examples/rosettacode.py
parent1688592bd97e573174e9eab482846e0f1194652a (diff)
downloadpyparsing-git-f22dcdc9be6aebf7defc1ef43e39c53921ba7566.tar.gz
Update __versionTime__; blacken core code and examples
Diffstat (limited to 'examples/rosettacode.py')
-rw-r--r--examples/rosettacode.py42
1 files changed, 35 insertions, 7 deletions
diff --git a/examples/rosettacode.py b/examples/rosettacode.py
index 5cbf203..fd3a0e0 100644
--- a/examples/rosettacode.py
+++ b/examples/rosettacode.py
@@ -53,13 +53,41 @@ char = pp.Regex(r"'\\?.'")
expr = pp.infixNotation(
identifier | integer | char,
[
- (pp.oneOf("+ - !"), 1, pp.opAssoc.RIGHT,),
- (pp.oneOf("* / %"), 2, pp.opAssoc.LEFT,),
- (pp.oneOf("+ -"), 2, pp.opAssoc.LEFT,),
- (pp.oneOf("< <= > >="), 2, pp.opAssoc.LEFT,),
- (pp.oneOf("== !="), 2, pp.opAssoc.LEFT,),
- (pp.oneOf("&&"), 2, pp.opAssoc.LEFT,),
- (pp.oneOf("||"), 2, pp.opAssoc.LEFT,),
+ (
+ pp.oneOf("+ - !"),
+ 1,
+ pp.opAssoc.RIGHT,
+ ),
+ (
+ pp.oneOf("* / %"),
+ 2,
+ pp.opAssoc.LEFT,
+ ),
+ (
+ pp.oneOf("+ -"),
+ 2,
+ pp.opAssoc.LEFT,
+ ),
+ (
+ pp.oneOf("< <= > >="),
+ 2,
+ pp.opAssoc.LEFT,
+ ),
+ (
+ pp.oneOf("== !="),
+ 2,
+ pp.opAssoc.LEFT,
+ ),
+ (
+ pp.oneOf("&&"),
+ 2,
+ pp.opAssoc.LEFT,
+ ),
+ (
+ pp.oneOf("||"),
+ 2,
+ pp.opAssoc.LEFT,
+ ),
],
)