1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Allow underscores in GDScript numeric literals

Closes #12928
This commit is contained in:
Bojidar Marinov
2017-11-15 22:53:08 +02:00
parent 6277e6d40a
commit 443ce6fef2
2 changed files with 8 additions and 4 deletions

View File

@@ -885,6 +885,9 @@ void GDTokenizerText::_advance() {
return;
}
sign_found = true;
} else if (GETCHAR(i) == '_') {
i++;
continue; // Included for readability, shouldn't be a part of the string
} else
break;
@@ -897,7 +900,7 @@ void GDTokenizerText::_advance() {
return;
}
INCPOS(str.length());
INCPOS(i);
if (hexa_found) {
int64_t val = str.hex_to_int64();
_make_constant(val);