Archived
1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mathpad/MathPad/MPParenthesisFunction.m
Kim Wittenburg f4f924bd71 Cleaned Imports
2014-11-08 01:05:08 +01:00

40 lines
711 B
Objective-C

//
// MPParenthesisFunction.m
// MathPad
//
// Created by Kim Wittenburg on 17.09.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import "MPParenthesisFunction.h"
#import "MPExpression.h"
#import "MPExpressionTree.h"
@implementation MPParenthesisFunction
MPFunctionAccessorImplementation(Expression, _expression)
- (NSArray *)childrenAccessors
{
return @[@"expression"];
}
- (BOOL)validate:(NSError *__autoreleasing *)error
{
return [[self.expression parse] validate:error];
}
- (NSDecimalNumber *)evaluate
{
return [[self.expression parse] evaluate];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"(%@)", self.expression.description];
}
@end