MCPcopy Create free account
hub / github.com/Snapchat/Valdi / parse

Method parse

valdi_core/src/valdi_core/cpp/Schema/ValueSchemaParser.cpp:424–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424Result<ValueSchema> ValueSchemaParser::parse(std::string_view str) {
425 TextParser parser(str);
426 auto result = parse(parser);
427 if (!result) {
428 return parser.getError();
429 }
430 if (!parser.ensureIsAtEnd()) {
431 return parser.getError();
432 }
433 return result.value();
434}
435
436using ValueSchemaTypeParserFn = std::optional<ValueSchema> (*)(TextParser& parser);
437

Callers 7

readListFunction · 0.45
parseStringFunction · 0.45
parseTypeReferenceFunction · 0.45
doParseClassSchemaFunction · 0.45
parseEnumSchemaFunction · 0.45
parseArraySchemaFunction · 0.45
parsePromiseSchemaFunction · 0.45

Calls 8

optionalFunction · 0.85
prependErrorMethod · 0.80
valueMethod · 0.65
parseFunction · 0.50
getErrorMethod · 0.45
ensureIsAtEndMethod · 0.45
tryParseMethod · 0.45

Tested by

no test coverage detected