MCPcopy Create free account
hub / github.com/decaf-emu/decaf-emu / parseComment

Function parseComment

tools/latte-assembler/src/gfd.cpp:31–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29};
30
31bool
32parseComment(const std::string &comment,
33 CommentKeyValue &out)
34{
35 std::smatch match;
36 if (!std::regex_match(comment, match, sCommentKeyValueRegex)) {
37 if (std::regex_match(comment, match, sCommentKeyValueStartRegex)) {
38 throw gfd_header_parse_exception {
39 fmt::format("Syntax error in comment {}", comment)
40 };
41 }
42
43 return false;
44 }
45
46 out.obj = match[1];
47 out.index = match[2];
48 out.member = match[3];
49 out.value = match[4];
50
51 if (out.value.size() >= 2 && out.value[0] == '"') {
52 // Erase quotes from string value
53 out.value.erase(out.value.begin());
54 out.value.erase(out.value.end() - 1);
55 }
56
57 return true;
58}
59
60void
61ensureArrayOfObjects(const CommentKeyValue &kv)

Callers 2

parseShaderCommentsFunction · 0.85
parseShaderCommentsFunction · 0.85

Calls 4

sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected