assembler.py
def cleanAssembly(self,assembly):
        """Initial assembly cleaning and line numbering"""
        cleaned = {}
        lineNumber = 0
        
        for line in assembly:
            # Increment the line
            lineNumber += 1
            # Remove comments and newlines
            uncommented = re.sub('//.*','',line).strip('\n')
            # Remove empty lines
            if not uncommented or uncommented.isspace():
                continue
            # Remove any spaces or tabs before text
            cleaned[lineNumber] = re.sub('^[\s\t]*','',uncommented).lower()
        
        return cleaned
Initial assembly cleaning and line numbering
Initial assembly cleaning and line numbering
Initial assembly cleaning and line numbering
def cleanAssembly(self,assembly):
        cleaned = {}
        lineNumber = 0
        for line in assembly:
            lineNumber += 1
            uncommented = re.sub('//.*','',line).strip('\n')
            if not uncommented or uncommented.isspace():
                continue
            cleaned[lineNumber] = re.sub('^[\s\t]*','',uncommented).lower()
        return cleaned
def cleanAssembly ( self , assembly ) : cleaned = { } lineNumber = 0 for line in assembly : lineNumber += 1 uncommented = re . sub ( '//.*' , '' , line ) . strip ( '\n' ) if not uncommented or uncommented . isspace ( ) : continue cleaned [ lineNumber ] = re . sub ( '^[\s\t]*' , '' , uncommented ) . lower ( ) return cleaned
Initial assembly cleaning and line numbering
Initial assembly cleaning and line numbering
"""Initial assembly cleaning and line numbering""" # Increment the line # Remove comments and newlines # Remove empty lines # Remove any spaces or tabs before text
self
assembly