Archived
1

Cleaned Code by Removing Location Tracking for Errors

This commit is contained in:
Kim Wittenburg
2014-11-07 19:50:28 +01:00
parent 91e7dbe9f2
commit 139a75f816
59 changed files with 355 additions and 532 deletions

View File

@@ -8,9 +8,7 @@
#import "MPUnexpectedSymbolValue.h"
@implementation MPUnexpectedSymbolValue {
NSRange _range;
}
@implementation MPUnexpectedSymbolValue
- (instancetype)init
{
@@ -25,7 +23,6 @@
self = [self init];
if (self) {
[tokenStream beginIgnoringWhitespaceTokens];
_range = tokenStream.currentToken.range;
_symbol = tokenStream.currentToken.stringValue;
[tokenStream currentTokenConsumed];
[tokenStream endIgnoringOrAcceptingWhitespaceTokens];
@@ -33,15 +30,12 @@
return self;
}
- (NSRange)range
{
return _range;
}
- (BOOL)validate:(MPParseError *__autoreleasing *)error
- (BOOL)validate:(NSError *__autoreleasing *)error
{
if (error) {
*error = MPParseError(self.range, @"Unknown Symbol.");
*error = MPParseError(10,
NSLocalizedString(@"Unknown Symbol.", @"Error message. Displayed when an unknown symbol was encountered during parsing."),
nil);
}
return NO;
}