Archived
1

Implemented Evaluation

This commit is contained in:
Kim Wittenburg
2014-09-07 16:45:31 +02:00
parent 8df8317413
commit 21bfe221ba
13 changed files with 593 additions and 96 deletions

View File

@@ -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];
}