2 ms·
In my/the ideal world, clang would have some plugin feature where it knows that it must pass that string to some external DLL for validation. Ideally, that DLL
by Someone 15y ago
In my/the ideal world, clang would have some plugin feature where it knows that it must pass that string to some external DLL for validation. Ideally, that DLL should be able to generate code (just as the C preprocessor), but I fear that would require quite some interface between plug-ins and clang.
I think it already would be a big win if that DLL only could use the compiler state to issue error messages.
Open problem is how clang would know that a string needs external validation. I think a variant on the @"string" format might work:
id myConstraint = @layout"[button]-[textField]";
id myRegex = @regex"^[a-z]+$";
(I say might because the C++ grammar has some corners that may deliver surprises here; with (im)proper function overloading, the compiler might find a way to interpret @layout as taking the address of layout)
The link between prefix and DLL should be a command-line argument to clang. Problem, of course, is that you give up compatibility with other compilers. Also, this is more clunky than it needs to be; in a 'proper language' like Lisp the integration would be seamless.