mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Allow '_' in FileCheck variable names, it is nice to have at least one
separate character. - Chris, OK? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -140,7 +140,7 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) {
|
||||
// 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] == '[') {
|
||||
@ -167,7 +167,8 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) {
|
||||
|
||||
// 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),
|
||||
|
Reference in New Issue
Block a user