diff python/pyyacc.py @ 347:742588fb8cd6 devel

Merge into devel branch
author Windel Bouwman
date Fri, 07 Mar 2014 17:10:21 +0100
parents 3bb7dcfe5529
children 9667d78ba79e
line wrap: on
line diff
--- a/python/pyyacc.py	Sat Mar 01 16:27:52 2014 +0100
+++ b/python/pyyacc.py	Fri Mar 07 17:10:21 2014 +0100
@@ -288,6 +288,7 @@
         self.dotpos = dotpos
         assert self.dotpos <= len(self.production.symbols)
         self.look_ahead = look_ahead
+        self._is_shift = self.dotpos < len(self.production.symbols)
 
     def getdata(self):
         """ Gets the members as a tuple """
@@ -304,12 +305,12 @@
     @property
     def IsReduce(self):
         """ Check if this item has the dot at the end """
-        return self.dotpos == len(self.production.symbols)
+        return not self._is_shift
 
     @property
     def IsShift(self):
         """ Check if this item is a shift item, i.e. the dot can proceed """
-        return self.dotpos < len(self.production.symbols)
+        return self._is_shift
 
     @property
     def Next(self):