diff options
author | David Beazley <dave@dabeaz.com> | 2007-02-20 15:52:50 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2007-02-20 15:52:50 +0000 |
commit | e012665bc2b9f1593145a043cfbe27ed6d618208 (patch) | |
tree | 7f414b93b0bd4d429755a05b082f91cb1f0f680d | |
parent | 80cd0ca45628f8e50966489e7f5eb11f19a2f3e7 (diff) | |
download | ply-e012665bc2b9f1593145a043cfbe27ed6d618208.tar.gz |
Fixed minor character literal bug
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | ply/yacc.py | 5 |
2 files changed, 7 insertions, 2 deletions
@@ -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: |