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,16 +8,34 @@
@import Foundation;
#import "NSString+MPExpressionElement.h"
#import "MPExpressionTree.h"
#import "MPToken.h"
FOUNDATION_EXPORT NSString *const MPMathKitErrorDomain;
FOUNDATION_EXPORT NSString *const MPExpressionPathErrorKey;
NS_INLINE NSError * MPParseError(NSInteger errorCode,
NSString *errorDescription,
NSError *underlyingError) {
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
if (errorDescription) {
userInfo[NSLocalizedDescriptionKey] = errorDescription;
}
if (underlyingError) {
userInfo[NSUnderlyingErrorKey] = underlyingError;
}
NSError *error = [NSError errorWithDomain:MPMathKitErrorDomain
code:errorCode
userInfo:userInfo.copy];
return error;
}
typedef NS_ENUM(NSUInteger, MPReferenceFrame) {
MPElementReferenceFrame,
MPSymbolReferenceFrame,
MPTokenReferenceFrame
};
@class MPExpression, MPFunction, MPRangePath, MPExpressionEvaluator, MPParseError;
@class MPExpression, MPFunction, MPRangePath, MPExpressionTree, MPExpressionEvaluator;
@protocol MPExpressionElement;
/*!
@@ -78,8 +96,6 @@ typedef NS_ENUM(NSUInteger, MPReferenceFrame) {
*/
- (instancetype)init;
- (instancetype)initWithExpressionTree:(MPExpressionTree *)expressionTree;
/*!
@method initWithElement:
@@ -359,7 +375,7 @@ typedef NS_ENUM(NSUInteger, MPReferenceFrame) {
be evaluated. In that case the @c error parameter is set to an
appropriate value.
*/
- (NSDecimalNumber *)evaluateWithError:(MPParseError *__autoreleasing *)error;
- (NSDecimalNumber *)evaluateWithError:(NSError *__autoreleasing *)error;
- (MPExpressionTree *)parse;