[PATCH] Allow regexes in all verifier directives: drop the expected-(error|warning|note)-re, variants

Hans Wennborg hans at chromium.org
Thu Dec 12 09:28:16 PST 2013


On Wed, Dec 11, 2013 at 11:05 PM, Alp Toker <alp at nuanti.com> wrote:
> This is a good idea, but I'd really like to see your new regex blocks use a
> character other than curly braces.
>
> The problem is that {{}} for regular expressions conflicts visually and
> syntactically with the outer {{}} in a way that makes it quite difficult to
> see what's going on.

Yes, I agree it's a bit ugly when the regex braces collide with the
braces enclosing the verifier directive. However, I think the benefit
of having the same syntax for regexes that FileCheck uses outweighs
this.

> A secondary concern is that it looks a bit like FileCheck syntax but in fact
> works on a different level with different inputs and outputs is rather
> confusing.

It was intentional that they resemble the FileCheck syntax. I don't
want to move away from that - if anything, it would be cool if they
were more similar and shared more code for their implementation.

> It's instantly recognisable and has a regular grammar that enables code
> editors do syntax highlighting, regex completion etc.

I'm not fussed about having editors syntax highlight and complete
these. They're not that common, and I'd expect the editor to
syntax-highlight the entire verifier directive as a comment anyway.

 - Hans



More information about the cfe-commits mailing list