1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Fix uppercase B and X parsing in the integer literals.

This commit is contained in:
bruvzg
2025-02-04 09:51:10 +02:00
committed by Pāvels Nadtočajevs
parent c394eaa45c
commit 3be46a69c4
8 changed files with 31 additions and 19 deletions

View File

@@ -350,9 +350,9 @@ Error Expression::_get_token(Token &r_token) {
case READING_INT: {
if (is_digit(c)) {
if (is_first_char && c == '0') {
if (next_char == 'b') {
if (next_char == 'b' || next_char == 'B') {
reading = READING_BIN;
} else if (next_char == 'x') {
} else if (next_char == 'x' || next_char == 'X') {
reading = READING_HEX;
}
}
@@ -370,7 +370,7 @@ Error Expression::_get_token(Token &r_token) {
case READING_BIN: {
if (bin_beg && !is_binary_digit(c)) {
reading = READING_DONE;
} else if (c == 'b') {
} else if (c == 'b' || c == 'B') {
bin_beg = true;
}
@@ -378,7 +378,7 @@ Error Expression::_get_token(Token &r_token) {
case READING_HEX: {
if (hex_beg && !is_hex_digit(c)) {
reading = READING_DONE;
} else if (c == 'x') {
} else if (c == 'x' || c == 'X') {
hex_beg = true;
}