I've found that
is highlighted like this:
where y,Y=yellow, r=red, E=error. (BTW, the construction is valid,
control sequence is expanded before writing label to the .aux file.)
There is another problem with new environment definitions. TeX
allows to do something like this:
There is probably other way of switching to the math mode, but it does not
matter now. The closing brace of the beginning sequence of new environment
is highlighted as error, so is the closing brace of the ending sequence.
And, after all, any text (blahblahblah) following this definition is
highlighted as if in the math mode.