Syntax Tests: Allow Negative-Pattern Testsing via "~" Operator/Modifier
Would it be possible to test for tokens not being a specific element, e.g. via the ~
operator:
printf("ASCII value = %d", ch); // a comment
// ^^^^^^^^^^^^ slc
//<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ~slc
... where in the second test line ~slc
is used to ensure that none of these tokens are being highlighted as comments.
This would be useful while working on new syntaxes, when many elements are still undefined and we therefore just need to test that certain tokens are not a given element (i.e. that there's not "spilling over" of an element capturing its neighbours).
The tricky part might be that, like in the above example, with negated test patterns the carets end up covering multiple different tokens (including whitespace), not just a single element.