From 203fa36d7ae6b79344e4bf13531b77c09f313793 Mon Sep 17 00:00:00 2001 From: ptmcg Date: Sun, 26 Apr 2020 10:33:12 -0500 Subject: change some lambdas to explicit methods for clarity (see discussion in #207); deleted duplicated examples (commit *all* changes this time) --- examples/simpleArith.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples/simpleArith.py') 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 -- cgit v1.2.1