| 130 | } |
| 131 | |
| 132 | Error ResourceLoaderCompatText::_parse_sub_resource(VariantParser::Stream *p_stream, Ref<Resource> &r_res, int &line, String &r_err_str) { |
| 133 | VariantParser::Token token; |
| 134 | VariantParser::get_token(p_stream, token, line, r_err_str); |
| 135 | if (token.type != VariantParser::TK_NUMBER && token.type != VariantParser::TK_STRING) { |
| 136 | r_err_str = "Expected number (old style sub-resource index) or string"; |
| 137 | return ERR_PARSE_ERROR; |
| 138 | } |
| 139 | |
| 140 | String id = token.value; |
| 141 | ERR_FAIL_COND_V(!int_resources.has(id), ERR_INVALID_PARAMETER); |
| 142 | r_res = int_resources[id]; |
| 143 | |
| 144 | VariantParser::get_token(p_stream, token, line, r_err_str); |
| 145 | if (token.type != VariantParser::TK_PARENTHESIS_CLOSE) { |
| 146 | r_err_str = "Expected ')'"; |
| 147 | return ERR_PARSE_ERROR; |
| 148 | } |
| 149 | |
| 150 | return OK; |
| 151 | } |
| 152 | |
| 153 | Error ResourceLoaderCompatText::_parse_ext_resource(VariantParser::Stream *p_stream, Ref<Resource> &r_res, int &line, String &r_err_str) { |
| 154 | VariantParser::Token token; |
no outgoing calls
no test coverage detected