[PATCH] D38787: [FileCheck] doc update/fix

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 01:58:51 PDT 2017


SjoerdMeijer updated this revision to Diff 118756.
SjoerdMeijer added a comment.

Thanks for reviewing/checking. The regexp class implements both BRE and ERE, but it defaults to using ERE. Thus FileCheck defaults to ERE. As the mode is not exposed to the user (with e.g. an option), I kept it simple and now say that FileCheck supports ERE.


https://reviews.llvm.org/D38787

Files:
  docs/CommandGuide/FileCheck.rst


Index: docs/CommandGuide/FileCheck.rst
===================================================================
--- docs/CommandGuide/FileCheck.rst
+++ docs/CommandGuide/FileCheck.rst
@@ -397,10 +397,11 @@
 For most uses of FileCheck, fixed string matching is perfectly sufficient.  For
 some things, a more flexible form of matching is desired.  To support this,
 FileCheck allows you to specify regular expressions in matching strings,
-surrounded by double braces: ``{{yourregex}}``.  Because we want to use fixed
-string matching for a majority of what we do, FileCheck has been designed to
-support mixing and matching fixed string matching with regular expressions.
-This allows you to write things like this:
+surrounded by double braces: ``{{yourregex}}``. FileCheck implements a POSIX
+regular expression matcher; it supports Extended POSIX regular expressions
+(ERE). Because we want to use fixed string matching for a majority of what we
+do, FileCheck has been designed to support mixing and matching fixed string
+matching with regular expressions.  This allows you to write things like this:
 
 .. code-block:: llvm
 
@@ -434,7 +435,7 @@
 variable ``REGISTER``.  The second line verifies that whatever is in
 ``REGISTER`` occurs later in the file after an "``andw``".  :program:`FileCheck`
 variable references are always contained in ``[[ ]]`` pairs, and their names can
-be formed with the regex ``[a-zA-Z][a-zA-Z0-9]*``.  If a colon follows the name,
+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 use.
 
 :program:`FileCheck` variables can be defined multiple times, and uses always


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38787.118756.patch
Type: text/x-patch
Size: 1694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171012/b3552ae6/attachment.bin>


More information about the llvm-commits mailing list