diff options
author | ptmcg <ptmcg@austin.rr.com> | 2020-04-26 10:33:12 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2020-04-26 10:33:12 -0500 |
commit | 203fa36d7ae6b79344e4bf13531b77c09f313793 (patch) | |
tree | 443459f498f38b97618344c6f707eeaa117cf670 /examples/simpleArith.py | |
parent | 813ba3bed433a96e02d82cad2e2940a6850d96a5 (diff) | |
download | pyparsing-git-203fa36d7ae6b79344e4bf13531b77c09f313793.tar.gz |
change some lambdas to explicit methods for clarity (see discussion in #207); deleted duplicated examples (commit *all* changes this time)
Diffstat (limited to 'examples/simpleArith.py')
-rw-r--r-- | examples/simpleArith.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/simpleArith.py b/examples/simpleArith.py index 4539018..476cb8b 100644 --- a/examples/simpleArith.py +++ b/examples/simpleArith.py @@ -9,10 +9,12 @@ import sys
from pyparsing import *
+ppc = pyparsing_common
+
ParserElement.enablePackrat()
sys.setrecursionlimit(3000)
-integer = Word(nums).setParseAction(lambda t: int(t[0]))
+integer = ppc.integer
variable = Word(alphas, exact=1)
operand = integer | variable
|