|
752 | 752 | },
|
753 | 753 | "end": "(?=;)",
|
754 | 754 | "patterns": [
|
| 755 | + { |
| 756 | + "include": "#attribute" |
| 757 | + }, |
755 | 758 | {
|
756 | 759 | "include": "#expression"
|
757 | 760 | }
|
|
853 | 856 | "name": "keyword.declaration.function.arrow.c3"
|
854 | 857 | },
|
855 | 858 | {
|
856 |
| - "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|>>=|<<=", |
| 859 | + "match": "(?:[-%&*+/^|]|>>|<<)=", |
857 | 860 | "name": "keyword.operator.assignment.augmented.c3"
|
858 | 861 | },
|
859 | 862 | {
|
860 |
| - "match": "<=|>=|==|<|>|\\!=", |
| 863 | + "match": "<=|>=|==|<|>|!=", |
861 | 864 | "name": "keyword.operator.comparison.c3"
|
862 | 865 | },
|
863 | 866 | {
|
|
877 | 880 | "name": "keyword.operator.arithmetic.c3"
|
878 | 881 | },
|
879 | 882 | {
|
880 |
| - "match": "\\+|\\-|/|%|\\||\\^|~", |
| 883 | + "match": "[-%+/^|~]", |
881 | 884 | "name": "keyword.operator.arithmetic.c3"
|
882 | 885 | },
|
883 | 886 | {
|
884 | 887 | "match": "=",
|
885 | 888 | "name": "keyword.operator.assignment.c3"
|
886 | 889 | },
|
887 | 890 | {
|
888 |
| - "match": "!|\\?[?:]?|\\*|&|:", |
| 891 | + "match": "!|\\?[?:]?|[&*:]", |
889 | 892 | "name": "keyword.operator.c3"
|
890 | 893 | }
|
891 | 894 | ]
|
|
923 | 926 | }
|
924 | 927 | ]
|
925 | 928 | },
|
| 929 | + "escape_sequence": { |
| 930 | + "match": "\\\\([0abefnrtv'\"\\\\]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})", |
| 931 | + "name": "constant.character.escape.c3" |
| 932 | + }, |
926 | 933 | "char_literal": {
|
927 | 934 | "begin": "'",
|
928 | 935 | "beginCaptures": {
|
|
939 | 946 | "contentName": "string.quoted.single.c3",
|
940 | 947 | "patterns": [
|
941 | 948 | {
|
942 |
| - "match": "\\\\.", |
943 |
| - "name": "constant.character.escape.c3" |
| 949 | + "include": "#escape_sequence" |
944 | 950 | }
|
945 | 951 | ]
|
946 | 952 | },
|
|
960 | 966 | "contentName": "string.quoted.double.c3",
|
961 | 967 | "patterns": [
|
962 | 968 | {
|
963 |
| - "match": "\\\\([0abefnrtv'\"\\\\]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})", |
964 |
| - "name": "constant.character.escape.c3" |
| 969 | + "include": "#escape_sequence" |
965 | 970 | }
|
966 | 971 | ]
|
967 | 972 | },
|
|
1258 | 1263 | "attribute": {
|
1259 | 1264 | "patterns": [
|
1260 | 1265 | {
|
1261 |
| - "begin": "@(?:(?:align|benchmark|bigendian|builtin|callconv|compact|const|deprecated|dynamic|export|extern|finalizer|format|if|inline|init|link|littleendian|local|maydiscard|naked|noalias|nodiscard|noinit|noinline|nopadding|norecurse|noreturn|nosanitize|nostrip|obfuscate|operator|operator_r|operator_s|optional|overlap|packed|private|public|pure|reflect|safemacro|section|tag|test|unused|used|wasm|weak|winmain)|(?:\\b_*[A-Z][_A-Z0-9]*[a-z][_a-zA-Z0-9]*\\b))", |
| 1266 | + "begin": "@(?:(?:align|benchmark|bigendian|builtin|callconv|compact|const|deprecated|dynamic|export|extern|finalizer|format|if|inline|init|link|littleendian|local|maydiscard|naked|noalias|nodiscard|noinit|noinline|nopadding|norecurse|noreturn|nosanitize|nostrip|obfuscate|operator|operator_r|operator_s|optional|overlap|packed|private|public|pure|reflect|safemacro|section|tag|test|unused|used|wasm|weak|winmain)\\b|(?:\\b_*[A-Z][_A-Z0-9]*[a-z][_a-zA-Z0-9]*\\b))", |
1262 | 1267 | "beginCaptures": {
|
1263 | 1268 | "0": {
|
1264 | 1269 | "name": "keyword.annotation.c3"
|
1265 | 1270 | }
|
1266 | 1271 | },
|
1267 |
| - "end": "(?=[^\\s\\(])|(?<=\\))", |
| 1272 | + "end": "(?=[^\\s(])|(?<=\\))", |
1268 | 1273 | "name": "meta.annotation.c3",
|
1269 | 1274 | "patterns": [
|
1270 | 1275 | {
|
|
1424 | 1429 | {
|
1425 | 1430 | "include": "#control_statements"
|
1426 | 1431 | },
|
| 1432 | + { |
| 1433 | + "include": "#attribute" |
| 1434 | + }, |
1427 | 1435 | {
|
1428 | 1436 | "include": "#block"
|
1429 | 1437 | },
|
|
1433 | 1441 | ]
|
1434 | 1442 | },
|
1435 | 1443 | "variable": {
|
1436 |
| - "begin": "(?<!#)(?:(@(?:\\b_*[a-z][_a-zA-Z0-9]*\\b))|(\\$?(?:\\b_*[a-z][_a-zA-Z0-9]*\\b)))", |
| 1444 | + "begin": "(?<!#)(\\$?(?:\\b_*[a-z][_a-zA-Z0-9]*\\b))", |
1437 | 1445 | "beginCaptures": {
|
1438 | 1446 | "1": {
|
1439 |
| - "name": "entity.name.function.c3" |
1440 |
| - }, |
1441 |
| - "2": { |
1442 | 1447 | "name": "variable.other.c3"
|
1443 | 1448 | }
|
1444 | 1449 | },
|
|
1449 | 1454 | }
|
1450 | 1455 | ]
|
1451 | 1456 | },
|
| 1457 | + "leftover_at_ident": { |
| 1458 | + "patterns": [ |
| 1459 | + { |
| 1460 | + "match": "@(?:pure|inline|noinline)", |
| 1461 | + "name": "meta.annotation.c3 keyword.annotation.c3" |
| 1462 | + }, |
| 1463 | + { |
| 1464 | + "begin": "@(?:\\b_*[a-z][_a-zA-Z0-9]*\\b)", |
| 1465 | + "beginCaptures": { |
| 1466 | + "0": { |
| 1467 | + "name": "entity.name.function.c3" |
| 1468 | + } |
| 1469 | + }, |
| 1470 | + "end": "(?=[^{\\s])|(?<=\\})", |
| 1471 | + "patterns": [ |
| 1472 | + { |
| 1473 | + "include": "#generic_params" |
| 1474 | + } |
| 1475 | + ] |
| 1476 | + } |
| 1477 | + ] |
| 1478 | + }, |
1452 | 1479 | "expression": {
|
1453 | 1480 | "patterns": [
|
1454 | 1481 | {
|
|
1478 | 1505 | {
|
1479 | 1506 | "include": "#path"
|
1480 | 1507 | },
|
1481 |
| - { |
1482 |
| - "include": "#attribute" |
1483 |
| - }, |
1484 | 1508 | {
|
1485 | 1509 | "include": "#function_call"
|
1486 | 1510 | },
|
|
1498 | 1522 | },
|
1499 | 1523 | {
|
1500 | 1524 | "include": "#punctuation"
|
| 1525 | + }, |
| 1526 | + { |
| 1527 | + "include": "#leftover_at_ident" |
1501 | 1528 | }
|
1502 | 1529 | ]
|
1503 | 1530 | },
|
|
0 commit comments