[PATCH] D60386: FileCheck [6/12]: Introduce numeric variable definition

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 07:25:36 PDT 2019


thopre added inline comments.


================
Comment at: llvm/include/llvm/Support/FileCheck.h:350
   /// VariableDefs will map "bar" to 2 corresponding to the second definition
   /// of "bar".
   ///
----------------
probinson wrote:
> I think what this is trying to say is:
> the pattern "foo[[bar:.*]]baz[[bar]]quux[[bar:.*]]"
> is translated into some regex with parentheses,
> the second set of parentheses corresponds to the last definition of "bar" on the line,
> hence VariableDefs will map "bar" to 2.
> 
> Is that right? The translation of check-line-with-square-brackets-with-regex into parenthesized-regex-passed-to-regex-library is not obvious in this comment as written.
Indeed. The comment was already unclear before this patch series, I think the reason is in most cases the CHECK directive does not contain parenthesis so the square bracket definition maps directly to the parenthesis group number. Hopefully the comment is now clearer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60386/new/

https://reviews.llvm.org/D60386





More information about the llvm-commits mailing list