Fix a bug in FileCheck that wouldn't let define variables as follows:
authorEli Bendersky <eliben@google.com>
Sun, 2 Dec 2012 16:02:41 +0000 (16:02 +0000)
committerEli Bendersky <eliben@google.com>
Sun, 2 Dec 2012 16:02:41 +0000 (16:02 +0000)
commit4db6511779e70780f7b36bb7ef54276752f5f640
treebef8603130686d76ac40a05ab83c69929b6aaf11
parente4693642444e8405a8f5812a3594372f7f108e9e
Fix a bug in FileCheck that wouldn't let define variables as follows:

; CHECK: [[VAR:[a-z]]]

The problem was that to find the end of the regex var definition, it was
simplistically looking for the next ]] and finding the incorrect one. A
better approach is to count nesting of brackets (taking escaping into
account). This way the brackets that are part of the regex can be discovered
and skipped properly, and the ]] ending is detected in the right place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169109 91177308-0d34-0410-b5e6-96231b3b80d8
test/FileCheck/regex-brackets.txt [new file with mode: 0644]
test/FileCheck/simple-var-capture.txt
utils/FileCheck/FileCheck.cpp