# SyntaxInformation cannot reproduce syntax coloring of Block

Is there any way to have the same syntax coloring with SyntaxInformation that Block has?

SyntaxInformation[func] = {"ArgumentsPattern" -> {{__}, _},
"LocalVariables" -> {"Solve", {1, Infinity}}};
func[vars : {__}, body_] := {};


After evaluating the above definition, the following two lines have different coloring:

func[{parameter, variable, constant = 0}, parameter + variable + constant]

Block[{parameter, variable, constant = 0}, parameter + variable + constant]


As you can notice, any local variable with an initial value is not highlighted as local. I use the default syntax coloring, no changes were applied. SyntaxInformation accepts the following values: {"Table", "Solve", "Integrate", "Limit", "Plot", "Manipulate"} none of which produces the same behaviour as Block does. Perhaps someone knows about an undocumented option value?

• +1. I was wondering about the same thing, for my LetL. Did not find the answer yet. – Leonid Shifrin Dec 12 '13 at 14:58
• Maybe have a look at GetFEKernelInit.tr, which has a section called Syntax coloring and other syntax information. It's not very detail, but might provide some clues. – Silvia Dec 12 '13 at 19:23
• Somewhat related: What is ColorEqualSigns and how does one use it? – Emilio Pisanty Sep 17 '14 at 10:25
• @Gyebro Yes, you have to use HoldAll or similar. See for example Leonid's LetL here which is a scoping construct similar to With. – István Zachar Dec 1 '16 at 15:48
• FYI, I've asked WRI Support about that but no answer so far. – Kuba Dec 12 '16 at 12:36

• Is the same true for Compile and Function? – QuantumDot Jun 6 '17 at 20:25