diff options
author | Carter Anderson <mcanders1@gmail.com> | 2017-05-31 23:48:32 -0700 |
---|---|---|
committer | Carter Anderson <mcanders1@gmail.com> | 2017-06-04 21:33:09 -0700 |
commit | 0a8de39bb10bc598fa4fec55b13a7d3304d5b5b1 (patch) | |
tree | 25fa0d02ba51238960a9c83b17399ac7894f6047 /core | |
parent | 40959acef2b16a7f9658c780943cccfadb8ef78c (diff) |
Fix Variant::OBJECT token parsing
Diffstat (limited to 'core')
-rw-r--r-- | core/variant_parser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 55e2bb42e3..79c98e1d05 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -744,7 +744,12 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, return err; if (token.type == TK_PARENTHESIS_CLOSE) { - + Reference *reference = obj->cast_to<Reference>(); + if (reference) { + value = REF(reference); + } else { + value = obj; + } return OK; } @@ -760,7 +765,6 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, } } - get_token(p_stream, token, line, r_err_str); if (token.type != TK_STRING) { r_err_str = "Expected property name as string"; return ERR_PARSE_ERROR; |