def buildRecursiveErrorSpace(self): newerrors = errors.geterrorset(self.tokenstring, errors.alloperatorerrors) newerrors = self.addUniqueErrors(newerrors) #Gettem out of the way, + reduce search space while newerrors != []: for elem in newerrors[:]: nexterrors = errors.geterrorset(elem[0], errors.alloperatorerrors) nexterrors = self.addUniqueErrors([(x[0], elem[1]+", "+x[1]) for x in nexterrors]) newerrors += nexterrors newerrors.remove(elem)
def buildRecursiveErrorSpace(self): newerrors = errors.geterrorset(self.tokenstring, errors.alloperatorerrors) newerrors = self.addUniqueErrors( newerrors) #Gettem out of the way, + reduce search space while newerrors != []: for elem in newerrors[:]: nexterrors = errors.geterrorset(elem[0], errors.alloperatorerrors) nexterrors = self.addUniqueErrors([ (x[0], elem[1] + ", " + x[1]) for x in nexterrors ]) newerrors += nexterrors newerrors.remove(elem)
def testErrorSet(self): variants = errors.geterrorset(["NEG", "1", "PLUS", "2"], errors.alloperatorerrors) self.assertIn(["1", "PLUS", '2'], [x[0] for x in variants]) self.assertIn(["NEG", "1", "TIMES", '2'], [x[0] for x in variants])
def buildErrorSpace(self): allerrors = errors.geterrorset(self.tokenstring, errors.alloperatorerrors) self.addUniqueErrors(allerrors)