Report captured variables in input dumps and traces. For example:
$ cat check CHECK: hello [[WHAT:[a-z]+]] CHECK: goodbye [[WHAT]] $ FileCheck -dump-input=always -vv check < input |& tail -8 <<<<<< 1: hello world check:1'0 ^~~~~~~~~~~ check:1'1 ^~~~~ captured var "WHAT" 2: goodbye world check:2'0 ^~~~~~~~~~~~~ check:2'1 with "WHAT" equal to "world" >>>>>> $ FileCheck -dump-input=never -vv check < input check2:1:8: remark: CHECK: expected string found in input CHECK: hello [[WHAT:[a-z]+]] ^ <stdin>:1:1: note: found here hello world ^~~~~~~~~~~ <stdin>:1:7: note: captured var "WHAT" hello world ^~~~~ check2:2:8: remark: CHECK: expected string found in input CHECK: goodbye [[WHAT]] ^ <stdin>:2:1: note: found here goodbye world ^~~~~~~~~~~~~ <stdin>:2:1: note: with "WHAT" equal to "world" goodbye world ^
I think I'd prefer this as a new field in NumericVariable. ExpressionValue is really an abstraction for signed/unsigned variable. It's used for all intermediate result of evaluating the AST of an expression and for all of those the StrValue means nothing and is of no interest. I realize the size penalty is small, it bothers me more on a conceptual level.
Does that make sense?