diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-08 21:09:13 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-08 21:09:13 -0300 |
commit | 292e8bf0ab02cf37b6ee1759a3942a57a6a69062 (patch) | |
tree | 108bba6e20598a120bb6dd737e1e6e9369658fde | |
parent | 176afb2feb7ed235bf9d7528ee3e8af092f12f90 (diff) |
fix issues related to StringArray parsing
-rw-r--r-- | core/variant_parser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index e7fbbba548..446f9ae6d1 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1189,7 +1189,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in get_token(p_stream,token,line,r_err_str); if (token.type==TK_COMMA) { //do none - } else if (token.type!=TK_PARENTHESIS_CLOSE) { + } else if (token.type==TK_PARENTHESIS_CLOSE) { break; } else { r_err_str="Expected ',' or ')'"; @@ -1198,11 +1198,13 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } } get_token(p_stream,token,line,r_err_str); + if (token.type!=TK_STRING) { - r_err_str="Expected string"; + r_err_str="Expected string"; return ERR_PARSE_ERROR; } + first=false; cs.push_back(token.value); } @@ -2118,7 +2120,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str if (i>0) p_store_string_func(p_store_string_ud,", "); String str=ptr[i]; - p_store_string_func(p_store_string_ud,""+str.c_escape()+"\""); + p_store_string_func(p_store_string_ud,"\""+str.c_escape()+"\""); } p_store_string_func(p_store_string_ud," )"); |