Archived
1

Implemented Expression Evaluation/Parsing with Proper Error Handling

This commit is contained in:
Kim Wittenburg
2014-09-11 22:17:29 +02:00
parent f791213127
commit 245468a559
16 changed files with 670 additions and 330 deletions

View File

@@ -2,20 +2,25 @@
// MPParseError.h
// MathPad
//
// Created by Kim Wittenburg on 06.09.14.
// Created by Kim Wittenburg on 08.09.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <Foundation/Foundation.h>
#define MPParseError(index,key) [[MPParseError alloc] initWithErrorIndex:index errorMessageKey:key]
#define MPParseError(range,key) [[MPParseError alloc] initWithErrorRange:range errorMessageKey:key]
@interface MPParseError : NSObject
- (instancetype)initWithErrorIndex:(NSUInteger)errorIndex
errorMessageKey:(NSString *)errorMessageKey;
- (instancetype)initWithErrorRange:(NSRange)errorRange
errorMessageKey:(NSString *)key;
@property (nonatomic) NSUInteger errorIndex;
@property (nonatomic) NSString *localizedErrorMessage;
- (instancetype)initWithErrorRange:(NSRange)errorRange
localizederrorMessage:(NSString *)errorMessage;
@end
@property (nonatomic, strong) NSIndexPath *pathToExpression;
@property (nonatomic) NSRange errorRange;
@property (nonatomic, copy) NSString *localizedErrorMessage;
@end