mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare] Parser: forbid parsing 0xABCF as 0xABC*F
This commit is contained in:
@@ -154,8 +154,11 @@ void Parser::parseNumber(Expression & leftHandSide, Token::Type stoppingType) {
|
||||
return;
|
||||
}
|
||||
leftHandSide = m_currentToken.expression();
|
||||
if (m_nextToken.isNumber()) {
|
||||
m_status = Status::Error; // No implicit multiplication between two numbers
|
||||
// No implicit multiplication between two numbers
|
||||
if (m_nextToken.isNumber()
|
||||
// No implicit multiplication between a hexadecimal number and an identifer (avoid parsing 0x2abch as 0x2ABC*h)
|
||||
|| (m_currentToken.is(Token::Type::HexadecimalNumber) && m_nextToken.is(Token::Type::Identifier))) {
|
||||
m_status = Status::Error;
|
||||
return;
|
||||
}
|
||||
isThereImplicitMultiplication();
|
||||
|
||||
@@ -238,7 +238,7 @@ QUIZ_CASE(poincare_parsing_parse) {
|
||||
assert_text_not_parsable("0=0→x");
|
||||
assert_text_not_parsable("1ᴇ2ᴇ3");
|
||||
assert_text_not_parsable("0b001112");
|
||||
//assert_text_not_parsable("0x123G");
|
||||
assert_text_not_parsable("0x123G");
|
||||
}
|
||||
|
||||
Matrix BuildMatrix(int rows, int columns, Expression entries[]) {
|
||||
|
||||
Reference in New Issue
Block a user