Improved Evaluation
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user