diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2017-11-15 22:53:08 +0200 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2017-11-15 22:53:08 +0200 |
commit | 443ce6fef2ff2115b90d1929d33788fb2afe2636 (patch) | |
tree | e6a835c360cbafbf46933da846b91342e33a7c00 /modules/gdscript/gd_tokenizer.cpp | |
parent | 6277e6d40a0f0e8c84470482400959fca4ff5ad8 (diff) |
Allow underscores in GDScript numeric literals
Closes #12928
Diffstat (limited to 'modules/gdscript/gd_tokenizer.cpp')
-rw-r--r-- | modules/gdscript/gd_tokenizer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 98ac0f473d..e241eacd4f 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -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); |