|
4 | 4 | "If you want to provide a fix or improvement, please create a pull request against the original repository.", |
5 | 5 | "Once accepted there, we are happy to receive an update request." |
6 | 6 | ], |
7 | | - "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/f88ac364a66b447bc16b966a66af52ae8b31795c", |
| 7 | + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/5a701cf1028d9c517fa2ee5210628935e0d7b19a", |
8 | 8 | "name": "C", |
9 | 9 | "scopeName": "source.c", |
10 | 10 | "patterns": [ |
|
847 | 847 | "name": "storage.type.built-in.c" |
848 | 848 | }, |
849 | 849 | { |
850 | | - "match": "(?-mix:\\b(asm|__asm__|enum|struct|union)\\b)", |
| 850 | + "match": "(?-mix:\\b(enum|struct|union)\\b)", |
851 | 851 | "name": "storage.type.$1.c" |
| 852 | + }, |
| 853 | + { |
| 854 | + "name": "meta.asm.c", |
| 855 | + "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()", |
| 856 | + "beginCaptures": { |
| 857 | + "1": { |
| 858 | + "name": "storage.type.asm.c" |
| 859 | + }, |
| 860 | + "2": { |
| 861 | + "name": "storage.modifier.c" |
| 862 | + }, |
| 863 | + "3": { |
| 864 | + "name": "punctuation.section.parens.begin.bracket.round.assembly.c" |
| 865 | + } |
| 866 | + }, |
| 867 | + "end": "(\\))", |
| 868 | + "endCaptures": { |
| 869 | + "1": { |
| 870 | + "name": "punctuation.section.parens.end.bracket.round.assembly.c" |
| 871 | + } |
| 872 | + }, |
| 873 | + "patterns": [ |
| 874 | + { |
| 875 | + "name": "string.quoted.double.c", |
| 876 | + "contentName": "meta.embedded.assembly.c", |
| 877 | + "begin": "(R?)(\")", |
| 878 | + "beginCaptures": { |
| 879 | + "1": { |
| 880 | + "name": "meta.encoding.c" |
| 881 | + }, |
| 882 | + "2": { |
| 883 | + "name": "punctuation.definition.string.begin.assembly.c" |
| 884 | + } |
| 885 | + }, |
| 886 | + "end": "(\")", |
| 887 | + "endCaptures": { |
| 888 | + "1": { |
| 889 | + "name": "punctuation.definition.string.end.assembly.c" |
| 890 | + } |
| 891 | + }, |
| 892 | + "patterns": [ |
| 893 | + { |
| 894 | + "include": "source.asm" |
| 895 | + }, |
| 896 | + { |
| 897 | + "include": "source.x86" |
| 898 | + }, |
| 899 | + { |
| 900 | + "include": "source.x86_64" |
| 901 | + }, |
| 902 | + { |
| 903 | + "include": "source.arm" |
| 904 | + }, |
| 905 | + { |
| 906 | + "include": "#backslash_escapes" |
| 907 | + }, |
| 908 | + { |
| 909 | + "include": "#string_escaped_char" |
| 910 | + }, |
| 911 | + { |
| 912 | + "match": "(?=not)possible" |
| 913 | + } |
| 914 | + ] |
| 915 | + }, |
| 916 | + { |
| 917 | + "begin": "(\\()", |
| 918 | + "beginCaptures": { |
| 919 | + "1": { |
| 920 | + "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" |
| 921 | + } |
| 922 | + }, |
| 923 | + "end": "(\\))", |
| 924 | + "endCaptures": { |
| 925 | + "1": { |
| 926 | + "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" |
| 927 | + } |
| 928 | + }, |
| 929 | + "patterns": [ |
| 930 | + { |
| 931 | + "include": "#evaluation_context" |
| 932 | + } |
| 933 | + ] |
| 934 | + }, |
| 935 | + { |
| 936 | + "match": ":", |
| 937 | + "name": "punctuation.separator.delimiter.colon.assembly.c" |
| 938 | + }, |
| 939 | + { |
| 940 | + "include": "#comments_context" |
| 941 | + }, |
| 942 | + { |
| 943 | + "include": "#comments" |
| 944 | + } |
| 945 | + ] |
852 | 946 | } |
853 | 947 | ] |
854 | 948 | }, |
|
2239 | 2333 | } |
2240 | 2334 | ] |
2241 | 2335 | }, |
| 2336 | + "backslash_escapes": { |
| 2337 | + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", |
| 2338 | + "name": "constant.character.escape.c" |
| 2339 | + }, |
2242 | 2340 | "conditional_context": { |
2243 | 2341 | "patterns": [ |
2244 | 2342 | { |
|
2249 | 2347 | } |
2250 | 2348 | ] |
2251 | 2349 | }, |
| 2350 | + "evalutation_context": { |
| 2351 | + "patterns": [ |
| 2352 | + { |
| 2353 | + "include": "#function-call-innards" |
| 2354 | + }, |
| 2355 | + { |
| 2356 | + "include": "$base" |
| 2357 | + } |
| 2358 | + ] |
| 2359 | + }, |
2252 | 2360 | "member_access": { |
2253 | | - "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:void|char|short|int|signed|unsigned|long|float|double|bool|_Bool|_Complex|_Imaginary|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|memory_order|atomic_bool|atomic_char|atomic_schar|atomic_uchar|atomic_short|atomic_ushort|atomic_int|atomic_uint|atomic_long|atomic_ulong|atomic_llong|atomic_ullong|atomic_char16_t|atomic_char32_t|atomic_wchar_t|atomic_int_least8_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_least16_t|atomic_int_least32_t|atomic_uint_least32_t|atomic_int_least64_t|atomic_uint_least64_t|atomic_int_fast8_t|atomic_uint_fast8_t|atomic_int_fast16_t|atomic_uint_fast16_t|atomic_int_fast32_t|atomic_uint_fast32_t|atomic_int_fast64_t|atomic_uint_fast64_t|atomic_intptr_t|atomic_uintptr_t|atomic_size_t|atomic_ptrdiff_t|atomic_intmax_t|atomic_uintmax_t))[a-zA-Z_]\\w*\\b(?!\\())", |
| 2361 | + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:void|char|short|int|signed|unsigned|long|float|double|bool|_Bool|_Complex|_Imaginary|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|memory_order|atomic_bool|atomic_char|atomic_schar|atomic_uchar|atomic_short|atomic_ushort|atomic_int|atomic_uint|atomic_long|atomic_ulong|atomic_llong|atomic_ullong|atomic_char16_t|atomic_char32_t|atomic_wchar_t|atomic_int_least8_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_least16_t|atomic_int_least32_t|atomic_uint_least32_t|atomic_int_least64_t|atomic_uint_least64_t|atomic_int_fast8_t|atomic_uint_fast8_t|atomic_int_fast16_t|atomic_uint_fast16_t|atomic_int_fast32_t|atomic_uint_fast32_t|atomic_int_fast64_t|atomic_uint_fast64_t|atomic_intptr_t|atomic_uintptr_t|atomic_size_t|atomic_ptrdiff_t|atomic_intmax_t|atomic_uintmax_t))[a-zA-Z_]\\w*\\b(?!\\())", |
2254 | 2362 | "captures": { |
2255 | 2363 | "1": { |
2256 | 2364 | "name": "variable.other.object.access.c" |
|
2292 | 2400 | }, |
2293 | 2401 | "method_access": { |
2294 | 2402 | "contentName": "meta.function-call.member.c", |
2295 | | - "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", |
| 2403 | + "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", |
2296 | 2404 | "beginCaptures": { |
2297 | 2405 | "1": { |
2298 | 2406 | "name": "variable.other.object.access.c" |
|
3371 | 3479 | "end": "(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3372 | 3480 | "patterns": [ |
3373 | 3481 | { |
3374 | | - "match": "(\\G0[xX])(?:([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))(?:([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?(?:((?<!')([pP])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:([lLfF](?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
| 3482 | + "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?<!')([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)))?([lLfF](?!\\w))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3375 | 3483 | "captures": { |
3376 | 3484 | "1": { |
3377 | 3485 | "name": "keyword.other.unit.hexadecimal.c" |
|
3427 | 3535 | } |
3428 | 3536 | }, |
3429 | 3537 | { |
3430 | | - "match": "(\\G(?=[0-9.])(?!0[xXbB]))(?:([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?((?:(?<=[0-9])\\.|\\.(?=[0-9])))(?:([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?(?:((?<!')([eE])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:([lLfF](?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
| 3538 | + "match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?<!')([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)))?([lLfF](?!\\w))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3431 | 3539 | "captures": { |
3432 | 3540 | "2": { |
3433 | 3541 | "name": "constant.numeric.decimal.c", |
|
3480 | 3588 | } |
3481 | 3589 | }, |
3482 | 3590 | { |
3483 | | - "match": "(\\G0[bB])([01](?:(?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
| 3591 | + "match": "(\\G0[bB])([01](?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3484 | 3592 | "captures": { |
3485 | 3593 | "1": { |
3486 | 3594 | "name": "keyword.other.unit.binary.c" |
|
3503 | 3611 | } |
3504 | 3612 | }, |
3505 | 3613 | { |
3506 | | - "match": "(\\G0)((?:(?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))+)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
| 3614 | + "match": "(\\G0)((?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))+)((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3507 | 3615 | "captures": { |
3508 | 3616 | "1": { |
3509 | 3617 | "name": "keyword.other.unit.octal.c" |
|
3526 | 3634 | } |
3527 | 3635 | }, |
3528 | 3636 | { |
3529 | | - "match": "(\\G0[xX])([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?<!')([pP])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
| 3637 | + "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?<!')([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)))?((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3530 | 3638 | "captures": { |
3531 | 3639 | "1": { |
3532 | 3640 | "name": "keyword.other.unit.hexadecimal.c" |
|
3567 | 3675 | } |
3568 | 3676 | }, |
3569 | 3677 | { |
3570 | | - "match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?<!')([eE])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
| 3678 | + "match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?<!')([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)))?((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))", |
3571 | 3679 | "captures": { |
3572 | 3680 | "2": { |
3573 | 3681 | "name": "constant.numeric.decimal.c", |
|
3605 | 3713 | } |
3606 | 3714 | }, |
3607 | 3715 | { |
3608 | | - "match": "(?:(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))+", |
| 3716 | + "match": "(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])+", |
3609 | 3717 | "name": "invalid.illegal.constant.numeric" |
3610 | 3718 | } |
3611 | 3719 | ] |
|
0 commit comments