diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-16 09:04:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 09:04:31 +0100 |
commit | 3002130a6d3ab0a00d3e7538283d7f468becd8fa (patch) | |
tree | 09f7a95aa893c88ffe0102ac04c369b3dd2f7a17 /modules | |
parent | dc463e1e42ac919d99d763c0127436877fc4efc5 (diff) | |
parent | 443ce6fef2ff2115b90d1929d33788fb2afe2636 (diff) |
Merge pull request #12957 from bojidar-bg/12928-numeric-underscores
Allow underscores in GDScript numeric literals
Diffstat (limited to 'modules')
-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); |