Permalink
Browse files

Minor bug fixes

  • Loading branch information...
1 parent a7017ab commit 33baf1980710a84332f21f51ab715a91a475d05f @dabeaz committed Apr 18, 2012
Showing with 8 additions and 7 deletions.
  1. +1 −1 ply/ctokens.py
  2. +6 −5 ply/lex.py
  3. +1 −1 ply/yacc.py
View
2 ply/ctokens.py
@@ -74,7 +74,7 @@
t_RSHIFTEQUAL = r'>>='
t_ANDEQUAL = r'&='
t_OREQUAL = r'\|='
-t_XOREQUAL = r'^='
+t_XOREQUAL = r'\^='
# Increment/decrement
t_INCREMENT = r'\+\+'
View
11 ply/lex.py
@@ -31,8 +31,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
-__version__ = "3.4"
-__tabversion__ = "3.2" # Version of table file used
+__version__ = "3.5"
+__tabversion__ = "3.5" # Version of table file used
import re, sys, types, copy, os
@@ -175,7 +175,7 @@ def writetab(self,tabfile,outputdir=""):
filename = os.path.join(outputdir,basetabfilename)+".py"
tf = open(filename,"w")
tf.write("# %s.py. This file automatically created by PLY (version %s). Don't edit!\n" % (tabfile,__version__))
- tf.write("_tabversion = %s\n" % repr(__version__))
+ tf.write("_tabversion = %s\n" % repr(__tabversion__))
tf.write("_lextokens = %s\n" % repr(self.lextokens))
tf.write("_lexreflags = %s\n" % repr(self.lexreflags))
tf.write("_lexliterals = %s\n" % repr(self.lexliterals))
@@ -222,7 +222,7 @@ def readtab(self,tabfile,fdict):
exec("import %s as lextab" % tabfile, env,env)
lextab = env['lextab']
- if getattr(lextab,"_tabversion","0.0") != __version__:
+ if getattr(lextab,"_tabversion","0.0") != __tabversion__:
raise ImportError("Inconsistent PLY version")
self.lextokens = lextab._lextokens
@@ -604,6 +604,8 @@ def validate_tokens(self):
# Get the literals specifier
def get_literals(self):
self.literals = self.ldict.get("literals","")
+ if not self.literals:
+ self.literals = ""
# Validate literals
def validate_literals(self):
@@ -612,7 +614,6 @@ def validate_literals(self):
if not isinstance(c,StringTypes) or len(c) > 1:
self.log.error("Invalid literal %s. Must be a single character", repr(c))
self.error = 1
- continue
except TypeError:
self.log.error("Invalid literals specification. literals must be a sequence of characters")
View
2 ply/yacc.py
@@ -59,7 +59,7 @@
# own risk!
# ----------------------------------------------------------------------------
-__version__ = "3.4"
+__version__ = "3.5"
__tabversion__ = "3.2" # Table version
#-----------------------------------------------------------------------------

0 comments on commit 33baf19

Please sign in to comment.