summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2007-02-20 15:52:50 +0000
committerDavid Beazley <dave@dabeaz.com>2007-02-20 15:52:50 +0000
commite012665bc2b9f1593145a043cfbe27ed6d618208 (patch)
tree7f414b93b0bd4d429755a05b082f91cb1f0f680d
parent80cd0ca45628f8e50966489e7f5eb11f19a2f3e7 (diff)
downloadply-e012665bc2b9f1593145a043cfbe27ed6d618208.tar.gz
Fixed minor character literal bug
-rw-r--r--CHANGES4
-rw-r--r--ply/yacc.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 99b52f6..d88f3e5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
Version 2.3
-----------------------------
+02/20/07: beazley
+ Fixed a bug with character literals if the literal '.' appeared as the
+ last symbol of a grammar rule. Reported by Ales Smrcka.
+
02/19/07: beazley
Warning messages are now redirected to stderr instead of being printed
to standard output.
diff --git a/ply/yacc.py b/ply/yacc.py
index d2aab67..2993f0b 100644
--- a/ply/yacc.py
+++ b/ply/yacc.py
@@ -1666,7 +1666,7 @@ def lr_parse_table(method):
for p in I:
try:
- if p.prod[-1] == ".":
+ if p.len == p.lr_index + 1:
if p.name == "S'":
# Start symbol. Accept!
st_action["$end"] = 0
@@ -1767,7 +1767,8 @@ def lr_parse_table(method):
st_actionp[a] = p
except StandardError,e:
- raise YaccError, "Hosed in lr_parse_table", e
+ print sys.exc_info()
+ raise YaccError, "Hosed in lr_parse_table"
# Print the actions associated with each terminal
if yaccdebug: