Additional change to 0b84213

This commit is contained in:
Birunthan Mohanathas 2012-12-23 15:47:23 +02:00
parent 536bde48d1
commit 0d8e8acf8a

View File

@ -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)