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

Method parseIdentifier

valdi_core/src/valdi_core/cpp/Utils/TextParser.cpp:266–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266std::optional<std::string_view> TextParser::parseIdentifier() {
267 auto currentPosition = position();
268 tryParseWhitespaces();
269
270 auto str = readWhile(isIdentifierChar);
271 if (str.empty()) {
272 _position = currentPosition;
273 setErrorAtCurrentPosition("Expecting identifier");
274 return std::nullopt;
275 }
276 return str;
277}
278
279std::string_view TextParser::readUntilCharacter(char c) {
280 return readWhile([c](char currentC) { return currentC != c; });

Callers 3

TESTFunction · 0.45
parseMethod · 0.45
preprocessBorderFunction · 0.45

Calls 2

positionFunction · 0.85
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.36