Archived
1

Cleaned Code by Removing Location Tracking for Errors

This commit is contained in:
Kim Wittenburg
2014-11-07 19:50:28 +01:00
parent 91e7dbe9f2
commit 139a75f816
59 changed files with 355 additions and 532 deletions

View File

@@ -33,16 +33,13 @@
return self;
}
- (NSRange)range
{
return NSUnionRange(self.operatorChain.range, self.product.range);
}
- (BOOL)validate:(MPParseError *__autoreleasing *)error
- (BOOL)validate:(NSError *__autoreleasing *)error
{
if (self.operatorChain.numberOfOperators > [MPMathRules sharedRules].maximumOperatorChainLength) {
if (error) {
*error = MPParseError(self.operatorChain.range, @"Too many operators.");
*error = MPParseError(4,
NSLocalizedString(@"Too many operators.", @"Error message. This is displayed when there are too many subsequent operators in an expression."),
nil);
}
return NO;
}
@@ -58,14 +55,4 @@
return value;
}
-(NSArray *)expressionElements
{
NSMutableArray *elements = [[NSMutableArray alloc] init];
if (self.operatorChain) {
[elements addObjectsFromArray:self.operatorChain.expressionElements];
}
[elements addObjectsFromArray:self.product.expressionElements];
return @[self.operatorChain.expressionElements,];
}
@end