MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ScanUntilImpl

Method ScanUntilImpl

tensorflow/core/lib/strings/scanner.cc:21–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace strings {
20
21void Scanner::ScanUntilImpl(char end_ch, bool escaped) {
22 for (;;) {
23 if (cur_.empty()) {
24 Error();
25 return;
26 }
27 const char ch = cur_[0];
28 if (ch == end_ch) {
29 return;
30 }
31
32 cur_.remove_prefix(1);
33 if (escaped && ch == '\\') {
34 // Escape character, skip next character.
35 if (cur_.empty()) {
36 Error();
37 return;
38 }
39 cur_.remove_prefix(1);
40 }
41 }
42}
43
44bool Scanner::GetResult(StringPiece* remaining, StringPiece* capture) {
45 if (error_) {

Callers

nothing calls this directly

Calls 2

ErrorFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected