[llvm] 6ad82fc - [FileCheck][Docs] Fix regex for FileCheck variable names (#97301)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 03:53:19 PDT 2024
Author: Anton Lydike
Date: 2024-07-02T11:53:15+01:00
New Revision: 6ad82fcc7d418e6e4cac9e0f82a35d8021f61ffa
URL: https://github.com/llvm/llvm-project/commit/6ad82fcc7d418e6e4cac9e0f82a35d8021f61ffa
DIFF: https://github.com/llvm/llvm-project/commit/6ad82fcc7d418e6e4cac9e0f82a35d8021f61ffa.diff
LOG: [FileCheck][Docs] Fix regex for FileCheck variable names (#97301)
This fixes a minor oversight in the FileCheck documentation on what is
considered a valid variable name.
Global variables are prefixed with a `$`, which is explained two
paragraphs below, but this was omitted in the presented regex in this
paragraph.
Added:
Modified:
llvm/docs/CommandGuide/FileCheck.rst
Removed:
################################################################################
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index 432dafa100bfd..af4930409da1a 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -731,7 +731,7 @@ The first check line matches a regex ``%[a-z]+`` and captures it into the
string variable ``REGISTER``. The second line verifies that whatever is in
``REGISTER`` occurs later in the file after an "``andw``". :program:`FileCheck`
string substitution blocks are always contained in ``[[ ]]`` pairs, and string
-variable names can be formed with the regex ``[a-zA-Z_][a-zA-Z0-9_]*``. If a
+variable names can be formed with the regex ``\$[a-zA-Z_][a-zA-Z0-9_]*``. If a
colon follows the name, then it is a definition of the variable; otherwise, it
is a substitution.
More information about the llvm-commits
mailing list