diff options
author | Juan Linietsky <juan@godotengine.org> | 2020-02-20 18:58:05 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-21 14:25:29 +0100 |
commit | 3c0059650da3f1feb3c95364d571fe706826dec6 (patch) | |
tree | a36ba94f313e2dee88dc2eb253175849fb2d4138 /modules/gdscript/gdscript_tokenizer.cpp | |
parent | 7ac0973e9abb308b91597dd8881aeed62682733c (diff) | |
download | redot-engine-3c0059650da3f1feb3c95364d571fe706826dec6.tar.gz |
Added StringName as a variant type.
Also changed all relevant properties defined manually to StringName.
Diffstat (limited to 'modules/gdscript/gdscript_tokenizer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 745dd37a5b..a39a778c82 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -160,6 +160,7 @@ static const _bit _type_list[] = { { Variant::COLOR, "Color" }, { Variant::_RID, "RID" }, { Variant::OBJECT, "Object" }, + { Variant::STRING_NAME, "StringName" }, { Variant::NODE_PATH, "NodePath" }, { Variant::DICTIONARY, "Dictionary" }, { Variant::CALLABLE, "Callable" }, @@ -477,7 +478,7 @@ void GDScriptTokenizerText::_advance() { } while (true) { - bool is_node_path = false; + bool is_string_name = false; StringMode string_mode = STRING_DOUBLE_QUOTE; switch (GETCHAR(0)) { @@ -751,7 +752,7 @@ void GDScriptTokenizerText::_advance() { return; } INCPOS(1); - is_node_path = true; + is_string_name = true; FALLTHROUGH; case '\'': case '"': { @@ -862,8 +863,8 @@ void GDScriptTokenizerText::_advance() { } INCPOS(i); - if (is_node_path) { - _make_constant(NodePath(str)); + if (is_string_name) { + _make_constant(StringName(str)); } else { _make_constant(str); } |