summaryrefslogtreecommitdiffstats
path: root/core/variant/variant_parser.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-06-12 21:52:15 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-06-12 22:13:35 +0200
commit326e483ef374f505398aebb159376402d77e3b8f (patch)
treeecec785b32bd15966cd1dba873114a99980c144f /core/variant/variant_parser.cpp
parent0024bb3f4eb9ec6808acd0760bb485d3a669bc3e (diff)
downloadredot-engine-326e483ef374f505398aebb159376402d77e3b8f.tar.gz
VariantParser: Fix reading StringNames with '&'.
Keep support for '@' for now for compatibility. Fixes #49535. Fixes #49542.
Diffstat (limited to 'core/variant/variant_parser.cpp')
-rw-r--r--core/variant/variant_parser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp
index 12b5aa6590..751cb64c62 100644
--- a/core/variant/variant_parser.cpp
+++ b/core/variant/variant_parser.cpp
@@ -190,10 +190,13 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
r_token.type = TK_COLOR;
return OK;
}
- case '@': {
+#ifndef DISABLE_DEPRECATED
+ case '@': // Compatibility with 3.x StringNames.
+#endif
+ case '&': { // StringName.
cchar = p_stream->get_char();
if (cchar != '"') {
- r_err_str = "Expected '\"' after '@'";
+ r_err_str = "Expected '\"' after '&'";
r_token.type = TK_ERROR;
return ERR_PARSE_ERROR;
}