summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu Phatak <bionikspoon@gmail.com>2016-01-21 23:49:02 -0600
committerManu Phatak <bionikspoon@gmail.com>2016-01-21 23:49:02 -0600
commit59d1e4c402d428b6a25cd1ac3eb8fd3d71b79030 (patch)
treeb761837e702d0959d25b45233560a3fcc6ae81fe
parentd776a2ece6c12bf8f8b6a0e65b48546ac6078765 (diff)
downloadply-59d1e4c402d428b6a25cd1ac3eb8fd3d71b79030.tar.gz
use literal set notation for 2.6 compatibility
this is for the ply optimize flag. it creates the set as `set(('A', 'B', 'C'))` instead of `'{'A', 'B', 'C'}` used in newer python versions.
-rw-r--r--ply/lex.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ply/lex.py b/ply/lex.py
index 3a40f62..8a3eed9 100644
--- a/ply/lex.py
+++ b/ply/lex.py
@@ -179,7 +179,7 @@ class Lexer:
with open(filename, 'w') as tf:
tf.write('# %s.py. This file automatically created by PLY (version %s). Don\'t edit!\n' % (basetabmodule, __version__))
tf.write('_tabversion = %s\n' % repr(__tabversion__))
- tf.write('_lextokens = %s\n' % repr(self.lextokens))
+ tf.write('_lextokens = set(%s)\n' % repr(tuple(self.lextokens)))
tf.write('_lexreflags = %s\n' % repr(self.lexreflags))
tf.write('_lexliterals = %s\n' % repr(self.lexliterals))
tf.write('_lexstateinfo = %s\n' % repr(self.lexstateinfo))