Cleaned Code by Removing Location Tracking for Errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user