diff options
Diffstat (limited to 'modules/gdscript/gd_tokenizer.cpp')
-rw-r--r-- | modules/gdscript/gd_tokenizer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 5f85158232..e241eacd4f 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -123,6 +123,7 @@ const char *GDTokenizer::token_names[TK_MAX] = { "'$'", "'\\n'", "PI", + "TAU", "_", "INF", "NAN", @@ -217,6 +218,7 @@ static const _kws _keyword_list[] = { { GDTokenizer::TK_CF_PASS, "pass" }, { GDTokenizer::TK_SELF, "self" }, { GDTokenizer::TK_CONST_PI, "PI" }, + { GDTokenizer::TK_CONST_TAU, "TAU" }, { GDTokenizer::TK_WILDCARD, "_" }, { GDTokenizer::TK_CONST_INF, "INF" }, { GDTokenizer::TK_CONST_NAN, "NAN" }, @@ -280,6 +282,7 @@ bool GDTokenizer::is_token_literal(int p_offset, bool variable_safe) const { case TK_CF_PASS: case TK_SELF: case TK_CONST_PI: + case TK_CONST_TAU: case TK_WILDCARD: case TK_CONST_INF: case TK_CONST_NAN: @@ -882,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; @@ -894,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); |