Ejemplo n.º 1
0
 def _fix_violations(self, oFile):
     for iLineNumber in self.violations:
         oPreviousLine = oFile.lines[iLineNumber - 1]
         oLine = oFile.lines[iLineNumber]
         iIndex = utils.end_of_line_index(oPreviousLine)
         oPreviousLine.update_line(oPreviousLine.line[:iIndex] + ' else' + oPreviousLine.line[iIndex:])
         utils.clear_keyword_from_line(oLine, 'else')
Ejemplo n.º 2
0
def search_for_and_remove_extraneous_is(oFile, iLineNumber):
    '''
    Looks for an is keyword that is not on the same line as the closing parenthesis and removes it.
    '''
    iIndex = iLineNumber
    while True:
        iIndex += 1
        oLine = oFile.lines[iIndex]
        if oLine.isProcessIs:
            utils.clear_keyword_from_line(oLine, 'is')
            oLine.isProcessIs = False
        if oLine.isProcessBegin:
            break