Suppose we defined a pattern with custom pattern name provided by user, like
Quiet[myCustomPattern@terms_ := f[terms : (_[_, _])..]]
for use in further definitions:
myTransform@myCustomPattern@localNameForTerms := Reverse /@ {localNameForTerms}
However, in definitions like this one, localNameForTerms
is not by default highlighted the way it would be in case of appearing in explicit Pattern expression. Is it possible to Style it as a properly localized symbol, by putting
myCustomPattern -> Composition[myCustomPattern, Style[#, Darker@Darker@Green, Italic] &]
somewhere in the low-level notebook representation rules, for example?
Function[, #^2, {Listable}]
are coloured incorrectly. Does this mean I shouldn't use them to circumvent bugs in the highlighter? $\endgroup$Module
code does not exactly match the formModule[{..},..]
the highlighting will go wrong. Most basic example is(Module)[{x,y},x+y]
. From knowing this, you can create your own crazy examples. Unfortunately, some of the crazy highlighter-breakers are not crazy at all, but are used very often. Think for instance about aTable
, where the iterators don't have the exact form of{i,..}
but were created like this.. $\endgroup$