Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions re2/filtered_re2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ int FilteredRE2::FirstMatch(absl::string_view text,
bool FilteredRE2::AllMatches(absl::string_view text,
const std::vector<int>& atoms,
std::vector<int>* matching_regexps) const {
if (!compiled_) {
ABSL_LOG(DFATAL) << "AllMatches called before Compile.";
matching_regexps->clear();
return false;
}
matching_regexps->clear();
std::vector<int> regexps;
prefilter_tree_->RegexpsGivenStrings(atoms, &regexps);
Expand All @@ -123,6 +128,11 @@ bool FilteredRE2::AllMatches(absl::string_view text,

void FilteredRE2::AllPotentials(const std::vector<int>& atoms,
std::vector<int>* potential_regexps) const {
if (!compiled_) {
ABSL_LOG(DFATAL) << "AllPotentials called before Compile.";
potential_regexps->clear();
return;
}
prefilter_tree_->RegexpsGivenStrings(atoms, potential_regexps);
}

Expand Down