42 lines
894 B
Objective-C
42 lines
894 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)
|
|
|
|
//- (void)setExpression:(MPExpression *)expression
|
|
//{
|
|
// _expression.parent = nil;
|
|
// _expression = expression;
|
|
// _expression.parent = self;
|
|
//}
|
|
|
|
- (NSArray *)childrenAccessors
|
|
{
|
|
return @[@"expression"];
|
|
}
|
|
|
|
- (MPTerm *)parseWithError:(MPParseError *__autoreleasing *)error
|
|
{
|
|
MPExpressionEvaluator *evaluator = self.expression.evaluator;
|
|
return [evaluator parseExpectingVariable:NO
|
|
error:error];
|
|
}
|
|
|
|
- (NSString *)description
|
|
{
|
|
return [NSString stringWithFormat:@"(%@)", self.expression.description];
|
|
}
|
|
|
|
@end
|