Browse files

Additional change to 0b84213

  • Loading branch information...
1 parent 536bde4 commit 0d8e8acf8a333711c7ff086f186e18c38659abcb @poiru poiru committed Dec 23, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 Library/MathParser.cpp
View
7 Library/MathParser.cpp
@@ -607,7 +607,12 @@ Token GetNextToken(Lexer& lexer)
if (lexer.charType == CharType::MinusSymbol)
{
// If the - sign follows a symbol, it is treated as a (negative) number.
- lexer.charType = (lexer.token == Token::Operator) ? CharType::Digit : CharType::Symbol;
+ lexer.charType = CharType::Symbol;
+ if (lexer.token == Token::Operator &&
+ lexer.value.oper != Operator::ClosingBracket) // Special case for e.g. (5)-2.
+ {
+ lexer.charType = CharType::Digit;
+ }
}
switch (lexer.charType)

0 comments on commit 0d8e8ac

Please sign in to comment.