Implemented Expression Evaluation/Parsing with Proper Error Handling
This commit is contained in:
21
MathPad/NSRegularExpression+MPParsingAdditions.h
Normal file
21
MathPad/NSRegularExpression+MPParsingAdditions.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// NSRegularExpression+MPParsingAdditions.h
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 09.09.14.
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define MPStringRange(string) NSMakeRange(0, [string length])
|
||||
#define MPStringRangeFrom(from, string) NSMakeRange(from, [string length]-from)
|
||||
|
||||
@interface NSRegularExpression (MPParsingAdditions)
|
||||
|
||||
- (NSTextCheckingResult *)firstMatchInString:(NSString *)string;
|
||||
- (NSTextCheckingResult *)firstMatchInString:(NSString *)string fromIndex:(NSUInteger)start;
|
||||
- (NSTextCheckingResult *)firstMatchInString:(NSString *)string options:(NSMatchingOptions)options;
|
||||
- (NSTextCheckingResult *)firstMatchInString:(NSString *)string options:(NSMatchingOptions)options fromIndex:(NSUInteger)start;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user