|
4 | 4 | <!-- Localization/scoping constructs --> |
5 | 5 | <template name="blk" description="Block[{vars}, body]" toReformat="true" |
6 | 6 | value="Block[{$VARS$}, $SELECTION$$END$]"> |
7 | | - <variable name="VARS" expression="" defaultValue=""vars"" alwaysStopAt="true" /> |
| 7 | + <variable name="VARS" expression="" defaultValue=""vars"" alwaysStopAt="true"/> |
8 | 8 | <context> |
9 | 9 | <option name="Mathematica" value="true"/> |
10 | 10 | </context> |
11 | 11 | </template> |
12 | 12 |
|
13 | 13 | <template name="mdl" description="Module[{vars}, body]" toReformat="true" |
14 | 14 | value="Module[{$VARS$}, $SELECTION$$END$]"> |
15 | | - <variable name="VARS" expression="" defaultValue=""vars"" alwaysStopAt="true" /> |
| 15 | + <variable name="VARS" expression="" defaultValue=""vars"" alwaysStopAt="true"/> |
16 | 16 | <context> |
17 | 17 | <option name="Mathematica" value="true"/> |
18 | 18 | </context> |
19 | 19 | </template> |
20 | 20 |
|
21 | 21 | <template name="wth" description="With[{vars}, body]" toReformat="true" |
22 | 22 | value="With[{$VARS$}, $SELECTION$$END$]"> |
23 | | - <variable name="VARS" expression="" defaultValue=""vars"" alwaysStopAt="true" /> |
24 | | - <variable name="SELECTION" expression="" defaultValue=""body"" alwaysStopAt="true" /> |
| 23 | + <variable name="VARS" expression="" defaultValue=""vars"" alwaysStopAt="true"/> |
| 24 | + <variable name="SELECTION" expression="" defaultValue=""body"" alwaysStopAt="true"/> |
25 | 25 | <context> |
26 | 26 | <option name="Mathematica" value="true"/> |
27 | 27 | </context> |
28 | 28 | </template> |
29 | 29 |
|
30 | | - <template name="cmpl" description="Compile[{vars}, body]" toReformat="true" |
31 | | - value="Compile[{$VARS$}, $SELECTION$$END$]"> |
32 | | - <variable name="VARS" expression="" defaultValue=""{x, _Real}"" alwaysStopAt="true" /> |
33 | | - <context> |
34 | | - <option name="Mathematica" value="true"/> |
35 | | - </context> |
36 | | - </template> |
| 30 | + <template name="cmpl" description="Compile[{vars}, body]" toReformat="true" |
| 31 | + value="Compile[{$VARS$}, $SELECTION$$END$]"> |
| 32 | + <variable name="VARS" expression="" defaultValue=""{x, _Real}"" alwaysStopAt="true"/> |
| 33 | + <context> |
| 34 | + <option name="Mathematica" value="true"/> |
| 35 | + </context> |
| 36 | + </template> |
37 | 37 |
|
38 | | - <template name="fnct" description="Function[{vars}, body]" toReformat="true" |
39 | | - value="Function[{$VARS$}, $SELECTION$$END$]"> |
40 | | - <variable name="VARS" expression="" defaultValue=""var"" alwaysStopAt="true" /> |
41 | | - <context> |
42 | | - <option name="Mathematica" value="true"/> |
43 | | - </context> |
44 | | - </template> |
| 38 | + <template name="fnct" description="Function[{vars}, body]" toReformat="true" |
| 39 | + value="Function[{$VARS$}, $SELECTION$$END$]"> |
| 40 | + <variable name="VARS" expression="" defaultValue=""var"" alwaysStopAt="true"/> |
| 41 | + <context> |
| 42 | + <option name="Mathematica" value="true"/> |
| 43 | + </context> |
| 44 | + </template> |
45 | 45 |
|
46 | 46 |
|
47 | | - <!-- Iteration --> |
| 47 | + <!-- Iteration --> |
48 | 48 | <template name="do" description="Do[body, {iter}]" toReformat="true" |
49 | 49 | value="Do[$SELECTION$$END$, {$ITER$}]"> |
50 | | - <variable name="ITER" expression="" defaultValue=""iter"" alwaysStopAt="true" /> |
| 50 | + <variable name="ITER" expression="" defaultValue=""iter"" alwaysStopAt="true"/> |
51 | 51 | <context> |
52 | 52 | <option name="Mathematica" value="true"/> |
53 | 53 | </context> |
54 | 54 | </template> |
55 | 55 |
|
56 | 56 | <template name="for" description="For[start, test, inc, body]" toReformat="true" |
57 | 57 | value="For[$VAR$ = 0, $VAR$ < $MAX$, $VAR$++, $SELECTION$$END$]"> |
58 | | - <variable name="VAR" expression="" defaultValue=""i"" alwaysStopAt="true" /> |
59 | | - <variable name="MAX" expression="" defaultValue=""max"" alwaysStopAt="true" /> |
| 58 | + <variable name="VAR" expression="" defaultValue=""i"" alwaysStopAt="true"/> |
| 59 | + <variable name="MAX" expression="" defaultValue=""max"" alwaysStopAt="true"/> |
60 | 60 | <context> |
61 | 61 | <option name="Mathematica" value="true"/> |
62 | 62 | </context> |
63 | 63 | </template> |
64 | 64 |
|
65 | 65 | <template name="tbl" description="Table[body, {var, min, max}]" toReformat="true" |
66 | 66 | value="Table[$SELECTION$$END$, {$VAR$, $LIMITS$}]"> |
67 | | - <variable name="VAR" expression="" defaultValue=""x"" alwaysStopAt="true" /> |
68 | | - <variable name="LIMITS" expression="" defaultValue=""min, max, stepSize"" alwaysStopAt="true" /> |
| 67 | + <variable name="VAR" expression="" defaultValue=""x"" alwaysStopAt="true"/> |
| 68 | + <variable name="LIMITS" expression="" defaultValue=""min, max, stepSize"" alwaysStopAt="true"/> |
69 | 69 | <context> |
70 | 70 | <option name="Mathematica" value="true"/> |
71 | 71 | </context> |
72 | 72 | </template> |
73 | 73 |
|
74 | 74 | <template name="fld" description="Fold[func, firstElement, list]" toReformat="true" |
75 | 75 | value="Fold[$SELECTION$$END$, $FIRST$, $LIST$]"> |
76 | | - <variable name="FIRST" expression="" defaultValue=""x"" alwaysStopAt="true" /> |
77 | | - <variable name="LIST" expression="" defaultValue=""list"" alwaysStopAt="true" /> |
| 76 | + <variable name="FIRST" expression="" defaultValue=""x"" alwaysStopAt="true"/> |
| 77 | + <variable name="LIST" expression="" defaultValue=""list"" alwaysStopAt="true"/> |
78 | 78 | <context> |
79 | 79 | <option name="Mathematica" value="true"/> |
80 | 80 | </context> |
81 | 81 | </template> |
82 | 82 |
|
83 | 83 | <template name="nst" description="Nest[func, expr, n]" toReformat="true" |
84 | 84 | value="Nest[$FUNC$, $EXPR$, $COUNT$]$END$"> |
85 | | - <variable name="FUNC" expression="" defaultValue=""func"" alwaysStopAt="true" /> |
86 | | - <variable name="EXPR" expression="" defaultValue=""expr"" alwaysStopAt="true" /> |
87 | | - <variable name="COUNT" expression="" defaultValue=""n"" alwaysStopAt="true" /> |
| 85 | + <variable name="FUNC" expression="" defaultValue=""func"" alwaysStopAt="true"/> |
| 86 | + <variable name="EXPR" expression="" defaultValue=""expr"" alwaysStopAt="true"/> |
| 87 | + <variable name="COUNT" expression="" defaultValue=""n"" alwaysStopAt="true"/> |
88 | 88 | <context> |
89 | 89 | <option name="Mathematica" value="true"/> |
90 | 90 | </context> |
|
93 | 93 | <!-- Control Flow --> |
94 | 94 | <template name="if" description="If[cond, then]" toReformat="true" |
95 | 95 | value="If[$COND$, $SELECTION$$END$]"> |
96 | | - <variable name="COND" expression="" defaultValue=""cond"" alwaysStopAt="true" /> |
| 96 | + <variable name="COND" expression="" defaultValue=""cond"" alwaysStopAt="true"/> |
97 | 97 | <context> |
98 | 98 | <option name="Mathematica" value="true"/> |
99 | 99 | </context> |
100 | 100 | </template> |
101 | 101 |
|
102 | 102 | <template name="ife" description="If[cond, then, else]" toReformat="true" |
103 | 103 | value="If[$COND$, $THEN$, $ELSE$]$END$"> |
104 | | - <variable name="COND" expression="" defaultValue=""cond"" alwaysStopAt="true" /> |
105 | | - <variable name="THEN" expression="" defaultValue=""then"" alwaysStopAt="true" /> |
106 | | - <variable name="ELSE" expression="" defaultValue=""else"" alwaysStopAt="true" /> |
| 104 | + <variable name="COND" expression="" defaultValue=""cond"" alwaysStopAt="true"/> |
| 105 | + <variable name="THEN" expression="" defaultValue=""then"" alwaysStopAt="true"/> |
| 106 | + <variable name="ELSE" expression="" defaultValue=""else"" alwaysStopAt="true"/> |
107 | 107 | <context> |
108 | 108 | <option name="Mathematica" value="true"/> |
109 | 109 | </context> |
110 | 110 | </template> |
111 | 111 |
|
112 | 112 | <template name="swtch" description="Switch[expr, form1, value1, form2, value2]" toReformat="true" |
113 | 113 | value="Switch[$EXPR$, $FORM1$, $VAL1$, $FORM2$, $VAL2$$MORE_ARGS$]$END$"> |
114 | | - <variable name="EXPR" expression="" defaultValue=""expr"" alwaysStopAt="true" /> |
115 | | - <variable name="FORM1" expression="" defaultValue=""form1"" alwaysStopAt="true" /> |
116 | | - <variable name="VAL1" expression="" defaultValue=""value1"" alwaysStopAt="true" /> |
117 | | - <variable name="FORM2" expression="" defaultValue=""form2"" alwaysStopAt="true" /> |
118 | | - <variable name="VAL2" expression="" defaultValue=""value2"" alwaysStopAt="true" /> |
119 | | - <variable name="MORE_ARGS" expression="" defaultValue="" alwaysStopAt="true" /> |
| 114 | + <variable name="EXPR" expression="" defaultValue=""expr"" alwaysStopAt="true"/> |
| 115 | + <variable name="FORM1" expression="" defaultValue=""form1"" alwaysStopAt="true"/> |
| 116 | + <variable name="VAL1" expression="" defaultValue=""value1"" alwaysStopAt="true"/> |
| 117 | + <variable name="FORM2" expression="" defaultValue=""form2"" alwaysStopAt="true"/> |
| 118 | + <variable name="VAL2" expression="" defaultValue=""value2"" alwaysStopAt="true"/> |
| 119 | + <variable name="MORE_ARGS" expression="" defaultValue="" alwaysStopAt="true"/> |
120 | 120 | <context> |
121 | 121 | <option name="Mathematica" value="true"/> |
122 | 122 | </context> |
123 | 123 | </template> |
124 | 124 |
|
125 | 125 | <template name="whch" description="Which[test1, value1, test2, value2]" toReformat="true" |
126 | 126 | value="Which[$BODY$$END$]"> |
127 | | - <variable name="BODY" expression="" defaultValue=""test1, val1, test2, val2"" alwaysStopAt="true" /> |
| 127 | + <variable name="BODY" expression="" defaultValue=""test1, val1, test2, val2"" alwaysStopAt="true"/> |
128 | 128 | <context> |
129 | 129 | <option name="Mathematica" value="true"/> |
130 | 130 | </context> |
131 | 131 | </template> |
132 | 132 |
|
133 | 133 | <template name="chck" description="Check[expr, fail, msg]" toReformat="true" |
134 | 134 | value="Check[$EXPR$, $FAIL$, $MSG$]$END$"> |
135 | | - <variable name="EXPR" expression="" defaultValue=""expr"" alwaysStopAt="true" /> |
136 | | - <variable name="FAIL" expression="" defaultValue=""fail"" alwaysStopAt="true" /> |
137 | | - <variable name="MSG" expression="" defaultValue=""symbol::msg"" alwaysStopAt="true" /> |
| 135 | + <variable name="EXPR" expression="" defaultValue=""expr"" alwaysStopAt="true"/> |
| 136 | + <variable name="FAIL" expression="" defaultValue=""fail"" alwaysStopAt="true"/> |
| 137 | + <variable name="MSG" expression="" defaultValue=""symbol::msg"" alwaysStopAt="true"/> |
138 | 138 | <context> |
139 | 139 | <option name="Mathematica" value="true"/> |
140 | 140 | </context> |
|
143 | 143 | <!-- Function calls --> |
144 | 144 | <template name="pre" description="Prefix selection with f@" toReformat="true" |
145 | 145 | value="$SYM$@($SELECTION$)$END$"> |
146 | | - <variable name="SYM" expression="" defaultValue="" alwaysStopAt="true" /> |
| 146 | + <variable name="SYM" expression="" defaultValue="" alwaysStopAt="true"/> |
147 | 147 | <context> |
148 | 148 | <option name="Mathematica" value="true"/> |
149 | 149 | </context> |
150 | 150 | </template> |
151 | 151 |
|
152 | 152 | <template name="pst" description="Postfix selection with //f" toReformat="true" |
153 | 153 | value="($SELECTION$ // $SYM$)$END$"> |
154 | | - <variable name="SYM" expression="" defaultValue="" alwaysStopAt="true" /> |
| 154 | + <variable name="SYM" expression="" defaultValue="" alwaysStopAt="true"/> |
155 | 155 | <context> |
156 | 156 | <option name="Mathematica" value="true"/> |
157 | 157 | </context> |
|
170 | 170 | <!-- Messages --> |
171 | 171 | <template name="usg" description="Create usage message" toReformat="true" |
172 | 172 | value="$SYM$::usage = "$SYM$[$END$]";"> |
173 | | - <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true" /> |
| 173 | + <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true"/> |
| 174 | + <context> |
| 175 | + <option name="Mathematica" value="true"/> |
| 176 | + </context> |
| 177 | + </template> |
| 178 | + |
| 179 | + <template name="opt" description="Create options for a symbol" toReformat="true" |
| 180 | + value="Options[$SYM$] = { $LHS$ -> $END$}"> |
| 181 | + <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true"/> |
| 182 | + <variable name="LHS" expression="" defaultValue=""optionName"" alwaysStopAt="true"/> |
| 183 | + <variable name="END" expression="" defaultValue=""Automatic"" alwaysStopAt="true"/> |
| 184 | + <context> |
| 185 | + <option name="Mathematica" value="true"/> |
| 186 | + </context> |
| 187 | + </template> |
| 188 | + |
| 189 | + <template name="att" description="Create attributes for a symbol" toReformat="true" |
| 190 | + value="Attributes[$SYM$] = { $END$}"> |
| 191 | + <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true"/> |
| 192 | + <variable name="END" expression="" defaultValue=""Flat, HoldAll, Listable, NumericFunction"" alwaysStopAt="true"/> |
174 | 193 | <context> |
175 | 194 | <option name="Mathematica" value="true"/> |
176 | 195 | </context> |
177 | 196 | </template> |
178 | 197 |
|
179 | | - <template name="opt" description="Create options for a symbol" toReformat="true" |
180 | | - value="Options[$SYM$] = { $LHS$ -> $END$}"> |
181 | | - <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true" /> |
182 | | - <variable name="LHS" expression="" defaultValue=""optionName"" alwaysStopAt="true" /> |
183 | | - <variable name="END" expression="" defaultValue=""Automatic"" alwaysStopAt="true" /> |
184 | | - <context> |
185 | | - <option name="Mathematica" value="true"/> |
186 | | - </context> |
187 | | - </template> |
188 | 198 |
|
189 | 199 | <template name="msg" description="Create usage message" toReformat="true" |
190 | 200 | value="$SYM$::$TAG$ = "$END$";"> |
191 | | - <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true" /> |
192 | | - <variable name="TAG" expression="" defaultValue=""tag"" alwaysStopAt="true" /> |
| 201 | + <variable name="SYM" expression="" defaultValue=""sym"" alwaysStopAt="true"/> |
| 202 | + <variable name="TAG" expression="" defaultValue=""tag"" alwaysStopAt="true"/> |
193 | 203 | <context> |
194 | 204 | <option name="Mathematica" value="true"/> |
195 | 205 | </context> |
|
0 commit comments