From 7fb345b222004d5e279ff372870f6378379a9188 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Thu, 5 Mar 2015 06:18:53 +0100 Subject: [PATCH] 'case' needed to be in the list of 4-char words to avoid. Also tweak a comment. --- lslopt/lslrenamer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lslopt/lslrenamer.py b/lslopt/lslrenamer.py index f29a541..84a0eee 100644 --- a/lslopt/lslrenamer.py +++ b/lslopt/lslrenamer.py @@ -6,7 +6,7 @@ class renamer(object): CharSet2 = '0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' # TODO: Derive these from builtins.txt somehow. KwByLen = ((), (), ('do', 'if', 'PI'), ('for', 'key', 'EOF'), - ('jump', 'else', 'list', 'TRUE', 'LOOP')) + ('jump', 'else', 'list', 'TRUE', 'LOOP', 'case')) def GetNextShortest(self): """Generate the next shortest possible identifier""" while True: @@ -33,9 +33,8 @@ class renamer(object): self.WordRestOfChars = [] # Names that can be reused without penalty. The initial set is there - # since the beginning. Others (e.g. Key) are created when certain - # stuff is present (e.g. Key when there are keys), but we don't take - # too many risks. + # since the beginning. Others are created depending on the code + # (e.g. Key when there are keys), but we don't take too many risks. ReusableNames = set(['LslLibrary', 'LslUserScript', 'System']) # Names from ReusableNames that have already been used