[PATCH] D27318: Support escaping in TrigramIndex.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 2 14:53:07 PST 2016
pcc added inline comments.
================
Comment at: lib/Support/TrigramIndex.cpp:30
+static bool isAdvancedMetachar(unsigned Char) {
+ return strchr(RegexAdvancedMetachars, Char) != NULL;
}
----------------
Nit: `nullptr`.
================
Comment at: unittests/Support/TrigramIndexTest.cpp:113
+ std::unique_ptr<TrigramIndex> TI =
+ makeTrigramIndex({"*(lala)\1*"});
+ EXPECT_TRUE(TI->isDefeated());
----------------
I think this is being defeated because of your use of parens, rather than the `\1` (which I think should really be `\\1`).
================
Comment at: unittests/Support/TrigramIndexTest.cpp:119
+ std::unique_ptr<TrigramIndex> TI =
+ makeTrigramIndex({"*(lala)\2*"});
EXPECT_TRUE(TI->isDefeated());
----------------
Same here.
https://reviews.llvm.org/D27318
More information about the llvm-commits
mailing list