Implemented Evaluation
This commit is contained in:
@@ -221,6 +221,15 @@
|
||||
return elementIndex;
|
||||
}
|
||||
|
||||
- (NSUInteger)locationOfElementAtIndex:(NSUInteger)index
|
||||
{
|
||||
NSUInteger location = 0;
|
||||
for (NSUInteger i = 0; i < index; i++) {
|
||||
location += [self elementAtIndex:i].length;
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
- (void)replaceSymbolsInRange:(NSRange)range
|
||||
withElements:(NSArray *)elements
|
||||
{
|
||||
@@ -268,7 +277,7 @@
|
||||
return _elements;
|
||||
}
|
||||
|
||||
- (double)evaluateExpression:(NSError *__autoreleasing *)error
|
||||
- (NSDecimalNumber *)evaluateWithError:(MPParseError *__autoreleasing *)error
|
||||
{
|
||||
return [self.evaluator evaluateWithError:error];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user