[PATCH] D60384: FileCheck [4/12]: Introduce @LINE numeric expressions

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 06:07:52 PDT 2019


probinson added a comment.

First pass looking at docs and commentary.



================
Comment at: llvm/docs/CommandGuide/FileCheck.rst:574
+``[[#@LINE+<offset>]]``, ``[[#@LINE-<offset>]]`` numeric expressions in
+patterns, with arbitrary number of space between each elements of the
+expression. These expressions expand to a number of the line where a pattern
----------------
with an arbitrary number of spaces


================
Comment at: llvm/docs/CommandGuide/FileCheck.rst:575
+patterns, with arbitrary number of space between each elements of the
+expression. These expressions expand to a number of the line where a pattern
+is located (with an optional integer offset).
----------------
expand to the number of the line where the pattern


================
Comment at: llvm/docs/CommandGuide/FileCheck.rst:592
+variable syntax: ``[[@LINE]]``, ``[[@LINE+<offset>]]`` and
+``[[@LINE-<offset>]]`` without any space where ``offset`` is an integer
+immediate.
----------------
with no spaces inside the brackets and where


================
Comment at: llvm/include/llvm/Support/FileCheck.h:46
+private:
+  /// Value of the numeric expression..
+  uint64_t Value;
----------------
Extra trailing period.


================
Comment at: llvm/lib/Support/FileCheck.cpp:235
+    // Pattern variable and numeric expressions matches. Pattern variables
+    // come in two forms: [[foo:.*]] which matches .* (or some other regex) and
+    // assigns it to the FileCheck variable 'foo'. The second form is [[foo]]
----------------
Hm. The *variable* does not come in two forms; perhaps we should call these "pattern expressions"?  Which come in two forms, one that defines a pattern variable and one that uses it.


================
Comment at: llvm/lib/Support/FileCheck.cpp:241
+    // substitution mode. Numeric variable names have the same restriction as
+    // their pattern variable counterpart.
     if (PatternStr.startswith("[[")) {
----------------
I thought numeric variables didn't exist until a later patch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60384





More information about the llvm-commits mailing list