Archived
1

Improved Evaluation

This commit is contained in:
Kim Wittenburg
2014-09-28 23:50:18 +02:00
parent 43b6f78afb
commit d67a1949e9
19 changed files with 841 additions and 89 deletions

View File

@@ -8,6 +8,9 @@
#import "MPParseError.h"
#import "MPRangePath.h"
#import "NSIndexPath+MPAdditions.h"
@implementation MPParseError
- (instancetype)initWithErrorRange:(NSRange)errorRange errorMessageKey:(NSString *)key
@@ -30,6 +33,14 @@
return self;
}
- (MPRangePath *)rangePath
{
NSIndexPath *location = self.pathToExpression;
location = [location indexPathByPreceedingIndex:self.errorRange.location];
MPRangePath *rangePath = [MPRangePath rangePathWithLocation:location length:self.errorRange.length];
return rangePath;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"MPParseError<at=(%ld, %ld) message=\"%@\">", self.errorRange.location, self.errorRange.length, self.localizedErrorMessage];