DRY op_size

Move from scanner{2,3}.py to scanner.py
This commit is contained in:
rocky
2016-10-21 07:40:35 -04:00
parent 0826129112
commit d6f7ef4e17
3 changed files with 10 additions and 21 deletions

View File

@@ -22,7 +22,6 @@ Finally we save token information.
from __future__ import print_function
import inspect
from collections import namedtuple
from array import array
@@ -296,16 +295,6 @@ class Scanner2(scan.Scanner):
print()
return tokens, customize
def op_size(self, op):
"""
Return size of operator with its arguments
for given opcode <op>.
"""
if op < self.opc.HAVE_ARGUMENT and op not in self.opc.hasArgumentExtended:
return 1
else:
return 3
def setup_code(self, co):
"""
Creates Python-independent bytecode structure (byte array) in