Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: third_party/re2/re2/testing/tester.cc

Issue 1530113002: Revert of Update re2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/re2/testing/tester.h ('k') | third_party/re2/re2/testing/unicode_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/testing/tester.cc
diff --git a/third_party/re2/re2/testing/tester.cc b/third_party/re2/re2/testing/tester.cc
index cb12badebfa897888924954c488440d97e555cf9..003dc5add05696f9dfcdb88936aa1230831a265e 100644
--- a/third_party/re2/re2/testing/tester.cc
+++ b/third_party/re2/re2/testing/tester.cc
@@ -246,7 +246,6 @@
// 2. It treats $ as this weird thing meaning end of string
// or before the \n at the end of the string.
// 3. It doesn't implement POSIX leftmost-longest matching.
- // 4. It lets \s match vertical tab.
// MimicsPCRE() detects 1 and 2.
if ((Engines() & (1<<kEnginePCRE)) && regexp_->MimicsPCRE() &&
kind_ != Prog::kLongestMatch) {
@@ -344,8 +343,7 @@
Prog::kAnchored, Prog::kLongestMatch,
result->submatch,
&result->skipped, NULL)) {
- LOG(ERROR) << "Reverse DFA inconsistency: "
- << CEscape(regexp_str_)
+ LOG(ERROR) << "Reverse DFA inconsistency: " << CEscape(regexp_str_)
<< " on " << CEscape(text);
result->matched = false;
}
@@ -392,13 +390,10 @@
if (kind_ == Prog::kFullMatch)
re_anchor = RE2::ANCHOR_BOTH;
- result->matched = re2_->Match(
- context,
- static_cast<int>(text.begin() - context.begin()),
- static_cast<int>(text.end() - context.begin()),
- re_anchor,
- result->submatch,
- nsubmatch);
+ result->matched = re2_->Match(context,
+ text.begin() - context.begin(),
+ text.end() - context.begin(),
+ re_anchor, result->submatch, nsubmatch);
result->have_submatch = nsubmatch > 0;
break;
}
@@ -406,14 +401,6 @@
case kEnginePCRE: {
if (!re_ || text.begin() != context.begin() ||
text.end() != context.end()) {
- result->skipped = true;
- break;
- }
-
- // PCRE 8.34 or so started allowing vertical tab to match \s,
- // following a change made in Perl 5.18. RE2 does not.
- if ((regexp_str_.contains("\\s") || regexp_str_.contains("\\S")) &&
- text.contains("\v")) {
result->skipped = true;
break;
}
@@ -518,7 +505,7 @@
}
// We disagree with PCRE on the meaning of some Unicode matches.
- // In particular, we treat non-ASCII UTF-8 as non-word characters.
+ // In particular, we treat all non-ASCII UTF-8 as word characters.
// We also treat "empty" character sets like [^\w\W] as being
// impossible to match, while PCRE apparently excludes some code
// points (e.g., 0x0080) from both \w and \W.
@@ -605,14 +592,14 @@
}
Tester::~Tester() {
- for (size_t i = 0; i < v_.size(); i++)
+ for (int i = 0; i < v_.size(); i++)
delete v_[i];
}
bool Tester::TestCase(const StringPiece& text, const StringPiece& context,
Prog::Anchor anchor) {
bool okay = true;
- for (size_t i = 0; i < v_.size(); i++)
+ for (int i = 0; i < v_.size(); i++)
okay &= (!v_[i]->error() && v_[i]->RunCase(text, context, anchor));
return okay;
}
« no previous file with comments | « third_party/re2/re2/testing/tester.h ('k') | third_party/re2/re2/testing/unicode_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698