// // NSString+MPExpressionElement.m // MathPad // // Created by Kim Wittenburg on 10.08.14. // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // #import "NSString+MPExpressionElement.h" #import "MPElementParser.h" @implementation NSString (MPExpressionElement) - (BOOL)isString { return YES; } - (BOOL)isFunction { return NO; } - (NSDecimalNumber *)evaluate:(MPParseError *__autoreleasing *)error { return [[[MPElementParser alloc] init] parseElement:self error:error].standaloneValue; } @end