diff options
Diffstat (limited to 'examples/simpleArith.py')
-rw-r--r-- | examples/simpleArith.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/simpleArith.py b/examples/simpleArith.py index af3f904..4539018 100644 --- a/examples/simpleArith.py +++ b/examples/simpleArith.py @@ -6,9 +6,12 @@ #
# Copyright 2006, by Paul McGuire
#
-
+import sys
from pyparsing import *
+ParserElement.enablePackrat()
+sys.setrecursionlimit(3000)
+
integer = Word(nums).setParseAction(lambda t: int(t[0]))
variable = Word(alphas, exact=1)
operand = integer | variable
@@ -64,6 +67,11 @@ test = [ "M*X + B",
"M*(X + B)",
"1+2*-3^4*5+-+-6",
+ "(a + b)",
+ "((a + b))",
+ "(((a + b)))",
+ "((((a + b))))",
+ "((((((((((((((a + b))))))))))))))",
]
for t in test:
print(t)
|