Archived
1

Added Factorial, added parts of exponents

This commit is contained in:
Kim Wittenburg
2014-09-30 22:18:51 +02:00
parent 7d48d85dfb
commit a382b1f10b
8 changed files with 55 additions and 27 deletions

View File

@@ -45,6 +45,7 @@
@"(cos)|"
@"(tan)|"
@"([A-Za-z])|"
@"(!)|"
@"(=)|"
@"(\\s)"
@")";
@@ -66,8 +67,9 @@
NSRange cosRange = [match rangeAtIndex:5];
NSRange tanRange = [match rangeAtIndex:6];
NSRange variableRange = [match rangeAtIndex:7];
NSRange equalsRange = [match rangeAtIndex:8];
NSRange whitespaceRange = [match rangeAtIndex:9];
NSRange factorialRange = [match rangeAtIndex:8];
NSRange equalsRange = [match rangeAtIndex:9];
NSRange whitespaceRange = [match rangeAtIndex:10];
if (MPRangeExists(multiplicationSymbolRange)) {
range = multiplicationSymbolRange;
@@ -90,6 +92,9 @@
} else if (MPRangeExists(variableRange)) {
range = variableRange;
tokenType = MPVariableToken;
} else if (MPRangeExists(factorialRange)) {
range = factorialRange;
tokenType = MPFactorialToken;
} else if (MPRangeExists(equalsRange)) {
range = equalsRange;
tokenType = MPEqualsToken;