This answer is focussed at more experienced users, to provide a way for them to find out more information. I do not discuss how anything works.
Information in this answer corresponds to version 10.3
Despite the fact that PrintDefinitions@SyntaxInformation gives nothing, we can still see how the function works, by doing
<< GeneralUtilites`
PrintDefinitions@System`Utilities`GetSystemSyntaxInformation
System`Utilities`GetSystemSyntaxInformation is pretty much equivalent to SyntaxInformation.
From the definition of System`Utilities`GetSystemSyntaxInformation, we see that the full list of "options of SyntaxInformation" is
(*sio is short for SyntaxInformation options*)
sio = {"ArgumentsPattern", "OptionNames", "LocalVariables", "ColorEqualSigns"}
Of these options "OptionNames" is undocumented (see this answer for an example of use, credit to jkuczm)
The following procedure gives a list of basic template names
informationFile =
ToFileName[{$InstallationDirectory, "SystemFiles", "Kernel",
"TextResources", $Language}, "FunctionInformation.m"];
(*sife is short for System Information File Expression*)
sife = If[FileType[informationFile] === File,
Get[informationFile], {}];
templatesWithNames=
Select[
sife[[1,2]]
,
Length@#>3&&#[[4]]=!= None&
][[All,{1,4}]];
DeleteDuplicates@templatesWithNames[[All,2,1]]
{"Manipulate", "Solve", "Plot", "Table", "D", "Integrate", "Limit",
"SumSign", "IntegralSign"}
Of these, {"D", "IntegralSign", "SumSign"} do not appear in the docs.
I had forgotten about the "Lexical" modifier, but that is not undocumented, see the details section of the docs). Here are some examples of templates that involve it and also one that does not.
manipulateTemplates =
Select[templatesWithNames, #[[2, 1]] == "Manipulate" &]
{"Animate",{"Manipulate",{2,∞},"Lexical"}}
{"ControllerManipulate",{"Manipulate",{2,∞},"Lexical"}}
{"Manipulate",{"Manipulate",{2,∞},"Lexical"}}
{"RepeatingElement",{"Manipulate",{2}}}
Also this is weird
"ArgumentsPattern" /. SyntaxInformation@EmbedCode
{_, Optional["/Volumes/Jenkins/workspace/Documentation.Usage.English.release/scratch"],
_., OptionsPattern[]}
SyntaxInformationcan handle local variables. Big +1. – Leonid Shifrin Feb 07 '12 at 12:34"ArgumentsPattern", not"ArgumentPattern". – celtschk Feb 07 '12 at 13:09ArgumentsPatternto be honest I've never really understood theLocalVariablessyntax. I don't find the documentation very helpful. – Mike Honeychurch Feb 07 '12 at 21:52"ArgumentPattern"works just fine too on version 7. Does it fail in version 8? – Mr.Wizard Feb 07 '12 at 21:55Table[Table[i, {i, 5}], {i, 5}]andBlock[{i = 3}, Block[{i = 3}, i]]. There happens more parsing in Block/Module constructs than simple highlighting would be able to. – halirutan Feb 08 '12 at 19:52"ArgumentPattern"in Version 8 (at least in 8.0.0.0), but works with"ArgumentsPattern". – celtschk Apr 10 '12 at 16:35