diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 23:22:48 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 23:22:48 -0300 |
commit | 725b61bb6c71b0f3bd469bc9a9252c4e49ec5598 (patch) | |
tree | 7245f1e1a6e7f1df6f40bf1b0a998fa1c4e43538 /core/variant_parser.cpp | |
parent | 1a9c3a134df879e17c939156dfcddfdf283ac447 (diff) | |
download | redot-engine-725b61bb6c71b0f3bd469bc9a9252c4e49ec5598.tar.gz |
properly handle typed array constructors in VariantParser, closes #3054
Diffstat (limited to 'core/variant_parser.cpp')
-rw-r--r-- | core/variant_parser.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 491eacb099..3efa87de80 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -448,7 +448,7 @@ Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,in if (!first) { get_token(p_stream,token,line,r_err_str); if (token.type==TK_COMMA) { - //do none + //do none } else if (token.type==TK_PARENTHESIS_CLOSE) { break; } else { @@ -458,7 +458,10 @@ Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,in } } get_token(p_stream,token,line,r_err_str); - if (token.type!=TK_NUMBER) { + + if (first && token.type==TK_PARENTHESIS_CLOSE) { + break; + } else if (token.type!=TK_NUMBER) { r_err_str="Expected float in constructor"; return ERR_PARSE_ERROR; } |