summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2012-04-26 14:42:55 -0500
committerDavid Beazley <dave@dabeaz.com>2012-04-26 14:42:55 -0500
commitb766b21116b0b4fa14a9b836e1abd805a4bf6064 (patch)
treee24ebf0009dbabccd176320e11685c7a049536da /example
parent708ff46356912aa05d8e30a5b84d837d7a65d3b2 (diff)
downloadply-b766b21116b0b4fa14a9b836e1abd805a4bf6064.tar.gz
Changes to panic mode error recovery
Diffstat (limited to 'example')
-rw-r--r--example/ansic/clex.py2
-rw-r--r--example/ansic/cparse.py2
-rw-r--r--example/calc/calc.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/example/ansic/clex.py b/example/ansic/clex.py
index 37fdd8e..4da3e1a 100644
--- a/example/ansic/clex.py
+++ b/example/ansic/clex.py
@@ -154,7 +154,7 @@ def t_error(t):
print("Illegal character %s" % repr(t.value[0]))
t.lexer.skip(1)
-lexer = lex.lex(optimize=1)
+lexer = lex.lex()
if __name__ == "__main__":
lex.runmain(lexer)
diff --git a/example/ansic/cparse.py b/example/ansic/cparse.py
index c9b9164..4db7680 100644
--- a/example/ansic/cparse.py
+++ b/example/ansic/cparse.py
@@ -854,7 +854,7 @@ def p_error(t):
import profile
# Build the grammar
-yacc.yacc(method='LALR')
+yacc.yacc(method='LALR',write_tables=False,debug=True)
#profile.run("yacc.yacc(method='LALR')")
diff --git a/example/calc/calc.py b/example/calc/calc.py
index b923780..17df4e7 100644
--- a/example/calc/calc.py
+++ b/example/calc/calc.py
@@ -89,7 +89,7 @@ def p_expression_name(p):
print("Undefined name '%s'" % p[1])
p[0] = 0
-def p_error(p):
+def p_error(p,parser):
if p:
print("Syntax error at '%s'" % p.value)
else: