From 0d8e8acf8a333711c7ff086f186e18c38659abcb Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 23 Dec 2012 15:47:23 +0200 Subject: [PATCH] Additional change to 0b84213 --- Library/MathParser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/MathParser.cpp b/Library/MathParser.cpp index 74b12070..d5ce22b9 100644 --- a/Library/MathParser.cpp +++ b/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)