Fix parser not recognizing hex numbers with prefix '0X'

This commit is contained in:
GriffinR 2025-06-08 16:34:59 -04:00
parent 560d204890
commit 591b7c2055
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp
### Fixed
- Fix duplicated maps writing the wrong name.
- Fix small maps being difficult to see while resizing.
- Fix expressions using the prefix '0X' as opposed to '0x' not being recognized has hex numbers.
## [6.0.0] - 2025-05-26
### Breaking Changes

View File

@ -185,7 +185,7 @@ QList<Token> ParseUtil::tokenizeExpression(QString expression) {
QList<Token> tokens;
static const QStringList tokenTypes = {"hex", "decimal", "identifier", "operator", "leftparen", "rightparen"};
static const QRegularExpression re("^(?<hex>0x[0-9a-fA-F]+)|(?<decimal>[0-9]+)|(?<identifier>[a-zA-Z_0-9]+)|(?<operator>[+\\-*\\/<>|^%]+)|(?<leftparen>\\()|(?<rightparen>\\))");
static const QRegularExpression re("^(?<hex>0[xX][0-9a-fA-F]+)|(?<decimal>\\d+)|(?<identifier>\\w+)|(?<operator>[+\\-*\\/<>|^%]+)|(?<leftparen>\\()|(?<rightparen>\\))");
expression = expression.trimmed();
while (!expression.isEmpty()) {