assembler.py
def linkIdentityPass(self):
        """
        Link Identity pass, finds labels and constants,
        assigns them to temporary links which are easier to identify
        """
        for lineNumber in self.assembly.keys():
            line = re.findall('[a-z]{1}[\w_:]*',self.assembly[lineNumber])
            
            # Label assignment
            if line[0][-1] == ":":
                if re.search('[^\w_]',line[0][:-1]):
                    print(ERROR_FATAL[0].format(lineNumber))
                else:
                    linkName = '<link_'+line[0][:-1]+'/>'
                    self.links.append(linkName)
                    self.assembly[lineNumber] = linkName+':'
            
            # All other cases
            for word in line[1:]:
                forbidden = (word in self.conditions.keys()
                    or word in self.registers.keys()
                    or word in self.forbid)
                if forbidden:
                    continue
                linkName = '<link_'+word+'/>'
                self.links.append(linkName)
                self.assembly[lineNumber] = re.sub(
                    '(?<![\w_])%s(?![\w_])' % word, linkName,
                    self.assembly[lineNumber])

        Link Identity pass, finds labels and constants,
        assigns them to temporary links which are easier to identify
        
Link Identity pass, finds labels and constants,
assigns them to temporary links which are easier to identify
Link Identity pass finds labels and constants assigns them to temporary links which are easier to identify
def linkIdentityPass(self):
        for lineNumber in self.assembly.keys():
            line = re.findall('[a-z]{1}[\w_:]*',self.assembly[lineNumber])
            if line[0][-1] == ":":
                if re.search('[^\w_]',line[0][:-1]):
                    print(ERROR_FATAL[0].format(lineNumber))
                else:
                    linkName = '<link_'+line[0][:-1]+'/>'
                    self.links.append(linkName)
                    self.assembly[lineNumber] = linkName+':'
            for word in line[1:]:
                forbidden = (word in self.conditions.keys()
                    or word in self.registers.keys()
                    or word in self.forbid)
                if forbidden:
                    continue
                linkName = '<link_'+word+'/>'
                self.links.append(linkName)
                self.assembly[lineNumber] = re.sub(
                    '(?<![\w_])%s(?![\w_])' % word, linkName,
                    self.assembly[lineNumber])
def linkIdentityPass ( self ) : for lineNumber in self . assembly . keys ( ) : line = re . findall ( '[a-z]{1}[\w_:]*' , self . assembly [ lineNumber ] ) if line [ 0 ] [ - 1 ] == ":" : if re . search ( '[^\w_]' , line [ 0 ] [ : - 1 ] ) : print ( ERROR_FATAL [ 0 ] . format ( lineNumber ) ) else : linkName = '<link_' + line [ 0 ] [ : - 1 ] + '/>' self . links . append ( linkName ) self . assembly [ lineNumber ] = linkName + ':' for word in line [ 1 : ] : forbidden = ( word in self . conditions . keys ( ) or word in self . registers . keys ( ) or word in self . forbid ) if forbidden : continue linkName = '<link_' + word + '/>' self . links . append ( linkName ) self . assembly [ lineNumber ] = re . sub ( '(?<![\w_])%s(?![\w_])' % word , linkName , self . assembly [ lineNumber ] )
Link Identity pass, finds labels and constants,
assigns them to temporary links which are easier to identify
Link Identity pass finds labels and constants assigns them to temporary links which are easier to identify
"""
        Link Identity pass, finds labels and constants,
        assigns them to temporary links which are easier to identify
        """ # Label assignment # All other cases
self