|
116 | 116 | </dict> |
117 | 117 | </dict> |
118 | 118 | <key>end</key> |
119 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 119 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
120 | 120 | <key>endCaptures</key> |
121 | 121 | <dict> |
122 | | - <key>0</key> |
| 122 | + <key>1</key> |
| 123 | + <dict> |
| 124 | + <key>name</key> |
| 125 | + <string>keyword.control.end.ruby</string> |
| 126 | + </dict> |
| 127 | + <key>2</key> |
123 | 128 | <dict> |
124 | 129 | <key>name</key> |
125 | 130 | <string>keyword.control.class.end.ruby</string> |
|
228 | 233 | </dict> |
229 | 234 | </dict> |
230 | 235 | <key>end</key> |
231 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 236 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
232 | 237 | <key>endCaptures</key> |
233 | 238 | <dict> |
234 | | - <key>0</key> |
| 239 | + <key>1</key> |
| 240 | + <dict> |
| 241 | + <key>name</key> |
| 242 | + <string>keyword.control.end.ruby</string> |
| 243 | + </dict> |
| 244 | + <key>2</key> |
235 | 245 | <dict> |
236 | 246 | <key>name</key> |
237 | 247 | <string>keyword.control.module.end.ruby</string> |
|
341 | 351 | </dict> |
342 | 352 | </dict> |
343 | 353 | <key>end</key> |
344 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 354 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
345 | 355 | <key>endCaptures</key> |
346 | 356 | <dict> |
347 | | - <key>0</key> |
| 357 | + <key>1</key> |
| 358 | + <dict> |
| 359 | + <key>name</key> |
| 360 | + <string>keyword.control.end.ruby</string> |
| 361 | + </dict> |
| 362 | + <key>2</key> |
348 | 363 | <dict> |
349 | 364 | <key>name</key> |
350 | 365 | <string>keyword.control.for.end.ruby</string> |
|
421 | 436 | </dict> |
422 | 437 | </dict> |
423 | 438 | <key>end</key> |
424 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 439 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
425 | 440 | <key>endCaptures</key> |
426 | 441 | <dict> |
427 | | - <key>0</key> |
| 442 | + <key>1</key> |
| 443 | + <dict> |
| 444 | + <key>name</key> |
| 445 | + <string>keyword.control.end.ruby</string> |
| 446 | + </dict> |
| 447 | + <key>2</key> |
428 | 448 | <dict> |
429 | 449 | <key>name</key> |
430 | 450 | <string>keyword.control.do.end.ruby</string> |
|
452 | 472 | </dict> |
453 | 473 | </dict> |
454 | 474 | <key>end</key> |
455 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 475 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
456 | 476 | <key>endCaptures</key> |
457 | 477 | <dict> |
458 | | - <key>0</key> |
| 478 | + <key>1</key> |
| 479 | + <dict> |
| 480 | + <key>name</key> |
| 481 | + <string>keyword.control.end.ruby</string> |
| 482 | + </dict> |
| 483 | + <key>2</key> |
459 | 484 | <dict> |
460 | 485 | <key>name</key> |
461 | 486 | <string>keyword.control.begin.end.ruby</string> |
|
483 | 508 | </dict> |
484 | 509 | </dict> |
485 | 510 | <key>end</key> |
486 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 511 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
487 | 512 | <key>endCaptures</key> |
488 | 513 | <dict> |
489 | | - <key>0</key> |
| 514 | + <key>1</key> |
| 515 | + <dict> |
| 516 | + <key>name</key> |
| 517 | + <string>keyword.control.end.ruby</string> |
| 518 | + </dict> |
| 519 | + <key>2</key> |
490 | 520 | <dict> |
491 | 521 | <key>name</key> |
492 | 522 | <string>keyword.control.conditional.case.end.ruby</string> |
|
615 | 645 | </dict> |
616 | 646 | <key>match</key> |
617 | 647 | <string>(?x) |
| 648 | + (?=if\b|unless\b) |
618 | 649 | (?<=[}\])\w?!"'`]) |
619 | 650 | (?<!\Wif|^if| # \WX|^X is equivalent to \bX |
620 | 651 | \Wunless|^unless| # this is workaround for code editors which doesn't support onigomo |
|
636 | 667 | <dict> |
637 | 668 | <key>begin</key> |
638 | 669 | <string>(?x) |
| 670 | + (?=if\b) |
639 | 671 | (?<!::) |
640 | 672 | (?<=<|&|\||=|>|~|\^|[+\-*/%]|\.{2}|\.{3}|^|;|:|\[|\(|\{|,| |
641 | 673 | \Wif|^if| # \WX|^X is equivalent to \bX |
|
663 | 695 | </dict> |
664 | 696 | </dict> |
665 | 697 | <key>end</key> |
666 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 698 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
667 | 699 | <key>endCaptures</key> |
668 | 700 | <dict> |
669 | | - <key>0</key> |
| 701 | + <key>1</key> |
| 702 | + <dict> |
| 703 | + <key>name</key> |
| 704 | + <string>keyword.control.end.ruby</string> |
| 705 | + </dict> |
| 706 | + <key>2</key> |
670 | 707 | <dict> |
671 | 708 | <key>name</key> |
672 | 709 | <string>keyword.control.conditional.if.end.ruby</string> |
|
685 | 722 | <dict> |
686 | 723 | <key>begin</key> |
687 | 724 | <string>(?x) |
| 725 | + (?=unless\b) |
688 | 726 | (?<!::) |
689 | 727 | (?<=<|&|\||=|>|~|\^|[+\-*/%]|\.{2}|\.{3}|^|;|:|\[|\(|\{|,| |
690 | 728 | \Wif|^if| # \WX|^X is equivalent to \bX |
|
712 | 750 | </dict> |
713 | 751 | </dict> |
714 | 752 | <key>end</key> |
715 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 753 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
716 | 754 | <key>endCaptures</key> |
717 | 755 | <dict> |
718 | | - <key>0</key> |
| 756 | + <key>1</key> |
| 757 | + <dict> |
| 758 | + <key>name</key> |
| 759 | + <string>keyword.control.end.ruby</string> |
| 760 | + </dict> |
| 761 | + <key>2</key> |
719 | 762 | <dict> |
720 | 763 | <key>name</key> |
721 | 764 | <string>keyword.control.conditional.unless.end.ruby</string> |
|
747 | 790 | </dict> |
748 | 791 | <key>match</key> |
749 | 792 | <string>(?x) |
| 793 | + (?=while\b|until\b) |
750 | 794 | (?<=[}\])\w?!"'`]) |
751 | 795 | (?<!\Wif|^if| # \WX|^X is equivalent to \bX |
752 | 796 | \Wunless|^unless| # this is workaround for code editors which doesn't support onigomo |
|
768 | 812 | <dict> |
769 | 813 | <key>begin</key> |
770 | 814 | <string>(?x) |
| 815 | + (?=while\b) |
771 | 816 | (?<!::) |
772 | 817 | (?<=<|&|\||=|>|~|\^|[+\-*/%]|\.{2}|\.{3}|^|;|:|\[|\(|\{|,| |
773 | 818 | \Wif|^if| # \WX|^X is equivalent to \bX |
|
795 | 840 | </dict> |
796 | 841 | </dict> |
797 | 842 | <key>end</key> |
798 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 843 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
799 | 844 | <key>endCaptures</key> |
800 | 845 | <dict> |
801 | | - <key>0</key> |
| 846 | + <key>1</key> |
| 847 | + <dict> |
| 848 | + <key>name</key> |
| 849 | + <string>keyword.control.end.ruby</string> |
| 850 | + </dict> |
| 851 | + <key>2</key> |
802 | 852 | <dict> |
803 | 853 | <key>name</key> |
804 | 854 | <string>keyword.control.while.end.ruby</string> |
|
838 | 888 | <dict> |
839 | 889 | <key>begin</key> |
840 | 890 | <string>(?x) |
| 891 | + (?=until\b) |
841 | 892 | (?<!::) |
842 | 893 | (?<=<|&|\||=|>|~|\^|[+\-*/%]|\.{2}|\.{3}|^|;|:|\[|\(|\{|,| |
843 | 894 | \Wif|^if| # \WX|^X is equivalent to \bX |
|
865 | 916 | </dict> |
866 | 917 | </dict> |
867 | 918 | <key>end</key> |
868 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 919 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
869 | 920 | <key>endCaptures</key> |
870 | 921 | <dict> |
871 | | - <key>0</key> |
| 922 | + <key>1</key> |
| 923 | + <dict> |
| 924 | + <key>name</key> |
| 925 | + <string>keyword.control.end.ruby</string> |
| 926 | + </dict> |
| 927 | + <key>2</key> |
872 | 928 | <dict> |
873 | 929 | <key>name</key> |
874 | 930 | <string>keyword.control.until.end.ruby</string> |
|
923 | 979 | <key>name</key> |
924 | 980 | <string>keyword.control.conditional.$1.ruby</string> |
925 | 981 | </dict> |
| 982 | + <dict><key>comment</key> |
| 983 | + <string> |
| 984 | + All structures that are closed with keyword 'end' already defined higher. |
| 985 | + This rule is made to match freestanding 'end'. |
| 986 | + </string> |
| 987 | + <key>match</key> |
| 988 | + <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 989 | + <key>name</key> |
| 990 | + <string>keyword.control.end.ruby</string> |
| 991 | + </dict> |
926 | 992 | <dict> |
927 | | - <key>comment</key> |
928 | | - <string>everything being a reserved word, not a value and needing a 'end' is a..</string> |
929 | 993 | <key>match</key> |
930 | | - <string>(?<!\.)\b(BEGIN|END|end)\b(?![?!])</string> |
| 994 | + <string>(?<!\.)\b(BEGIN|END)\b(?![?!])</string> |
931 | 995 | <key>name</key> |
932 | | - <string>keyword.control.ruby</string> |
| 996 | + <string>keyword.control.$1.ruby</string> |
933 | 997 | </dict> |
934 | 998 | <dict> |
935 | 999 | <key>comment</key> |
|
1164 | 1228 | <key>comment</key> |
1165 | 1229 | <string>the method pattern comes from the symbol pattern, see there for a explaination</string> |
1166 | 1230 | <key>end</key> |
1167 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 1231 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
1168 | 1232 | <key>endCaptures</key> |
1169 | 1233 | <dict> |
1170 | | - <key>0</key> |
| 1234 | + <key>1</key> |
| 1235 | + <dict> |
| 1236 | + <key>name</key> |
| 1237 | + <string>keyword.control.end.ruby</string> |
| 1238 | + </dict> |
| 1239 | + <key>2</key> |
1171 | 1240 | <dict> |
1172 | 1241 | <key>name</key> |
1173 | 1242 | <string>keyword.control.def.end.ruby</string> |
|
1289 | 1358 | <key>comment</key> |
1290 | 1359 | <string>same as the previous rule, but without parentheses around the arguments</string> |
1291 | 1360 | <key>end</key> |
1292 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 1361 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
1293 | 1362 | <key>endCaptures</key> |
1294 | 1363 | <dict> |
1295 | | - <key>0</key> |
| 1364 | + <key>1</key> |
| 1365 | + <dict> |
| 1366 | + <key>name</key> |
| 1367 | + <string>keyword.control.end.ruby</string> |
| 1368 | + </dict> |
| 1369 | + <key>2</key> |
1296 | 1370 | <dict> |
1297 | 1371 | <key>name</key> |
1298 | 1372 | <string>keyword.control.def.end.ruby</string> |
|
1372 | 1446 | <key>comment</key> |
1373 | 1447 | <string> the optional name is just to catch the def also without a method-name</string> |
1374 | 1448 | <key>end</key> |
1375 | | - <string>(?<!\.|::)\bend\b(?![?!])</string> |
| 1449 | + <string>(?<!\.|::)\b((end))\b(?![?!])</string> |
1376 | 1450 | <key>endCaptures</key> |
1377 | 1451 | <dict> |
1378 | | - <key>0</key> |
| 1452 | + <key>1</key> |
| 1453 | + <dict> |
| 1454 | + <key>name</key> |
| 1455 | + <string>keyword.control.end.ruby</string> |
| 1456 | + </dict> |
| 1457 | + <key>2</key> |
1379 | 1458 | <dict> |
1380 | 1459 | <key>name</key> |
1381 | 1460 | <string>keyword.control.def.end.ruby</string> |
|
0 commit comments