|
1184 | 1184 | <key>patterns</key>
|
1185 | 1185 | <array>
|
1186 | 1186 | <dict>
|
1187 |
| - <key>comment</key> |
1188 |
| - <string>default: only in switch</string> |
1189 |
| - <key>match</key> |
1190 |
| - <string>(?i:default)(?![^\s{(,;&|)}])</string> |
| 1187 | + <key>begin</key> |
| 1188 | + <string>\G(?![;&|)}])|(?<=\})</string> |
| 1189 | + <key>end</key> |
| 1190 | + <string>(?=.|$)</string> |
| 1191 | + <key>applyEndPatternLast</key> |
| 1192 | + <true/> |
| 1193 | + <key>name</key> |
| 1194 | + <string>meta.argument.switch-condition.powershell</string> |
| 1195 | + <key>patterns</key> |
| 1196 | + <array> |
| 1197 | + <dict> |
| 1198 | + <key>begin</key> |
| 1199 | + <string>(?<=[\s]|\G)(?![\s#;&|)}]|<#|$)</string> |
| 1200 | + <key>end</key> |
| 1201 | + <string>(?!\G)</string> |
| 1202 | + <key>patterns</key> |
| 1203 | + <array> |
| 1204 | + <dict> |
| 1205 | + <key>comment</key> |
| 1206 | + <string>default: only in switch</string> |
| 1207 | + <key>match</key> |
| 1208 | + <string>(?i:default)(?![^\s{(,;&|)}])</string> |
| 1209 | + <key>name</key> |
| 1210 | + <string>keyword.control.$0.powershell</string> |
| 1211 | + </dict> |
| 1212 | + <dict> |
| 1213 | + <key>include</key> |
| 1214 | + <string>#argument</string> |
| 1215 | + </dict> |
| 1216 | + </array> |
| 1217 | + </dict> |
| 1218 | + <dict> |
| 1219 | + <key>include</key> |
| 1220 | + <string>#advanceToToken</string> |
| 1221 | + </dict> |
| 1222 | + </array> |
| 1223 | + </dict> |
| 1224 | + <dict> |
| 1225 | + <key>begin</key> |
| 1226 | + <string>{</string> |
| 1227 | + <key>beginCaptures</key> |
| 1228 | + <dict> |
| 1229 | + <key>0</key> |
| 1230 | + <dict> |
| 1231 | + <key>name</key> |
| 1232 | + <string>punctuation.section.braces.begin.powershell</string> |
| 1233 | + </dict> |
| 1234 | + </dict> |
| 1235 | + <key>end</key> |
| 1236 | + <string>}</string> |
| 1237 | + <key>endCaptures</key> |
| 1238 | + <dict> |
| 1239 | + <key>0</key> |
| 1240 | + <dict> |
| 1241 | + <key>name</key> |
| 1242 | + <string>punctuation.section.braces.end.powershell</string> |
| 1243 | + </dict> |
| 1244 | + </dict> |
1191 | 1245 | <key>name</key>
|
1192 |
| - <string>keyword.control.$0.powershell</string> |
| 1246 | + <string>meta.statements.switch-condition.powershell</string> |
| 1247 | + <key>patterns</key> |
| 1248 | + <array> |
| 1249 | + <dict> |
| 1250 | + <key>include</key> |
| 1251 | + <string>$self</string> |
| 1252 | + </dict> |
| 1253 | + </array> |
1193 | 1254 | </dict>
|
1194 | 1255 | <dict>
|
1195 | 1256 | <key>include</key>
|
1196 |
| - <string>$self</string> |
| 1257 | + <string>#notCode</string> |
1197 | 1258 | </dict>
|
1198 | 1259 | </array>
|
1199 | 1260 | </dict>
|
|
1203 | 1264 | <key>begin</key>
|
1204 | 1265 | <string>\G(?=[\s#\x{2013}-\x{2015}-]|<#)</string>
|
1205 | 1266 | <key>end</key>
|
1206 |
| - <string>(?=[^\s#\x{2013}-\x{2015}-]|<#)</string> |
| 1267 | + <string>(?![\s#\x{2013}-\x{2015}-]|<#)</string> |
1207 | 1268 | <key>patterns</key>
|
1208 | 1269 | <array>
|
1209 | 1270 | <dict>
|
1210 | 1271 | <key>match</key>
|
1211 | 1272 | <string>(?i:[\x{2013}-\x{2015}-](regex|wildcard|exact|casesensitive))</string>
|
1212 | 1273 | <key>name</key>
|
1213 |
| - <string>entity.name.parameter.powershell</string> |
| 1274 | + <string>entity.name.parameter.switch-$0.powershell</string> |
1214 | 1275 | </dict>
|
1215 | 1276 | <dict>
|
1216 | 1277 | <key>comment</key>
|
1217 | 1278 | <string>-file is special case, needs file argument, no condition expression</string>
|
1218 | 1279 | <key>begin</key>
|
1219 |
| - <string>(?i:[\x{2013}-\x{2015}-]file)</string> |
| 1280 | + <string>((?i:[\x{2013}-\x{2015}-]file))(:)?</string> |
1220 | 1281 | <key>beginCaptures</key>
|
1221 | 1282 | <dict>
|
1222 |
| - <key>0</key> |
| 1283 | + <key>1</key> |
| 1284 | + <dict> |
| 1285 | + <key>name</key> |
| 1286 | + <string>entity.name.parameter.switch-file.powershell</string> |
| 1287 | + </dict> |
| 1288 | + <key>2</key> |
1223 | 1289 | <dict>
|
1224 | 1290 | <key>name</key>
|
1225 |
| - <string>entity.name.parameter.powershell</string> |
| 1291 | + <string>punctuation.separator.parameter-value.powershell</string> |
1226 | 1292 | </dict>
|
1227 | 1293 | </dict>
|
1228 | 1294 | <key>end</key>
|
|
1233 | 1299 | <array>
|
1234 | 1300 | <dict>
|
1235 | 1301 | <key>begin</key>
|
1236 |
| - <string>\G(?![{(;&|)}])</string> |
| 1302 | + <string>\G(?![;&|)}])</string> |
1237 | 1303 | <key>end</key>
|
1238 | 1304 | <string>(?=.|$)</string>
|
1239 | 1305 | <key>applyEndPatternLast</key>
|
1240 | 1306 | <true/>
|
| 1307 | + <key>name</key> |
| 1308 | + <string>meta.argument.switch-file.powershell</string> |
1241 | 1309 | <key>patterns</key>
|
1242 | 1310 | <array>
|
1243 | 1311 | <dict>
|
1244 |
| - <key>include</key> |
1245 |
| - <string>#argument</string> |
| 1312 | + <key>begin</key> |
| 1313 | + <string>(?<=[\s]|\G)(?![\s#;&|)}]|<#|$)</string> |
| 1314 | + <key>end</key> |
| 1315 | + <string>(?!\G)</string> |
| 1316 | + <key>patterns</key> |
| 1317 | + <array> |
| 1318 | + <dict> |
| 1319 | + <key>include</key> |
| 1320 | + <string>#argument</string> |
| 1321 | + </dict> |
| 1322 | + </array> |
1246 | 1323 | </dict>
|
1247 | 1324 | <dict>
|
1248 | 1325 | <key>include</key>
|
|
2373 | 2450 | <key>begin</key>
|
2374 | 2451 | <string>(?=\$\()</string>
|
2375 | 2452 | <key>end</key>
|
2376 |
| - <string>(?!.\G)</string> |
| 2453 | + <string>(?=.|$)</string> |
2377 | 2454 | <key>applyEndPatternLast</key>
|
2378 | 2455 | <true/>
|
2379 | 2456 | <key>patterns</key>
|
|
2750 | 2827 | <key>begin</key>
|
2751 | 2828 | <string>(?={)</string>
|
2752 | 2829 | <key>end</key>
|
2753 |
| - <string>(?!.\G)</string> |
| 2830 | + <string>(?=.|$)</string> |
2754 | 2831 | <key>applyEndPatternLast</key>
|
2755 | 2832 | <true/>
|
2756 | 2833 | <key>patterns</key>
|
|
2810 | 2887 | <key>begin</key>
|
2811 | 2888 | <string>(?=\[)</string>
|
2812 | 2889 | <key>end</key>
|
2813 |
| - <string>(?!\G)</string> |
| 2890 | + <string>(?=.|$)</string> |
2814 | 2891 | <key>applyEndPatternLast</key>
|
2815 | 2892 | <true/>
|
2816 | 2893 | <key>patterns</key>
|
|
3120 | 3197 | <key>begin</key>
|
3121 | 3198 | <string>\G(?=\[)</string>
|
3122 | 3199 | <key>end</key>
|
3123 |
| - <string>(?!\G)</string> |
| 3200 | + <string>(?=.|$)</string> |
3124 | 3201 | <key>applyEndPatternLast</key>
|
3125 | 3202 | <true/>
|
3126 | 3203 | <key>patterns</key>
|
|
3211 | 3288 | <key>begin</key>
|
3212 | 3289 | <string>\G(?=\()</string>
|
3213 | 3290 | <key>end</key>
|
3214 |
| - <string>(?!\G)</string> |
| 3291 | + <string>(?=.|$)</string> |
3215 | 3292 | <key>applyEndPatternLast</key>
|
3216 | 3293 | <true/>
|
3217 | 3294 | <key>patterns</key>
|
|
4653 | 4730 | <key>comment</key>
|
4654 | 4731 | <string>when nothing else matches in usual tokenizing, consume it to prevent other patterns from striking in the middle of what might be a command name.</string>
|
4655 | 4732 | <key>begin</key>
|
4656 |
| - <string>(?=[^\s\[(){},;&|])</string> |
| 4733 | + <string>(?=[^\[\s{(,;&|)}])</string> |
4657 | 4734 | <key>alternateBegin</key>
|
4658 | 4735 | <string>(?=[^\x{2018}-\x{201B}"\x{201C}-\x{201E}\s\[(){},;&|$@])|(?<=\S)(?=[$@<>])</string>
|
4659 | 4736 | <key>end</key>
|
|
0 commit comments