1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +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

@@ -696,13 +696,13 @@ GDScriptTokenizer::Token GDScriptTokenizerText::number() {
if (_peek(-1) == '.') {
has_decimal = true;
} else if (_peek(-1) == '0') {
if (_peek() == 'x') {
if (_peek() == 'x' || _peek() == 'X') {
// Hexadecimal.
base = 16;
digit_check_func = is_hex_digit;
need_digits = true;
_advance();
} else if (_peek() == 'b') {
} else if (_peek() == 'b' || _peek() == 'B') {
// Binary.
base = 2;
digit_check_func = is_binary_digit;