summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2015-04-22 09:51:07 -0500
committerDavid Beazley <dave@dabeaz.com>2015-04-22 09:51:07 -0500
commit368808a580c389a666b7b8413150660c4626d415 (patch)
treecbe2289eb0ff68e45905a0b41a0e19cc58fa7caa
parent33a6424e77539c1b687ad6626c3a6a006dcc7d81 (diff)
downloadply-368808a580c389a666b7b8413150660c4626d415.tar.gz
Simplified set_defaulted_states() method
-rw-r--r--CHANGES8
-rw-r--r--ply/yacc.py2
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 93c8aa8..c63d99d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -59,11 +59,17 @@ Version 3.5
imported by mistake. For example, if it's found somewhere else on the path
by accident.
+ *** POTENTIAL INCOMPATIBILITY *** It's possible that this might break some
+ packaging/deployment setup if PLY was instructed to place its parsetab.py
+ in a different location. You'll have to specify a proper outputdir= argument
+ to yacc() to fix this if needed.
+
04/19/15: beazley
Changed default output directory to be the same as that in which the
yacc grammar is defined. If your grammar is in a file 'calc.py',
then the parsetab.py and parser.out files should be generated in the
- same directory as that file.
+ same directory as that file. The destination directory can be changed
+ using the outputdir= argument to yacc().
04/19/15: beazley
Changed the parsetab.py file signature slightly so that the parsetab won't
diff --git a/ply/yacc.py b/ply/yacc.py
index d2138df..8fa5c64 100644
--- a/ply/yacc.py
+++ b/ply/yacc.py
@@ -314,7 +314,7 @@ class LRParser:
self.defaulted_states = {}
for state, actions in self.action.items():
rules = list(actions.values())
- if rules and rules[0] < 0 and all(rules[0] == rule for rule in rules):
+ if len(rules) == 1 and rules[0] < 0:
self.defaulted_states[state] = rules[0]
def disable_defaulted_states(self):