Browse Source

Change order of checking for operators; this should have no effect

master
Said Achmiz 9 years ago
parent
commit
8c924a0fa9
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      SA_DiceParser.m

+ 6
- 6
SA_DiceParser.m View File

expression[SA_DB_OPERAND_LEFT] = [self legacyExpressionForLegalString:[dieRollString substringToIndex:operatorRange.location]]; expression[SA_DB_OPERAND_LEFT] = [self legacyExpressionForLegalString:[dieRollString substringToIndex:operatorRange.location]];
expression[SA_DB_OPERAND_RIGHT] = [self legacyExpressionForLegalString:[dieRollString substringFromIndex:(operatorRange.location + operatorRange.length)]]; expression[SA_DB_OPERAND_RIGHT] = [self legacyExpressionForLegalString:[dieRollString substringFromIndex:(operatorRange.location + operatorRange.length)]];
// Check to see if the term is a subtraction operation.
if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_MINUS] containsCharactersInString:operator])
{
expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_MINUS;
}
// Check to see if the term is an addition operation. // Check to see if the term is an addition operation.
else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_PLUS] containsCharactersInString:operator])
if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_PLUS] containsCharactersInString:operator])
{ {
expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_PLUS; expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_PLUS;
} }
// Check to see if the term is a subtraction operation.
else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_MINUS] containsCharactersInString:operator])
{
expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_MINUS;
}
// Check to see if the term is a multiplication operation. // Check to see if the term is a multiplication operation.
else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_TIMES] containsCharactersInString:operator]) else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_TIMES] containsCharactersInString:operator])
{ {

Loading…
Cancel
Save