diff options
author | David Beazley <dave@dabeaz.com> | 2008-05-29 14:00:14 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2008-05-29 14:00:14 +0000 |
commit | 3d91085e98cd5d2ddd3822793ab33bbad8287f5c (patch) | |
tree | 81d1988b5dec2f2b51c465527a3fe103847808b0 /test/yacc_simple.py | |
parent | 912137883ba0ec6e0f0390c9664a7918ee529c14 (diff) | |
download | ply-3d91085e98cd5d2ddd3822793ab33bbad8287f5c.tar.gz |
Revamped testing framework
Diffstat (limited to 'test/yacc_simple.py')
-rw-r--r-- | test/yacc_simple.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/yacc_simple.py b/test/yacc_simple.py index b5dc9f3..7ff336c 100644 --- a/test/yacc_simple.py +++ b/test/yacc_simple.py @@ -4,9 +4,8 @@ # A simple, properly specifier grammar # ----------------------------------------------------------------------------- import sys -sys.tracebacklimit = 0 -sys.path.insert(0,"..") +if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens @@ -37,7 +36,7 @@ def p_expression_binop(t): if t[2] == '+' : t[0] = t[1] + t[3] elif t[2] == '-': t[0] = t[1] - t[3] elif t[2] == '*': t[0] = t[1] * t[3] - elif t[3] == '/': t[0] = t[1] / t[3] + elif t[2] == '/': t[0] = t[1] / t[3] def p_expression_uminus(t): 'expression : MINUS expression %prec UMINUS' |