Cleaned Code by Removing Location Tracking for Errors
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user