|
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/72b309aabb63bf14a3cdf0280149121db005d616", |
| 7 | + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/85b9008b406cc9d3b1c9e779e94cc071116c8426", |
8 | 8 | "name": "C",
|
9 | 9 | "scopeName": "source.c",
|
10 | 10 | "patterns": [
|
|
464 | 464 | ]
|
465 | 465 | },
|
466 | 466 | "backslash_escapes": {
|
467 |
| - "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} )", |
| 467 | + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3][0-7]{,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} )", |
468 | 468 | "name": "constant.character.escape.c"
|
469 | 469 | },
|
470 | 470 | "block": {
|
|
690 | 690 | "name": "storage.type.class.doxygen.c"
|
691 | 691 | },
|
692 | 692 | {
|
693 |
| - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", |
| 693 | + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", |
694 | 694 | "captures": {
|
695 | 695 | "1": {
|
696 | 696 | "name": "storage.type.class.doxygen.c"
|
697 | 697 | },
|
698 | 698 | "2": {
|
| 699 | + "patterns": [ |
| 700 | + { |
| 701 | + "match": "in|out", |
| 702 | + "name": "keyword.other.parameter.direction.$0.c" |
| 703 | + } |
| 704 | + ] |
| 705 | + }, |
| 706 | + "3": { |
699 | 707 | "name": "variable.parameter.c"
|
700 | 708 | }
|
701 | 709 | }
|
|
768 | 776 | "name": "storage.type.class.doxygen.c"
|
769 | 777 | },
|
770 | 778 | {
|
771 |
| - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", |
| 779 | + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", |
772 | 780 | "captures": {
|
773 | 781 | "1": {
|
774 | 782 | "name": "storage.type.class.doxygen.c"
|
775 | 783 | },
|
776 | 784 | "2": {
|
| 785 | + "patterns": [ |
| 786 | + { |
| 787 | + "match": "in|out", |
| 788 | + "name": "keyword.other.parameter.direction.$0.c" |
| 789 | + } |
| 790 | + ] |
| 791 | + }, |
| 792 | + "3": { |
777 | 793 | "name": "variable.parameter.c"
|
778 | 794 | }
|
779 | 795 | }
|
|
859 | 875 | "name": "storage.type.class.doxygen.c"
|
860 | 876 | },
|
861 | 877 | {
|
862 |
| - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", |
| 878 | + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", |
863 | 879 | "captures": {
|
864 | 880 | "1": {
|
865 | 881 | "name": "storage.type.class.doxygen.c"
|
866 | 882 | },
|
867 | 883 | "2": {
|
| 884 | + "patterns": [ |
| 885 | + { |
| 886 | + "match": "in|out", |
| 887 | + "name": "keyword.other.parameter.direction.$0.c" |
| 888 | + } |
| 889 | + ] |
| 890 | + }, |
| 891 | + "3": { |
868 | 892 | "name": "variable.parameter.c"
|
869 | 893 | }
|
870 | 894 | }
|
|
2874 | 2898 | },
|
2875 | 2899 | {
|
2876 | 2900 | "name": "meta.asm.c",
|
2877 |
| - "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()", |
| 2901 | + "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)", |
2878 | 2902 | "beginCaptures": {
|
2879 | 2903 | "1": {
|
2880 | 2904 | "name": "storage.type.asm.c"
|
2881 | 2905 | },
|
2882 | 2906 | "2": {
|
2883 | 2907 | "name": "storage.modifier.c"
|
2884 |
| - }, |
2885 |
| - "3": { |
2886 |
| - "name": "punctuation.section.parens.begin.bracket.round.assembly.c" |
2887 |
| - } |
2888 |
| - }, |
2889 |
| - "end": "(\\))", |
2890 |
| - "endCaptures": { |
2891 |
| - "1": { |
2892 |
| - "name": "punctuation.section.parens.end.bracket.round.assembly.c" |
2893 | 2908 | }
|
2894 | 2909 | },
|
| 2910 | + "end": "(?!\\G)", |
2895 | 2911 | "patterns": [
|
2896 | 2912 | {
|
2897 |
| - "name": "string.quoted.double.c", |
2898 |
| - "contentName": "meta.embedded.assembly.c", |
2899 |
| - "begin": "(R?)(\")", |
| 2913 | + "match": "(?:^)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\n|$)", |
| 2914 | + "captures": { |
| 2915 | + "1": { |
| 2916 | + "patterns": [ |
| 2917 | + { |
| 2918 | + "include": "#inline_comment" |
| 2919 | + } |
| 2920 | + ] |
| 2921 | + }, |
| 2922 | + "2": { |
| 2923 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 2924 | + }, |
| 2925 | + "3": { |
| 2926 | + "name": "comment.block.c" |
| 2927 | + }, |
| 2928 | + "4": { |
| 2929 | + "patterns": [ |
| 2930 | + { |
| 2931 | + "match": "\\*\\/", |
| 2932 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 2933 | + }, |
| 2934 | + { |
| 2935 | + "match": "\\*", |
| 2936 | + "name": "comment.block.c" |
| 2937 | + } |
| 2938 | + ] |
| 2939 | + } |
| 2940 | + } |
| 2941 | + }, |
| 2942 | + { |
| 2943 | + "include": "#comments_context" |
| 2944 | + }, |
| 2945 | + { |
| 2946 | + "include": "#comments" |
| 2947 | + }, |
| 2948 | + { |
| 2949 | + "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\()", |
2900 | 2950 | "beginCaptures": {
|
2901 | 2951 | "1": {
|
2902 |
| - "name": "meta.encoding.c" |
| 2952 | + "name": "punctuation.section.parens.begin.bracket.round.assembly.c" |
2903 | 2953 | },
|
2904 | 2954 | "2": {
|
2905 |
| - "name": "punctuation.definition.string.begin.assembly.c" |
| 2955 | + "patterns": [ |
| 2956 | + { |
| 2957 | + "include": "#inline_comment" |
| 2958 | + } |
| 2959 | + ] |
| 2960 | + }, |
| 2961 | + "3": { |
| 2962 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 2963 | + }, |
| 2964 | + "4": { |
| 2965 | + "name": "comment.block.c" |
| 2966 | + }, |
| 2967 | + "5": { |
| 2968 | + "patterns": [ |
| 2969 | + { |
| 2970 | + "match": "\\*\\/", |
| 2971 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 2972 | + }, |
| 2973 | + { |
| 2974 | + "match": "\\*", |
| 2975 | + "name": "comment.block.c" |
| 2976 | + } |
| 2977 | + ] |
2906 | 2978 | }
|
2907 | 2979 | },
|
2908 |
| - "end": "(\")", |
| 2980 | + "end": "(\\))", |
2909 | 2981 | "endCaptures": {
|
2910 | 2982 | "1": {
|
2911 |
| - "name": "punctuation.definition.string.end.assembly.c" |
| 2983 | + "name": "punctuation.section.parens.end.bracket.round.assembly.c" |
2912 | 2984 | }
|
2913 | 2985 | },
|
2914 | 2986 | "patterns": [
|
2915 | 2987 | {
|
2916 |
| - "include": "source.asm" |
2917 |
| - }, |
2918 |
| - { |
2919 |
| - "include": "source.x86" |
| 2988 | + "name": "string.quoted.double.c", |
| 2989 | + "contentName": "meta.embedded.assembly.c", |
| 2990 | + "begin": "(R?)(\")", |
| 2991 | + "beginCaptures": { |
| 2992 | + "1": { |
| 2993 | + "name": "meta.encoding.c" |
| 2994 | + }, |
| 2995 | + "2": { |
| 2996 | + "name": "punctuation.definition.string.begin.assembly.c" |
| 2997 | + } |
| 2998 | + }, |
| 2999 | + "end": "(\")", |
| 3000 | + "endCaptures": { |
| 3001 | + "1": { |
| 3002 | + "name": "punctuation.definition.string.end.assembly.c" |
| 3003 | + } |
| 3004 | + }, |
| 3005 | + "patterns": [ |
| 3006 | + { |
| 3007 | + "include": "source.asm" |
| 3008 | + }, |
| 3009 | + { |
| 3010 | + "include": "source.x86" |
| 3011 | + }, |
| 3012 | + { |
| 3013 | + "include": "source.x86_64" |
| 3014 | + }, |
| 3015 | + { |
| 3016 | + "include": "source.arm" |
| 3017 | + }, |
| 3018 | + { |
| 3019 | + "include": "#backslash_escapes" |
| 3020 | + }, |
| 3021 | + { |
| 3022 | + "include": "#string_escaped_char" |
| 3023 | + } |
| 3024 | + ] |
2920 | 3025 | },
|
2921 | 3026 | {
|
2922 |
| - "include": "source.x86_64" |
| 3027 | + "begin": "(\\()", |
| 3028 | + "beginCaptures": { |
| 3029 | + "1": { |
| 3030 | + "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" |
| 3031 | + } |
| 3032 | + }, |
| 3033 | + "end": "(\\))", |
| 3034 | + "endCaptures": { |
| 3035 | + "1": { |
| 3036 | + "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" |
| 3037 | + } |
| 3038 | + }, |
| 3039 | + "patterns": [ |
| 3040 | + { |
| 3041 | + "include": "#evaluation_context" |
| 3042 | + } |
| 3043 | + ] |
2923 | 3044 | },
|
2924 | 3045 | {
|
2925 |
| - "include": "source.arm" |
| 3046 | + "match": "\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))([a-zA-Z_]\\w*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]", |
| 3047 | + "captures": { |
| 3048 | + "1": { |
| 3049 | + "patterns": [ |
| 3050 | + { |
| 3051 | + "include": "#inline_comment" |
| 3052 | + } |
| 3053 | + ] |
| 3054 | + }, |
| 3055 | + "2": { |
| 3056 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 3057 | + }, |
| 3058 | + "3": { |
| 3059 | + "name": "comment.block.c" |
| 3060 | + }, |
| 3061 | + "4": { |
| 3062 | + "patterns": [ |
| 3063 | + { |
| 3064 | + "match": "\\*\\/", |
| 3065 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 3066 | + }, |
| 3067 | + { |
| 3068 | + "match": "\\*", |
| 3069 | + "name": "comment.block.c" |
| 3070 | + } |
| 3071 | + ] |
| 3072 | + }, |
| 3073 | + "5": { |
| 3074 | + "name": "variable.other.asm.label.c" |
| 3075 | + }, |
| 3076 | + "6": { |
| 3077 | + "patterns": [ |
| 3078 | + { |
| 3079 | + "include": "#inline_comment" |
| 3080 | + } |
| 3081 | + ] |
| 3082 | + }, |
| 3083 | + "7": { |
| 3084 | + "name": "comment.block.c punctuation.definition.comment.begin.c" |
| 3085 | + }, |
| 3086 | + "8": { |
| 3087 | + "name": "comment.block.c" |
| 3088 | + }, |
| 3089 | + "9": { |
| 3090 | + "patterns": [ |
| 3091 | + { |
| 3092 | + "match": "\\*\\/", |
| 3093 | + "name": "comment.block.c punctuation.definition.comment.end.c" |
| 3094 | + }, |
| 3095 | + { |
| 3096 | + "match": "\\*", |
| 3097 | + "name": "comment.block.c" |
| 3098 | + } |
| 3099 | + ] |
| 3100 | + } |
| 3101 | + } |
2926 | 3102 | },
|
2927 | 3103 | {
|
2928 |
| - "include": "#backslash_escapes" |
| 3104 | + "match": ":", |
| 3105 | + "name": "punctuation.separator.delimiter.colon.assembly.c" |
2929 | 3106 | },
|
2930 | 3107 | {
|
2931 |
| - "include": "#string_escaped_char" |
| 3108 | + "include": "#comments_context" |
2932 | 3109 | },
|
2933 | 3110 | {
|
2934 |
| - "match": "(?=not)possible" |
| 3111 | + "include": "#comments" |
2935 | 3112 | }
|
2936 | 3113 | ]
|
2937 |
| - }, |
2938 |
| - { |
2939 |
| - "begin": "(\\()", |
2940 |
| - "beginCaptures": { |
2941 |
| - "1": { |
2942 |
| - "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" |
2943 |
| - } |
2944 |
| - }, |
2945 |
| - "end": "(\\))", |
2946 |
| - "endCaptures": { |
2947 |
| - "1": { |
2948 |
| - "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" |
2949 |
| - } |
2950 |
| - }, |
2951 |
| - "patterns": [ |
2952 |
| - { |
2953 |
| - "include": "#evaluation_context" |
2954 |
| - } |
2955 |
| - ] |
2956 |
| - }, |
2957 |
| - { |
2958 |
| - "match": ":", |
2959 |
| - "name": "punctuation.separator.delimiter.colon.assembly.c" |
2960 |
| - }, |
2961 |
| - { |
2962 |
| - "include": "#comments_context" |
2963 |
| - }, |
2964 |
| - { |
2965 |
| - "include": "#comments" |
2966 | 3114 | }
|
2967 | 3115 | ]
|
2968 | 3116 | }
|
|
0 commit comments