18 #include <strings/Scanner.h> 23 void Scanner::ScanUntilImpl(
char end_ch,
bool escaped) {
29 const char ch = cur_[0];
34 cur_.remove_prefix(1);
35 if (escaped && ch ==
'\\') {
41 cur_.remove_prefix(1);
46 bool Scanner::GetResult(StringPiece* remaining, StringPiece* capture) {
50 if (remaining !=
nullptr) {
53 if (capture !=
nullptr) {
54 const char* end = capture_end_ ==
nullptr ? cur_.data() : capture_end_;
55 *capture = StringPiece(capture_start_, end - capture_start_);