MCPcopy Create free account
hub / github.com/apache/trafficserver / ScanTagHandle

Function ScanTagHandle

lib/yamlcpp/src/scantag.cpp:32–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
33 std::string tag;
34 canBeHandle = true;
35 Mark firstNonWordChar;
36
37 while (INPUT) {
38 if (INPUT.peek() == Keys::Tag) {
39 if (!canBeHandle)
40 throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE);
41 break;
42 }
43
44 int n = 0;
45 if (canBeHandle) {
46 n = Exp::Word().Match(INPUT);
47 if (n <= 0) {
48 canBeHandle = false;
49 firstNonWordChar = INPUT.mark();
50 }
51 }
52
53 if (!canBeHandle)
54 n = Exp::Tag().Match(INPUT);
55
56 if (n <= 0)
57 break;
58
59 tag += INPUT.get(n);
60 }
61
62 return tag;
63}
64
65const std::string ScanTagSuffix(Stream& INPUT) {
66 std::string tag;

Callers 1

ScanTagMethod · 0.85

Calls 7

ParserExceptionFunction · 0.85
WordClass · 0.85
peekMethod · 0.80
TagClass · 0.70
MatchMethod · 0.45
markMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected