summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2f20b2)
raw | patch | inline | side by side (parent: a2f20b2)
author | Daniel Dunbar <daniel@zuster.org> | |
Sun, 22 Nov 2009 22:07:50 +0000 (22:07 +0000) | ||
committer | Daniel Dunbar <daniel@zuster.org> | |
Sun, 22 Nov 2009 22:07:50 +0000 (22:07 +0000) |
separate character.
- Chris, OK?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89626 91177308-0d34-0410-b5e6-96231b3b80d8
- Chris, OK?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89626 91177308-0d34-0410-b5e6-96231b3b80d8
docs/CommandGuide/FileCheck.pod | patch | blob | history | |
utils/FileCheck/FileCheck.cpp | patch | blob | history |
index d3f640d64dcc766be0e62d0a4724850f0445dbdc..32516ad87b3ebf4b639d92135783d5c2661ec871 100644 (file)
the variables "REGISTER". The second line verifies that whatever is in REGISTER
occurs later in the file after an "andw". FileCheck variable references are
always contained in <tt>[[ ]]</tt> pairs, are named, and their names can be
-formed with the regex "<tt>[a-zA-Z][a-zA-Z0-9]*</tt>". If a colon follows the
+formed with the regex "<tt>[a-zA-Z_][a-zA-Z0-9_]*</tt>". If a colon follows the
name, then it is a definition of the variable, if not, it is a use.
FileCheck variables can be defined multiple times, and uses always get the
index b4d1f84859cef4bd3e1ef00494c4b5909ec6d372..2bd6197e1336d102899275f5dd93ffb596acfaec 100644 (file)
// Named RegEx matches. These are of two forms: [[foo:.*]] which matches .*
// (or some other regex) and assigns it to the FileCheck variable 'foo'. The
// second form is [[foo]] which is a reference to foo. The variable name
- // itself must be of the form "[a-zA-Z][0-9a-zA-Z]*", otherwise we reject
+ // itself must be of the form "[a-zA-Z_][0-9a-zA-Z_]*", otherwise we reject
// it. This is to catch some common errors.
if (PatternStr.size() >= 2 &&
PatternStr[0] == '[' && PatternStr[1] == '[') {
// Verify that the name is well formed.
for (unsigned i = 0, e = Name.size(); i != e; ++i)
- if ((Name[i] < 'a' || Name[i] > 'z') &&
+ if (Name[i] != '_' &&
+ (Name[i] < 'a' || Name[i] > 'z') &&
(Name[i] < 'A' || Name[i] > 'Z') &&
(Name[i] < '0' || Name[i] > '9')) {
SM.PrintMessage(SMLoc::getFromPointer(Name.data()+i),