MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _parse_enginecfg

Method _parse_enginecfg

core/variant/variant_parser.cpp:530–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String> &strings, int &line, String &r_err_str) {
531 Token token;
532 get_token(p_stream, token, line, r_err_str);
533 if (token.type != TK_PARENTHESIS_OPEN) {
534 r_err_str = "Expected '(' in old-style project.godot construct";
535 return ERR_PARSE_ERROR;
536 }
537
538 String accum;
539
540 while (true) {
541 char32_t c = p_stream->get_char();
542
543 if (p_stream->is_eof()) {
544 r_err_str = "Unexpected EOF while parsing old-style project.godot construct";
545 return ERR_PARSE_ERROR;
546 }
547
548 if (c == ',') {
549 strings.push_back(accum.strip_edges());
550 accum = String();
551 } else if (c == ')') {
552 strings.push_back(accum.strip_edges());
553 return OK;
554 } else if (c == '\n') {
555 line++;
556 }
557 }
558}
559
560template <typename T>
561Error VariantParser::_parse_construct(Stream *p_stream, Vector<T> &r_construct, int &line, String &r_err_str) {

Callers

nothing calls this directly

Calls 5

get_charMethod · 0.80
is_eofMethod · 0.80
strip_edgesMethod · 0.80
StringClass · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected