Skip to content

Commit efa12b2

Browse files
committed
Update grammars
1 parent 0b312b0 commit efa12b2

22 files changed

+15336
-15656
lines changed

extensions/cpp/cgmanifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"git": {
77
"name": "jeff-hykin/cpp-textmate-grammar",
88
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
9-
"commitHash": "666808cab3907fc91ed4d3901060ee6b045cca58"
9+
"commitHash": "5b6f67859e895da83dc242b849480ee04ce7ce38"
1010
}
1111
},
1212
"license": "MIT",
13-
"version": "1.14.15",
13+
"version": "1.14.20",
1414
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
1515
},
1616
{

extensions/cpp/syntaxes/c.tmLanguage.json

+208-60
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
55
"Once accepted there, we are happy to receive an update request."
66
],
7-
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/72b309aabb63bf14a3cdf0280149121db005d616",
7+
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/85b9008b406cc9d3b1c9e779e94cc071116c8426",
88
"name": "C",
99
"scopeName": "source.c",
1010
"patterns": [
@@ -464,7 +464,7 @@
464464
]
465465
},
466466
"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} )",
468468
"name": "constant.character.escape.c"
469469
},
470470
"block": {
@@ -690,12 +690,20 @@
690690
"name": "storage.type.class.doxygen.c"
691691
},
692692
{
693-
"match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)",
693+
"match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)",
694694
"captures": {
695695
"1": {
696696
"name": "storage.type.class.doxygen.c"
697697
},
698698
"2": {
699+
"patterns": [
700+
{
701+
"match": "in|out",
702+
"name": "keyword.other.parameter.direction.$0.c"
703+
}
704+
]
705+
},
706+
"3": {
699707
"name": "variable.parameter.c"
700708
}
701709
}
@@ -768,12 +776,20 @@
768776
"name": "storage.type.class.doxygen.c"
769777
},
770778
{
771-
"match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)",
779+
"match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)",
772780
"captures": {
773781
"1": {
774782
"name": "storage.type.class.doxygen.c"
775783
},
776784
"2": {
785+
"patterns": [
786+
{
787+
"match": "in|out",
788+
"name": "keyword.other.parameter.direction.$0.c"
789+
}
790+
]
791+
},
792+
"3": {
777793
"name": "variable.parameter.c"
778794
}
779795
}
@@ -859,12 +875,20 @@
859875
"name": "storage.type.class.doxygen.c"
860876
},
861877
{
862-
"match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)",
878+
"match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)",
863879
"captures": {
864880
"1": {
865881
"name": "storage.type.class.doxygen.c"
866882
},
867883
"2": {
884+
"patterns": [
885+
{
886+
"match": "in|out",
887+
"name": "keyword.other.parameter.direction.$0.c"
888+
}
889+
]
890+
},
891+
"3": {
868892
"name": "variable.parameter.c"
869893
}
870894
}
@@ -2874,95 +2898,219 @@
28742898
},
28752899
{
28762900
"name": "meta.asm.c",
2877-
"begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()",
2901+
"begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)",
28782902
"beginCaptures": {
28792903
"1": {
28802904
"name": "storage.type.asm.c"
28812905
},
28822906
"2": {
28832907
"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"
28932908
}
28942909
},
2910+
"end": "(?!\\G)",
28952911
"patterns": [
28962912
{
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)))\\()",
29002950
"beginCaptures": {
29012951
"1": {
2902-
"name": "meta.encoding.c"
2952+
"name": "punctuation.section.parens.begin.bracket.round.assembly.c"
29032953
},
29042954
"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+
]
29062978
}
29072979
},
2908-
"end": "(\")",
2980+
"end": "(\\))",
29092981
"endCaptures": {
29102982
"1": {
2911-
"name": "punctuation.definition.string.end.assembly.c"
2983+
"name": "punctuation.section.parens.end.bracket.round.assembly.c"
29122984
}
29132985
},
29142986
"patterns": [
29152987
{
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+
]
29203025
},
29213026
{
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+
]
29233044
},
29243045
{
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+
}
29263102
},
29273103
{
2928-
"include": "#backslash_escapes"
3104+
"match": ":",
3105+
"name": "punctuation.separator.delimiter.colon.assembly.c"
29293106
},
29303107
{
2931-
"include": "#string_escaped_char"
3108+
"include": "#comments_context"
29323109
},
29333110
{
2934-
"match": "(?=not)possible"
3111+
"include": "#comments"
29353112
}
29363113
]
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"
29663114
}
29673115
]
29683116
}

0 commit comments

Comments
 (0)