| 42 | } |
| 43 | |
| 44 | bool Scanner::GetResult(StringPiece* remaining, StringPiece* capture) { |
| 45 | if (error_) { |
| 46 | return false; |
| 47 | } |
| 48 | if (remaining != nullptr) { |
| 49 | *remaining = cur_; |
| 50 | } |
| 51 | if (capture != nullptr) { |
| 52 | const char* end = capture_end_ == nullptr ? cur_.data() : capture_end_; |
| 53 | *capture = StringPiece(capture_start_, end - capture_start_); |
| 54 | } |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | } // namespace strings |
| 59 | } // namespace tensorflow |