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 82259f87e2 Model Redesign: Added Reference Frames
Added Inverse Functions
UI Redesign
Cleaned Code
2014-10-07 20:25:54 +02:00

35 lines
778 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 "MPExpressionEvaluator.h"
@implementation MPParenthesisFunction
MPFunctionAccessorImplementation(Expression, _expression)
- (NSArray *)childrenAccessors
{
return @[@"expression"];
}
- (MPTerm *)parseWithError:(MPParseError *__autoreleasing *)error
{
MPExpressionEvaluator *evaluator = [[MPExpressionEvaluator alloc] initWithExpression:self.expression];
return [evaluator parseExpectingVariable:NO
error:error];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"(%@)", self.expression.description];
}
@end