|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | | -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
3 | 3 | <plist version="1.0"> |
4 | 4 | <dict> |
5 | 5 | <key>bundleUUID</key> |
|
16 | 16 | To make this your main Python language definition (in Sublime Text): |
17 | 17 | 1) Rename Packages/Python/Python.tmLanguage to something else with a different extension (like Python.tmLanguage.backup) |
18 | 18 | 2) Move this file and its README.md to Packages/Python/ |
19 | | - 3) Search for "<string>PythonImproved</string>" and change it to just say Python (if you want) - this is what is displayed in ST2's various menus |
| 19 | + 3) Search for "<string>PythonImproved</string>" and change it to just say Python (if you want) - this is what is displayed in ST2's various menus |
20 | 20 | 4) Rename this file to Python.tmLanguage (if you want) |
21 | 21 | Or (probably a better way): |
22 | 22 | 1) Open a .py file. |
|
428 | 428 | </dict> |
429 | 429 | </dict> |
430 | 430 | <key>end</key> |
431 | | - <string>(\))\s*(?:(\:)|(.*$\n?))</string> |
| 431 | + <string>(\:)</string> |
432 | 432 | <key>endCaptures</key> |
433 | 433 | <dict> |
434 | 434 | <key>1</key> |
435 | | - <dict> |
436 | | - <key>name</key> |
437 | | - <string>punctuation.definition.parameters.end.python</string> |
438 | | - </dict> |
439 | | - <key>2</key> |
440 | 435 | <dict> |
441 | 436 | <key>name</key> |
442 | 437 | <string>punctuation.section.function.begin.python</string> |
443 | 438 | </dict> |
444 | | - <key>3</key> |
445 | | - <dict> |
446 | | - <key>name</key> |
447 | | - <string>invalid.illegal.missing-section-begin.python</string> |
448 | | - </dict> |
449 | 439 | </dict> |
450 | 440 | <key>name</key> |
451 | 441 | <string>meta.function.python</string> |
|
480 | 470 | <key>contentName</key> |
481 | 471 | <string>meta.function.parameters.python</string> |
482 | 472 | <key>end</key> |
483 | | - <string>(?=\)\s*\:)</string> |
| 473 | + <string>(?=\)\s*(?:\:|-\>))</string> |
484 | 474 | <key>patterns</key> |
485 | 475 | <array> |
| 476 | + <dict> |
| 477 | + <key>include</key> |
| 478 | + <string>#annotated_arguments</string> |
| 479 | + </dict> |
486 | 480 | <dict> |
487 | 481 | <key>include</key> |
488 | 482 | <string>#keyword_arguments</string> |
|
510 | 504 | </dict> |
511 | 505 | </array> |
512 | 506 | </dict> |
| 507 | + <dict> |
| 508 | + <key>begin</key> |
| 509 | + <string>(\))\s*(\->)</string> |
| 510 | + <key>beginCaptures</key> |
| 511 | + <dict> |
| 512 | + <key>1</key> |
| 513 | + <dict> |
| 514 | + <key>name</key> |
| 515 | + <string>punctuation.definition.parameters.end.python</string> |
| 516 | + </dict> |
| 517 | + <key>2</key> |
| 518 | + <dict> |
| 519 | + <key>name</key> |
| 520 | + <string>punctuation.separator.annotation.result.python</string> |
| 521 | + </dict> |
| 522 | + </dict> |
| 523 | + <key>end</key> |
| 524 | + <string>(?=\:)</string> |
| 525 | + <key>patterns</key> |
| 526 | + <array> |
| 527 | + <dict> |
| 528 | + <key>include</key> |
| 529 | + <string>$self</string> |
| 530 | + </dict> |
| 531 | + </array> |
| 532 | + </dict> |
513 | 533 | </array> |
514 | 534 | </dict> |
515 | 535 | <dict> |
|
1204 | 1224 | </array> |
1205 | 1225 | <key>repository</key> |
1206 | 1226 | <dict> |
| 1227 | + <key>annotated_arguments</key> |
| 1228 | + <dict> |
| 1229 | + <key>begin</key> |
| 1230 | + <string>\b([a-zA-Z_][a-zA-Z_0-9]*)\s*(:)|(?=\()</string> |
| 1231 | + <key>beginCaptures</key> |
| 1232 | + <dict> |
| 1233 | + <key>1</key> |
| 1234 | + <dict> |
| 1235 | + <key>name</key> |
| 1236 | + <string>variable.parameter.function.python</string> |
| 1237 | + </dict> |
| 1238 | + <key>2</key> |
| 1239 | + <dict> |
| 1240 | + <key>name</key> |
| 1241 | + <string>punctuation.separator.annotation.python</string> |
| 1242 | + </dict> |
| 1243 | + </dict> |
| 1244 | + <key>end</key> |
| 1245 | + <string>\s*(?:(,)|(?=$\n?|[\)\:]))</string> |
| 1246 | + <key>endCaptures</key> |
| 1247 | + <dict> |
| 1248 | + <key>1</key> |
| 1249 | + <dict> |
| 1250 | + <key>name</key> |
| 1251 | + <string>punctuation.separator.parameters.python</string> |
| 1252 | + </dict> |
| 1253 | + </dict> |
| 1254 | + <key>patterns</key> |
| 1255 | + <array> |
| 1256 | + <dict> |
| 1257 | + <key>include</key> |
| 1258 | + <string>#annotated_group</string> |
| 1259 | + </dict> |
| 1260 | + <dict> |
| 1261 | + <key>match</key> |
| 1262 | + <string>=</string> |
| 1263 | + <key>name</key> |
| 1264 | + <string>keyword.operator.assignment.python</string> |
| 1265 | + </dict> |
| 1266 | + <dict> |
| 1267 | + <key>include</key> |
| 1268 | + <string>$self</string> |
| 1269 | + </dict> |
| 1270 | + </array> |
| 1271 | + </dict> |
| 1272 | + <key>annotated_group</key> |
| 1273 | + <dict> |
| 1274 | + <key>begin</key> |
| 1275 | + <string>(\()</string> |
| 1276 | + <key>beginCaptures</key> |
| 1277 | + <dict> |
| 1278 | + <key>1</key> |
| 1279 | + <dict> |
| 1280 | + <key>name</key> |
| 1281 | + <string>punctuation.definition.parameters-group.begin.python</string> |
| 1282 | + </dict> |
| 1283 | + </dict> |
| 1284 | + <key>end</key> |
| 1285 | + <string>(\))</string> |
| 1286 | + <key>endCaptures</key> |
| 1287 | + <dict> |
| 1288 | + <key>1</key> |
| 1289 | + <dict> |
| 1290 | + <key>name</key> |
| 1291 | + <string>punctuation.definition.parameters-group.end.python</string> |
| 1292 | + </dict> |
| 1293 | + </dict> |
| 1294 | + <key>patterns</key> |
| 1295 | + <array> |
| 1296 | + <dict> |
| 1297 | + <key>begin</key> |
| 1298 | + <string>\b([a-zA-Z_][a-zA-Z_0-9]*)\s*(:)</string> |
| 1299 | + <key>beginCaptures</key> |
| 1300 | + <dict> |
| 1301 | + <key>1</key> |
| 1302 | + <dict> |
| 1303 | + <key>name</key> |
| 1304 | + <string>variable.parameter.function.python</string> |
| 1305 | + </dict> |
| 1306 | + <key>2</key> |
| 1307 | + <dict> |
| 1308 | + <key>name</key> |
| 1309 | + <string>punctuation.separator.annotation.python</string> |
| 1310 | + </dict> |
| 1311 | + </dict> |
| 1312 | + <key>end</key> |
| 1313 | + <string>\s*(?:(,)|(?=$\n?|\)))</string> |
| 1314 | + <key>endCaptures</key> |
| 1315 | + <dict> |
| 1316 | + <key>1</key> |
| 1317 | + <dict> |
| 1318 | + <key>name</key> |
| 1319 | + <string>punctuation.separator.parameters.python</string> |
| 1320 | + </dict> |
| 1321 | + </dict> |
| 1322 | + <key>patterns</key> |
| 1323 | + <array> |
| 1324 | + <dict> |
| 1325 | + <key>include</key> |
| 1326 | + <string>$self</string> |
| 1327 | + </dict> |
| 1328 | + </array> |
| 1329 | + </dict> |
| 1330 | + <dict> |
| 1331 | + <key>begin</key> |
| 1332 | + <string>\b([a-zA-Z_][a-zA-Z_0-9]*)</string> |
| 1333 | + <key>beginCaptures</key> |
| 1334 | + <dict> |
| 1335 | + <key>1</key> |
| 1336 | + <dict> |
| 1337 | + <key>name</key> |
| 1338 | + <string>variable.parameter.function.python</string> |
| 1339 | + </dict> |
| 1340 | + </dict> |
| 1341 | + <key>end</key> |
| 1342 | + <string>\s*(?:(,)|(?=$\n?|\)))</string> |
| 1343 | + <key>endCaptures</key> |
| 1344 | + <dict> |
| 1345 | + <key>1</key> |
| 1346 | + <dict> |
| 1347 | + <key>name</key> |
| 1348 | + <string>punctuation.separator.parameters.python</string> |
| 1349 | + </dict> |
| 1350 | + </dict> |
| 1351 | + </dict> |
| 1352 | + <dict> |
| 1353 | + <key>include</key> |
| 1354 | + <string>#comments</string> |
| 1355 | + </dict> |
| 1356 | + </array> |
| 1357 | + </dict> |
1207 | 1358 | <key>builtin_exceptions</key> |
1208 | 1359 | <dict> |
1209 | 1360 | <key>match</key> |
|
0 commit comments