Start Python3 slices. Split off token routine.

This commit is contained in:
rocky
2015-12-21 12:17:57 -05:00
parent 5dc3af3238
commit 1456f820f2
9 changed files with 83 additions and 68 deletions

View File

@@ -1,5 +1,6 @@
import sys
from uncompyle6 import PYTHON3
from uncompyle6.scanners.tok import NoneToken
if PYTHON3:
intern = sys.intern
@@ -13,6 +14,11 @@ class AST(UserList):
self.type = intern(type)
UserList.__init__(self, kids)
def isNone(self):
"""An AST None token. We can't use regular list comparisons
because AST token offsets might be different"""
return len(self.data) == 1 and self.data[0] == NoneToken
def __getslice__(self, low, high): return self.data[low:high]
def __eq__(self, o):