MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / ParseMetaData

Method ParseMetaData

native/thirdpart/flatbuffers/idl_parser.cpp:1705–1731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1703}
1704
1705CheckedError Parser::ParseMetaData(SymbolTable<Value> *attributes) {
1706 if (Is('(')) {
1707 NEXT();
1708 for (;;) {
1709 auto name = attribute_;
1710 if (false == (Is(kTokenIdentifier) || Is(kTokenStringConstant)))
1711 return Error("attribute name must be either identifier or string: " +
1712 name);
1713 if (known_attributes_.find(name) == known_attributes_.end())
1714 return Error("user define attributes must be declared before use: " +
1715 name);
1716 NEXT();
1717 auto e = new Value();
1718 if (attributes->Add(name, e)) Warning("attribute already found: " + name);
1719 if (Is(':')) {
1720 NEXT();
1721 ECHECK(ParseSingleValue(&name, *e, true));
1722 }
1723 if (Is(')')) {
1724 NEXT();
1725 break;
1726 }
1727 EXPECT(',');
1728 }
1729 }
1730 return NoError();
1731}
1732
1733CheckedError Parser::ParseEnumFromString(const Type &type,
1734 std::string *result) {

Callers

nothing calls this directly

Calls 4

ErrorFunction · 0.85
NoErrorFunction · 0.85
AddMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected