29 lines
774 B
Objective-C
29 lines
774 B
Objective-C
//
|
|
// MPFunction+MPValue.m
|
|
// MathPad
|
|
//
|
|
// Created by Kim Wittenburg on 09.10.14.
|
|
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
|
//
|
|
|
|
#import "MPFunction+MPValue.h"
|
|
|
|
#import "MPFunction+MPToken.h"
|
|
|
|
@implementation MPFunction (MPValue)
|
|
|
|
- (instancetype)initWithTokenStream:(MPTokenStream *)tokenStream
|
|
{
|
|
[tokenStream beginIgnoringWhitespaceTokens];
|
|
if (tokenStream.currentToken.tokenType != MPGenericFunctionToken) {
|
|
@throw [NSException exceptionWithName:NSInternalInconsistencyException
|
|
reason:@"Expected Function"
|
|
userInfo:nil];
|
|
}
|
|
[tokenStream currentTokenConsumed];
|
|
[tokenStream endIgnoringOrAcceptingWhitespaceTokens];
|
|
return [self init];
|
|
}
|
|
|
|
@end
|