Reorganized File Structure
Added Documentation
This commit is contained in:
38
MathKit/MPFunction+MPToken.m
Normal file
38
MathKit/MPFunction+MPToken.m
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// MPFunction+MPToken.m
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 19.09.14.
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPFunction+MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPPowerFunction.h"
|
||||
|
||||
|
||||
|
||||
@implementation MPFunction (MPToken)
|
||||
|
||||
- (MPTokenType)tokenType
|
||||
{
|
||||
return [self isMemberOfClass:[MPPowerFunction class]] ? MPPowerToken : MPGenericFunctionToken;
|
||||
}
|
||||
|
||||
|
||||
- (NSRange)range
|
||||
{
|
||||
return NSMakeRange([self.parent convertIndex:[self.parent indexOfElement:self]
|
||||
fromReferenceFrame:MPElementReferenceFrame
|
||||
toReferenceFrame:MPSymbolReferenceFrame],
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)stringValue
|
||||
{
|
||||
return [self description];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user