Lines Matching +full:- +full:match

2 ---
5 comment: I don't think anyone uses .hp. .cp tends to be paired with .h. (I could be wrong. :) -- ch…
7 - cpp
8 - cc
9 - cp
10 - cxx
11 - c++
12 - C
13 - h
14 - hh
15 - hpp
16 - hxx
17 - h++
18 - inl
19 - ipp
20 first_line_match: '-\*- C\+\+ -\*-'
26 …operator_method_name: '\boperator\s*(?:[-+*/%^&|~!=<>]|[-+*/%^&|=!<>]=|<<=?|>>=?|&&|\|\||\+\+|--|,…
42 regular: '[^(){}&;*^%=<>-]*'
53 format_spec: |-
56 [ +-]? # sign
67 - include: preprocessor-global
68 - include: global
74 # Objetive-C++ syntax. They are specifically constructed to not push into
75 # sub-contexts, which ensures that Objective-C++ code isn't accidentally
78 # The "unique-*" contexts are additions that C++ makes over C, and thus can
79 # be directly reused in Objective-C++ along with contexts from Objective-C
83 unique-late-expressions:
86 - match: \boperator\b
89 unique-modifiers:
90 - match: \b({{modifiers}})\b
93 unique-variables:
94 - match: \bthis\b
96 # common C++ instance var naming idiom -- fMemberName
97 - match: '\b(f|m)[[:upper:]]\w*\b'
99 # common C++ instance var naming idiom -- m_member_name
100 - match: '\bm_[[:alnum:]_]+\b'
103 unique-constants:
104 - match: \bnullptr\b
107 unique-keywords:
108 - match: \busing\b
110 - match: \bbreak\b
112 - match: \bcontinue\b
114 - match: \bgoto\b
116 - match: \breturn\b
118 - match: \bthrow\b
120 - match: \b({{control_keywords}})\b
122 - match: '\bdelete\b(\s*\[\])?|\bnew\b(?!])'
124 - match: \b({{operator_keywords}})\b
127 unique-types:
128 - match: \b(char16_t|char32_t|wchar_t|nullptr_t)\b
130 - match: \bclass\b
133 unique-strings:
134 - match: '((?:L|u8|u|U)?R)("([^\(\)\\ ]{0,16})\()'
139 - meta_scope: string.quoted.double.c++
140 - match: '\)\3"'
143 - match: '\{\{|\}\}'
145 - include: formatting-syntax
147 unique-numbers:
148 - match: |-
153 …(?:\b\d(?:[\d']*\d)?\.\d(?:[\d']*\d)?|\B\.\d(?:[\d']*\d)?)(?:[Ee][+-]?\d(?:[\d']*\d)?)?(?:[fFlL]|(…
155 …(?:\b\d(?:[\d']*\d)?\.)(?:\B|(?:[fFlL]|(?:i[fl]?|h|min|[mun]?s|_\w*))\b|(?:[Ee][+-]?\d(?:[\d']*\d)…
157 \b\d(?:[\d']*\d)?(?:[Ee][+-]?\d(?:[\d']*\d)?)(?:[fFlL]|(?:i[fl]?|h|min|[mun]?s|_\w*))?\b
164 [1-9](?:[\d']*\d)?
167 0(?:[0-7']*[0-7])?
170 0[Xx][\da-fA-F](?:[\da-fA-F']*[\da-fA-F])?
182 - match: '{{identifier}}\s*(::)\s*'
185 - match: '(?:(::)\s*)?{{identifier}}'
189 function-specifiers:
190 - match: \b(const|final|noexcept|override)\b
194 # The following are C++-specific contexts that should not be reused. This is
195 # because they push into subcontexts and use variables that are C++-specific.
201 - match: '(?=\btemplate\b)'
203 - include: template
204 - match: (?=\S)
205 set: global-modifier
206 - include: namespace
207 - include: keywords-angle-brackets
208 - match: '(?={{path_lookahead}}\s*<)'
209 push: global-modifier
211 - match: /\*
214 - - match: \s*(?=\w)
215 set: global-modifier
216 - match: ""
218 - - meta_scope: comment.block.c
219 - match: \*/
222 - include: early-expressions
223 - match: ^\s*\b(extern)(?=\s+"C(\+\+)?")
226 - include: comments
227 - include: strings
228 - match: '\{'
231 - meta_scope: meta.extern-c.c++
232 - match: '^\s*(#\s*ifdef)\s*__cplusplus\s*'
237 - match: '\}'
240 - include: preprocessor-global
241 - include: global
242 - match: '\}'
245 - include: preprocessor-global
246 - include: global
247 - match: (?=\S)
248 set: global-modifier
249 - match: ^\s*(?=\w)
250 push: global-modifier
251 - include: late-expressions
254 - include: preprocessor-statements
255 - include: scope:source.c#label
256 - include: expressions
259 - include: early-expressions
260 - include: late-expressions
262 early-expressions:
263 - include: early-expressions-before-generic-type
264 - include: generic-type
265 - include: early-expressions-after-generic-type
267 early-expressions-before-generic-type:
268 - include: preprocessor-expressions
269 - include: comments
270 - include: case-default
271 - include: typedef
272 - include: keywords-angle-brackets
273 - include: keywords-parens
274 - include: keywords
275 - include: numbers
277 # parameter list, if in reality a less-than-or-equals sign is meant.
278 - match: <=
281 early-expressions-after-generic-type:
282 - include: members-arrow
283 - include: operators
284 - include: members-dot
285 - include: strings
286 - include: parens
287 - include: brackets
288 - include: block
289 - include: variables
290 - include: constants
291 - match: ','
293 - match: '\)|\}'
294 scope: invalid.illegal.stray-bracket-end.c++
296 expressions-minus-generic-type:
297 - include: early-expressions-before-generic-type
298 - include: angle-brackets
299 - include: early-expressions-after-generic-type
300 - include: late-expressions
302 expressions-minus-generic-type-function-call:
303 - include: early-expressions-before-generic-type
304 - include: angle-brackets
305 - include: early-expressions-after-generic-type
306 - include: late-expressions-before-function-call
307 - include: identifiers
308 - match: ';'
311 late-expressions:
312 - include: late-expressions-before-function-call
313 - include: function-call
314 - include: identifiers
315 - match: ';'
318 late-expressions-before-function-call:
319 - include: unique-late-expressions
320 - include: modifiers-parens
321 - include: modifiers
322 - include: types
324 expressions-minus-function-call:
325 - include: early-expressions
326 - include: late-expressions-before-function-call
327 - include: identifiers
328 - match: ';'
332 - include: scope:source.c#comments
335 - include: scope:source.c#operators
338 - include: unique-modifiers
339 - include: scope:source.c#modifiers
342 - include: unique-variables
343 - include: scope:source.c#variables
346 - include: unique-constants
347 - include: scope:source.c#constants
350 - include: unique-keywords
351 - include: scope:source.c#keywords
354 - include: unique-types
355 - include: types-parens
356 - include: scope:source.c#types
359 - include: unique-strings
360 - match: '(L|u8|u|U)?(")'
365 - meta_scope: string.quoted.double.c++
366 - match: '"'
369 - include: scope:source.c#string_escaped_char
370 - match: |-
373 [#0\- +']* # flags
375 ((-?\d+)|\*(-?\d+\$)?)? # minimum field width
376 (\.((-?\d+)|\*(-?\d+\$)?)?)? # precision
380 - match: '\{\{|\}\}'
382 - include: formatting-syntax
383 - include: scope:source.c#strings
385 formatting-syntax:
387 - match: |- # simple form
393 [^}%]*%.[^}]*) # any format-like string
400 3: constant.other.format-spec.c++
402 - match: \{(?=[^\}"']+\{[^"']*\}) # complex (nested) form
405 - meta_scope: constant.other.placeholder.c++
406 - match: \}
409 - match: '[\w.\[\]]+'
410 - match: '![ars]'
412 - match: ':'
414 - meta_scope: meta.format-spec.c++ constant.other.format-spec.c++
415 - match: (?=\})
417 - include: formatting-syntax
420 - include: unique-numbers
421 - include: scope:source.c#numbers
423 ## C++-specific contexts
425 case-default:
426 - match: '\b(default|case)\b'
429 - match: (?=[);,])
431 - match: ':'
434 - include: expressions
436 modifiers-parens:
437 - match: '\b(alignas)\b\s*(\()'
442 - meta_content_scope: meta.group.c++
443 - match: '\)'
446 - include: expressions
447 - match: \b(__attribute__)\s*(\(\()
452 - meta_scope: meta.attribute.c++
453 - meta_content_scope: meta.group.c++
454 - include: parens
455 - include: strings
456 - match: \)\)
459 - match: \b(__declspec)(\()
464 - meta_content_scope: meta.group.c++
465 - match: '\)'
468 - match: '\b(align|allocate|code_seg|deprecated|property|uuid)\b\s*(\()'
473 - meta_content_scope: meta.group.c++
474 - match: '\)'
477 - include: numbers
478 - include: strings
479 - match: \b(get|put)\b
481 - match: ','
483 - match: '='
485- match: '\b(appdomain|deprecated|dllimport|dllexport|jintrinsic|naked|noalias|noinline|noreturn|n…
488 types-parens:
489 - match: '\b(decltype)\b\s*(\()'
494 - meta_content_scope: meta.group.c++
495 - match: '\)'
498 - include: expressions
500 keywords-angle-brackets:
501 - match: \b({{casts}})\b\s*
504 - match: '>'
507 - match: '<'
510 - match: '(?=>)'
512 - include: expressions-minus-generic-type-function-call
514 keywords-parens:
515 - match: '\b(alignof|typeid|static_assert|sizeof)\b\s*(\()'
520 - meta_content_scope: meta.group.c++
521 - match: '\)'
524 - include: expressions
527 - match: '\b(using)\s+(namespace)\s+(?={{path_lookahead}})'
532 - include: identifiers
533 - match: ''
535 - match: '\b(namespace)\s+(?=({{path_lookahead}})?(?!\s*[;,]))'
540 - meta_content_scope: meta.namespace.c++ entity.name.namespace.c++
541 - include: identifiers
542 - match: ''
544 - meta_scope: meta.namespace.c++
545 - include: comments
546 - match: '='
548 - match: '(?=;)'
550 - match: '\}'
553 - match: '\{'
556 - meta_scope: meta.block.c++
557 - match: '(?=\})'
559 - include: preprocessor-global
560 - include: global
561 - include: expressions
563 template-common:
566 # prevents re-highlighting the whole file until the next > is found.
567 - match: (?=[{};])
569 - include: expressions
572 - match: \btemplate\b
575 - meta_scope: meta.template.c++
576 # Explicitly include comments here at the top, in order to NOT match the
578 - include: comments
579 - match: <
582 - meta_content_scope: meta.template.c++
583 - match: '>'
586 - match: \.{3}
588 - match: \b(typename|{{before_tag}})\b
590 - include: template # include template here for nested templates
591 - include: template-common
592 - match: (?=\S)
594 - meta_content_scope: meta.template.c++
595 - match: \b({{before_tag}})\b
597 - include: template-common
599 generic-type:
600 - match: '(?=(?!template){{path_lookahead}}\s*{{generic_lookahead}}\s*\()'
602 - meta_scope: meta.function-call.c++
603 - match: \btemplate\b
605 - match: '(?:(::)\s*)?{{identifier}}\s*(::)\s*'
607 1: punctuation.accessor.double-colon.c++
608 2: punctuation.accessor.double-colon.c++
609 - match: (?:(::)\s*)?({{identifier}})\s*(<)
611 1: punctuation.accessor.double-colon.c++
615 - match: '>'
618 - include: expressions-minus-generic-type-function-call
619 - match: (?:(::)\s*)?({{identifier}})\s*(\()
621 1: punctuation.accessor.double-colon.c++
625 - meta_scope: meta.function-call.c++
626 - meta_content_scope: meta.group.c++
627 - match: '\)'
630 - include: expressions
631 - include: angle-brackets
632 - match: '\('
635 - meta_scope: meta.function-call.c++
636 - meta_content_scope: meta.group.c++
637 - match: '\)'
640 - include: expressions
641 - match: '(?=(?!template){{path_lookahead}}\s*{{generic_lookahead}})'
643 - include: identifiers
644 - match: '<'
647 - match: '>'
650 - include: expressions-minus-generic-type-function-call
652 angle-brackets:
653 - match: '<(?!<)'
656 - match: '>'
659 - include: expressions-minus-generic-type-function-call
662 - match: '\{'
665 - meta_scope: meta.block.c++
666 - match: (?=^\s*#\s*(elif|else|endif)\b)
668 - match: '\}'
671 - include: statements
673 function-call:
674 - match: (?={{path_lookahead}}\s*\()
676 - meta_scope: meta.function-call.c++
677 - include: scope:source.c#c99
678 - match: '(?:(::)\s*)?{{identifier}}\s*(::)\s*'
683 - match: '(?:(::)\s*)?{{identifier}}'
687 - match: '\('
690 - meta_content_scope: meta.function-call.c++ meta.group.c++
691 - match: '\)'
692 scope: meta.function-call.c++ meta.group.c++ punctuation.section.group.end.c++
694 - include: expressions
696 members-inside-function-call:
697 - meta_content_scope: meta.method-call.c++ meta.group.c++
698 - match: \)
699 scope: meta.method-call.c++ meta.group.c++ punctuation.section.group.end.c++
701 - include: expressions
703 members-after-accessor-junction:
706 - include: comments
707 - match: \btemplate\b
708 scope: meta.method-call.c++ storage.type.template.c++
709 # Guaranteed to be a template member function call after we match this
711 - meta_content_scope: meta.method-call.c++
712 - include: comments
713 - match: '{{identifier}}'
716 - meta_content_scope: meta.method-call.c++
717 - match: \(
719 set: members-inside-function-call
720 - include: comments
721 - include: angle-brackets
722 - match: (?=\S) # safety pop
724 - match: (?=\S) # safety pop
727 - match: '({{operator_method_name}})\s*(\()'
729 0: meta.method-call.c++
732 set: members-inside-function-call
733 # Non-templated member function call
734 - match: (~?{{identifier}})\s*(\()
736 0: meta.method-call.c++
739 set: members-inside-function-call
741 - match: (~?{{identifier}})\s*(?={{generic_lookahead}})
745 - meta_scope: meta.method-call.c++
746 - match: <
749 - meta_content_scope: meta.method-call.c++
750 - match: '>'
753 - meta_content_scope: meta.method-call.c++
754 - include: comments
755 - match: \(
757 set: members-inside-function-call
758 - match: (?=\S) # safety pop
760 - include: expressions
761 # Explicit base-class access
762 - match: ({{identifier}})\s*(::)
764 1: variable.other.base-class.c++
765 2: punctuation.accessor.double-colon.c++
766 set: members-after-accessor-junction # reset
768 - match: '{{identifier}}'
772 members-dot:
773 - include: scope:source.c#access-illegal
774 # No lookahead required because members-dot goes after operators in the
775 # early-expressions-after-generic-type context. This means triple dots
777 - match: \.
779 push: members-after-accessor-junction
781 members-arrow:
783 # early-expressions-after-generic-type context because otherwise the "->"
784 # from the C language will match.
785 - match: ->
787 push: members-after-accessor-junction
790 - match: \btypedef\b
793 - match: ({{identifier}})?\s*(?=;)
797 - match: \b(struct)\s+({{identifier}})\b
800 - include: expressions-minus-generic-type
803 - match: \(
806 - meta_scope: meta.group.c++
807 - match: \)
810 - include: expressions
813 - match: \[
816 - meta_scope: meta.brackets.c++
817 - match: \]
820 - include: expressions
822 function-trailing-return-type:
823 - match: '{{non_angle_brackets}}'
825 - include: angle-brackets
826 - include: types
827 - include: modifiers-parens
828 - include: modifiers
829 - include: identifiers
830 - match: \*|&
832 - include: function-trailing-return-type-parens
833 - match: '(?=\S)'
836 function-trailing-return-type-parens:
837 - match: \(
840 - meta_scope: meta.group.c++
841 - match: \)
844 - include: function-trailing-return-type
848 global-modifier:
849 - include: comments
850 - include: modifiers-parens
851 - include: modifiers
853 - match: '(?={{path_lookahead}}\s*::\s*{{identifier}}\s*(\(|$))'
855 - meta_content_scope: meta.function.c++ entity.name.function.constructor.c++
856 - include: identifiers
857 - match: '(?=[^\w\s])'
858 set: function-definition-params
859 - match: '(?={{path_lookahead}}\s*::\s*~{{identifier}}\s*(\(|$))'
861 - meta_content_scope: meta.function.c++ entity.name.function.destructor.c++
862 - include: identifiers
863 - match: '~{{identifier}}'
864 - match: '(?=[^\w\s])'
865 set: function-definition-params
870 - match: '(?={{path_lookahead}}\s*::\s*$)'
872 - meta_content_scope: meta.function.c++ entity.name.function.c++
873 - include: identifiers
874 - match: '~{{identifier}}'
875 - match: '(?=[^\w\s])'
876 set: function-definition-params
877 - include: unique-strings
878 - match: '(?=\S)'
879 set: global-type
881 global-type:
882 - include: comments
883 - match: \*|&
885- match: '(?=\b({{control_keywords}}|{{operator_keywords}}|{{casts}}|{{memory_operators}}|{{other_…
887 - match: '(?=\s)'
888 set: global-maybe-function
891 - match: |-
904 - include: identifiers
905 - match: ''
906 set: global-maybe-function
907 # The previous match handles return types of struct/enum/etc from a func,
909 - match: '(?=\b({{before_tag}})\b)'
910 set: data-structures
911 - match: '(?=\b({{casts}})\b\s*<)'
913 - match: '{{non_angle_brackets}}'
915 - include: angle-brackets
916 - include: types
918 - match: '({{identifier}})\s*(\()(?=[^\)]+\))'
923 - meta_scope: meta.function-call.c++
924 - meta_content_scope: meta.group.c++
925 - match: '\)'
928 - include: expressions
929 - match: '(?={{path_lookahead}}\s*\()'
931 - include: function-call
932 - match: ''
934 - include: variables
935 - include: constants
936 - include: identifiers
937 - match: (?=\W)
940 global-maybe-function:
941 - include: comments
943 - match: \*|&
945- match: '(?=\b({{control_keywords}}|{{operator_keywords}}|{{casts}}|{{memory_operators}}|{{other_…
947 - match: '\b({{type_qualifier}})\b'
949 - match: '{{non_angle_brackets}}'
951 - include: angle-brackets
952 - include: types
953 - include: modifiers-parens
954 - include: modifiers
956 - match: '[[:upper:][:digit:]_]+\s*$'
958- match: '(?=({{path_lookahead}}\s*(?:{{generic_lookahead}})?::\s*)?{{operator_method_name}}\s*(\(…
960 - meta_content_scope: meta.function.c++ entity.name.function.c++
961 - include: identifiers
962 - match: '(?=\s*(\(|$))'
963 set: function-definition-params
964 # Identifier that is not the function name - likely a macro or type
965 - match: '(?={{path_lookahead}}([ \t]+|[*&])(?!\s*(<|::|\(|$)))'
967 - include: identifiers
968 - match: ''
971 - match: '(?={{path_lookahead}}({{generic_lookahead}}({{path_lookahead}})?)\s*(\(|$))'
972 set: [function-definition-params, global-function-identifier-generic]
973 - match: '(?={{path_lookahead}}\s*(\(|$))'
974 set: [function-definition-params, global-function-identifier]
975 - match: '(?={{path_lookahead}}\s*::\s*$)'
976 set: [function-definition-params, global-function-identifier]
977 - match: '(?=\S)'
980 global-function-identifier-generic:
981 - include: angle-brackets
982 - match: '::'
984 - match: '(?={{identifier}}<.*>\s*\()'
986 - meta_content_scope: entity.name.function.c++
987 - include: identifiers
988 - match: '(?=<)'
990 - match: '(?={{identifier}}\s*\()'
992 - meta_content_scope: entity.name.function.c++
993 - include: identifiers
994 - match: ''
996 - match: '(?=\()'
999 global-function-identifier:
1000 - meta_content_scope: entity.name.function.c++
1001 - include: identifiers
1002 - match: '(?=\S)'
1005 function-definition-params:
1006 - meta_content_scope: meta.function.c++
1007 - include: comments
1008 - match: '(?=\()'
1010 - match: \(
1013 - meta_content_scope: meta.function.parameters.c++ meta.group.c++
1014 - match : \)
1016 set: function-definition-continue
1017 - match: '\bvoid\b'
1019 - match: '{{identifier}}(?=\s*(\[|,|\)|=))'
1021 - match: '='
1024 - match: '(?=,|\))'
1026 - include: expressions-minus-generic-type
1027 - include: scope:source.c#preprocessor-line-continuation
1028 - include: expressions-minus-generic-type
1029 - include: scope:source.c#preprocessor-line-continuation
1030 - match: (?=\S)
1033 function-definition-continue:
1034 - meta_content_scope: meta.function.c++
1035 - include: comments
1036 - match: '(?=;)'
1038 - match: '->'
1040 set: function-definition-trailing-return
1041 - include: function-specifiers
1042 - match: '='
1044 - match: '&'
1046 - match: \b0\b
1048 - match: \b(default|delete)\b
1050 - match: '(?=\{)'
1051 set: function-definition-body
1052 - match: '(?=\S)'
1055 function-definition-trailing-return:
1056 - include: comments
1057 - match: '(?=;)'
1059 - match: '(?=\{)'
1060 set: function-definition-body
1061 - include: function-specifiers
1062 - include: function-trailing-return-type
1064 function-definition-body:
1065 - meta_content_scope: meta.function.c++ meta.block.c++
1066 - match: '\{'
1069 - meta_content_scope: meta.function.c++ meta.block.c++
1070 - match: '\}'
1073 - match: (?=^\s*#\s*(elif|else|endif)\b)
1075 - match: '(?=({{before_tag}})([^(;]+$|.*\{))'
1076 push: data-structures
1077 - include: statements
1081 data-structures:
1082 - match: '\bclass\b'
1084 set: data-structures-class-definition
1086 - match: '\b({{before_tag}})(?=\s+{{path_lookahead}}\s+{{path_lookahead}}\s*[=;\[])'
1088 - match: '\bstruct\b'
1090 set: data-structures-struct-definition
1091 - match: '\benum(\s+(class|struct))?\b'
1093 set: data-structures-enum-definition
1094 - match: '\bunion\b'
1096 set: data-structures-union-definition
1097 - match: '(?=\S)'
1100 preprocessor-workaround-eat-macro-before-identifier:
1102 - match: ({{macro_identifier}})(?=\s+~?{{identifier}})
1104 1: meta.assumed-macro.c
1106 data-structures-class-definition:
1107 - meta_scope: meta.class.c++
1108 - include: data-structures-definition-common-begin
1109 - match: '{{identifier}}(?={{data_structures_forward_decl_lookahead}})'
1110 scope: entity.name.class.forward-decl.c++
1111 set: data-structures-class-definition-after-identifier
1112 - match: '{{identifier}}'
1114 set: data-structures-class-definition-after-identifier
1115 - match: '(?=[:{])'
1116 set: data-structures-class-definition-after-identifier
1117 - match: '(?=;)'
1120 data-structures-class-definition-after-identifier:
1121 - meta_content_scope: meta.class.c++
1122 - include: data-structures-definition-common-begin
1124 - include: data-structures-definition-common-end
1125 - match: '\{'
1128 - meta_content_scope: meta.class.c++ meta.block.c++
1129 - match: '\}'
1132 - include: data-structures-body
1134 data-structures-struct-definition:
1135 - meta_scope: meta.struct.c++
1136 - include: data-structures-definition-common-begin
1137 - match: '{{identifier}}(?={{data_structures_forward_decl_lookahead}})'
1138 scope: entity.name.struct.forward-decl.c++
1139 set: data-structures-struct-definition-after-identifier
1140 - match: '{{identifier}}'
1142 set: data-structures-struct-definition-after-identifier
1143 - match: '(?=[:{])'
1144 set: data-structures-struct-definition-after-identifier
1145 - match: '(?=;)'
1148 data-structures-struct-definition-after-identifier:
1149 - meta_content_scope: meta.struct.c++
1150 - include: data-structures-definition-common-begin
1152 - include: data-structures-definition-common-end
1153 - match: '\{'
1156 - meta_content_scope: meta.struct.c++ meta.block.c++
1157 - match: '\}'
1160 - include: data-structures-body
1162 data-structures-enum-definition:
1163 - meta_scope: meta.enum.c++
1164 - include: data-structures-definition-common-begin
1165 - match: '{{identifier}}(?={{data_structures_forward_decl_lookahead}})'
1166 scope: entity.name.enum.forward-decl.c++
1167 set: data-structures-enum-definition-after-identifier
1168 - match: '{{identifier}}'
1170 set: data-structures-enum-definition-after-identifier
1171 - match: '(?=[:{])'
1172 set: data-structures-enum-definition-after-identifier
1173 - match: '(?=;)'
1176 data-structures-enum-definition-after-identifier:
1177 - meta_content_scope: meta.enum.c++
1178 - include: data-structures-definition-common-begin
1180 - include: data-structures-definition-common-end
1181 - match: '\{'
1184 - meta_content_scope: meta.enum.c++ meta.block.c++
1186 - match: '\}'
1189 - include: statements
1191 data-structures-union-definition:
1192 - meta_scope: meta.union.c++
1193 - include: data-structures-definition-common-begin
1194 - match: '{{identifier}}(?={{data_structures_forward_decl_lookahead}})'
1195 scope: entity.name.union.forward-decl.c++
1196 set: data-structures-union-definition-after-identifier
1197 - match: '{{identifier}}'
1199 set: data-structures-union-definition-after-identifier
1200 - match: '(?=[{])'
1201 set: data-structures-union-definition-after-identifier
1202 - match: '(?=;)'
1205 data-structures-union-definition-after-identifier:
1206 - meta_content_scope: meta.union.c++
1207 - include: data-structures-definition-common-begin
1210 - include: angle-brackets
1211 - match: '\{'
1214 - meta_content_scope: meta.union.c++ meta.block.c++
1215 - match: '\}'
1218 - include: data-structures-body
1219 - match: '(?=;)'
1222 data-structures-definition-common-begin:
1223 - include: comments
1224 - match: '(?=\b(?:{{before_tag}}|{{control_keywords}})\b)'
1226 - include: preprocessor-other
1227 - include: modifiers-parens
1228 - include: modifiers
1229 - include: preprocessor-workaround-eat-macro-before-identifier
1231 data-structures-definition-common-end:
1232 - include: angle-brackets
1233 - match: \bfinal\b
1235 - match: ':'
1238 - include: comments
1239 - include: preprocessor-other
1240 - include: modifiers-parens
1241 - include: modifiers
1242 - match: '\b(virtual|{{visibility_modifiers}})\b'
1244 - match: (?={{path_lookahead}})
1246 - meta_scope: entity.other.inherited-class.c++
1247 - include: identifiers
1248 - match: ''
1250 - include: angle-brackets
1251 - match: ','
1253 - match: (?=\{|;)
1255 - match: '(?=;)'
1258 data-structures-body:
1259 - include: preprocessor-data-structures
1260 - match: '(?=\btemplate\b)'
1262 - include: template
1263 - match: (?=\S)
1264 set: data-structures-modifier
1265 - include: typedef
1266 - match: \b({{visibility_modifiers}})\s*(:)(?!:)
1270 - match: '^\s*(?=(?:~?\w+|::))'
1271 push: data-structures-modifier
1272 - include: expressions-minus-generic-type
1274 data-structures-modifier:
1275 - match: '\bfriend\b'
1278 - match: (?=;)
1280 - match: '\{'
1283 - meta_scope: meta.block.c++
1284 - match: '\}'
1287 - include: statements
1288 - match: '\b({{before_tag}})\b'
1290 - include: expressions-minus-function-call
1291 - include: comments
1292 - include: modifiers-parens
1293 - include: modifiers
1294 - match: '\bstatic_assert(?=\s*\()'
1295 scope: meta.static-assert.c++ keyword.operator.word.c++
1297 - match: '\('
1300 - meta_content_scope: meta.function-call.c++ meta.group.c++
1301 - match: '\)'
1302 scope: meta.function-call.c++ meta.group.c++ punctuation.section.group.end.c++
1304 - include: expressions
1306 - match: '(?:{{identifier}}\s*(::)\s*)?~{{identifier}}(?=\s*(\(|$))'
1310 set: method-definition-params
1312 - match: '({{identifier}})\s*(\()(?=\s*(?!void){{identifier}}\s*[),])'
1317 - meta_scope: meta.function-call.c++
1318 - meta_content_scope: meta.group.c++
1319 - match: '\)'
1322 - include: expressions
1324 - include: preprocessor-workaround-eat-macro-before-identifier
1325 - match: '((?!{{before_tag}}|template){{identifier}})(?=\s*\()'
1327 set: method-definition-params
1329 - match: '({{identifier}}\s*(::)\s*{{identifier}})(?=\s*\()'
1333 push: method-definition-params
1334 - match: '(?=\S)'
1335 set: data-structures-type
1337 data-structures-type:
1338 - include: comments
1339 - match: \*|&
1342 - match: '(operator)\s+({{identifier}})(?=\s*(\(|$))'
1346 set: method-definition-params
1347- match: '(?=\b({{control_keywords}}|{{operator_keywords}}|{{casts}}|{{memory_operators}}|{{other_…
1349 - match: '(?=\s)'
1350 set: data-structures-maybe-method
1353 - match: |-
1366 - include: identifiers
1367 - match: ''
1368 set: data-structures-maybe-method
1369 # The previous match handles return types of struct/enum/etc from a func,
1371 - match: '(?=\b({{before_tag}})\b)'
1372 set: data-structures
1373 - match: '(?=\b({{casts}})\b\s*<)'
1375 - match: '{{non_angle_brackets}}'
1377 - include: angle-brackets
1378 - include: types
1379 - include: variables
1380 - include: constants
1381 - include: identifiers
1382 - match: (?=[&*])
1383 set: data-structures-maybe-method
1384 - match: (?=\W)
1387 data-structures-maybe-method:
1388 - include: comments
1390 - match: \*|&
1392- match: '(?=\b({{control_keywords}}|{{operator_keywords}}|{{casts}}|{{memory_operators}}|{{other_…
1394 - match: '\b({{type_qualifier}})\b'
1396 - match: '{{non_angle_brackets}}'
1398 - include: angle-brackets
1399 - include: types
1400 - include: modifiers-parens
1401 - include: modifiers
1403 - match: '{{operator_method_name}}(?=\s*(\(|$))'
1405 set: method-definition-params
1406 # Identifier that is not the function name - likely a macro or type
1407 - match: '(?={{path_lookahead}}([ \t]+|[*&])(?!\s*(<|::|\()))'
1409 - include: identifiers
1410 - match: ''
1413 - match: '(?={{path_lookahead}}({{generic_lookahead}})\s*(\())'
1414 set: [method-definition-params, data-structures-function-identifier-generic]
1415 - match: '(?={{path_lookahead}}\s*(\())'
1416 set: [method-definition-params, data-structures-function-identifier]
1417 - match: '(?={{path_lookahead}}\s*::\s*$)'
1418 set: [method-definition-params, data-structures-function-identifier]
1419 - match: '(?=\S)'
1422 data-structures-function-identifier-generic:
1423 - include: angle-brackets
1424 - match: '(?={{identifier}})'
1426 - meta_content_scope: entity.name.function.c++
1427 - include: identifiers
1428 - match: '(?=<)'
1430 - match: '(?=\()'
1433 data-structures-function-identifier:
1434 - meta_content_scope: entity.name.function.c++
1435 - include: identifiers
1436 - match: '(?=\S)'
1439 method-definition-params:
1440 - meta_content_scope: meta.method.c++
1441 - include: comments
1442 - match: '(?=\()'
1444 - match: \(
1447 - meta_content_scope: meta.method.parameters.c++ meta.group.c++
1448 - match : \)
1450 set: method-definition-continue
1451 - match: '\bvoid\b'
1453 - match: '{{identifier}}(?=\s*(\[|,|\)|=))'
1455 - match: '='
1458 - match: '(?=,|\))'
1460 - include: expressions-minus-generic-type
1461 - include: expressions-minus-generic-type
1462 - match: '(?=\S)'
1465 method-definition-continue:
1466 - meta_content_scope: meta.method.c++
1467 - include: comments
1468 - match: '(?=;)'
1470 - match: '->'
1472 set: method-definition-trailing-return
1473 - include: function-specifiers
1474 - match: '='
1476 - match: '&'
1478 - match: \b0\b
1480 - match: \b(default|delete)\b
1482 - match: '(?=:)'
1484 - match: ':'
1485 scope: punctuation.separator.initializer-list.c++
1487 - meta_scope: meta.method.constructor.initializer-list.c++
1488 - match: '{{identifier}}'
1491 - match: \(
1494 - meta_content_scope: meta.group.c++
1495 - match: \)
1498 - include: expressions
1499 - match: \{
1502 - meta_content_scope: meta.group.c++
1503 - match: \}
1506 - include: expressions
1507 - include: comments
1508 - match: (?=\{|;)
1509 set: method-definition-continue
1510 - include: expressions
1511 - match: '(?=\{)'
1512 set: method-definition-body
1513 - match: '(?=\S)'
1516 method-definition-trailing-return:
1517 - include: comments
1518 - match: '(?=;)'
1520 - match: '(?=\{)'
1521 set: method-definition-body
1522 - include: function-specifiers
1523 - include: function-trailing-return-type
1525 method-definition-body:
1526 - meta_content_scope: meta.method.c++ meta.block.c++
1527 - match: '\{'
1530 - meta_content_scope: meta.method.c++ meta.block.c++
1531 - match: '\}'
1534 - match: (?=^\s*#\s*(elif|else|endif)\b)
1536 - match: '(?=({{before_tag}})([^(;]+$|.*\{))'
1537 push: data-structures
1538 - include: statements
1540 ## Preprocessor for data-structures
1542 preprocessor-data-structures:
1543 - include: preprocessor-rule-enabled-data-structures
1544 - include: preprocessor-rule-disabled-data-structures
1545 - include: preprocessor-practical-workarounds
1547 preprocessor-rule-disabled-data-structures:
1548 - match: ^\s*((#if)\s+(0))\b
1554 - match: ^\s*(#\s*endif)\b
1558 - match: ^\s*(#\s*else)\b
1562 - match: (?=^\s*#\s*endif\b)
1564 - include: negated-block
1565 - include: data-structures-body
1566 - match: ""
1568 - meta_scope: comment.block.preprocessor.if-branch.c++
1569 - match: (?=^\s*#\s*(else|endif)\b)
1571 - include: scope:source.c#preprocessor-disabled
1573 preprocessor-rule-enabled-data-structures:
1574 - match: ^\s*((#if)\s+(0*1))\b
1580 - match: ^\s*(#\s*endif)\b
1584 - match: ^\s*(#\s*else)\b
1588 - meta_content_scope: comment.block.preprocessor.else-branch.c++
1589 - match: (?=^\s*#\s*endif\b)
1591 - include: scope:source.c#preprocessor-disabled
1592 - match: ""
1594 - match: (?=^\s*#\s*(else|endif)\b)
1596 - include: negated-block
1597 - include: data-structures-body
1601 preprocessor-global:
1602 - include: preprocessor-rule-enabled-global
1603 - include: preprocessor-rule-disabled-global
1604 - include: preprocessor-rule-other-global
1606 preprocessor-statements:
1607 - include: preprocessor-rule-enabled-statements
1608 - include: preprocessor-rule-disabled-statements
1609 - include: preprocessor-rule-other-statements
1611 preprocessor-expressions:
1612 - include: scope:source.c#incomplete-inc
1613 - include: preprocessor-macro-define
1614 - include: scope:source.c#pragma-mark
1615 - include: preprocessor-other
1617 preprocessor-rule-disabled-global:
1618 - match: ^\s*((#if)\s+(0))\b
1624 - match: ^\s*(#\s*endif)\b
1628 - match: ^\s*(#\s*else)\b
1632 - match: (?=^\s*#\s*endif\b)
1634 - include: preprocessor-global
1635 - include: negated-block
1636 - include: global
1637 - match: ""
1639 - meta_scope: comment.block.preprocessor.if-branch.c++
1640 - match: (?=^\s*#\s*(else|endif)\b)
1642 - include: scope:source.c#preprocessor-disabled
1644 preprocessor-rule-enabled-global:
1645 - match: ^\s*((#if)\s+(0*1))\b
1651 - match: ^\s*(#\s*endif)\b
1655 - match: ^\s*(#\s*else)\b
1659 - meta_content_scope: comment.block.preprocessor.else-branch.c++
1660 - match: (?=^\s*#\s*endif\b)
1662 - include: scope:source.c#preprocessor-disabled
1663 - match: ""
1665 - match: (?=^\s*#\s*(else|endif)\b)
1667 - include: preprocessor-global
1668 - include: negated-block
1669 - include: global
1671 preprocessor-rule-other-global:
1672 - match: ^\s*(#\s*(?:if|ifdef|ifndef))\b
1676 - meta_scope: meta.preprocessor.c++
1677 - include: scope:source.c#preprocessor-line-continuation
1678 - include: scope:source.c#preprocessor-comments
1679 - match: \bdefined\b
1686 - match: $\n
1687 set: preprocessor-if-branch-global
1692 preprocessor-if-branch-global:
1693 - match: ^\s*(#\s*endif)\b
1697 - match: (?=^\s*#\s*(elif|else)\b)
1698 push: preprocessor-elif-else-branch-global
1699 - match: \{
1701 set: preprocessor-block-if-branch-global
1702 - include: preprocessor-global
1703 - include: negated-block
1704 - include: global
1706 preprocessor-block-if-branch-global:
1707 - meta_scope: meta.block.c++
1708 - match: ^\s*(#\s*endif)\b
1711 set: preprocessor-block-finish-global
1712 - match: (?=^\s*#\s*(elif|else)\b)
1713 push: preprocessor-elif-else-branch-global
1714 - match: \}
1716 set: preprocessor-if-branch-global
1717 - include: statements
1719 preprocessor-block-finish-global:
1720 - meta_scope: meta.block.c++
1721 - match: ^\s*(#\s*(?:if|ifdef|ifndef))\b
1724 set: preprocessor-block-finish-if-branch-global
1725 - match: \}
1728 - include: statements
1730 preprocessor-block-finish-if-branch-global:
1731 - match: ^\s*(#\s*endif)\b
1735 - match: \}
1737 set: preprocessor-if-branch-global
1738 - include: statements
1740 preprocessor-elif-else-branch-global:
1741 - match: (?=^\s*#\s*(endif)\b)
1743 - include: preprocessor-global
1744 - include: negated-block
1745 - include: global
1749 preprocessor-rule-disabled-statements:
1750 - match: ^\s*((#if)\s+(0))\b
1756 - match: ^\s*(#\s*endif)\b
1760 - match: ^\s*(#\s*else)\b
1764 - match: (?=^\s*#\s*endif\b)
1766 - include: negated-block
1767 - include: statements
1768 - match: ""
1770 - meta_scope: comment.block.preprocessor.if-branch.c++
1771 - match: (?=^\s*#\s*(else|endif)\b)
1773 - include: scope:source.c#preprocessor-disabled
1775 preprocessor-rule-enabled-statements:
1776 - match: ^\s*((#if)\s+(0*1))\b
1782 - match: ^\s*(#\s*endif)\b
1786 - match: ^\s*(#\s*else)\b
1790 - meta_content_scope: comment.block.preprocessor.else-branch.c++
1791 - match: (?=^\s*#\s*endif\b)
1793 - include: scope:source.c#preprocessor-disabled
1794 - match: ""
1796 - match: (?=^\s*#\s*(else|endif)\b)
1798 - include: negated-block
1799 - include: statements
1801 preprocessor-rule-other-statements:
1802 - match: ^\s*(#\s*(?:if|ifdef|ifndef))\b
1806 - meta_scope: meta.preprocessor.c++
1807 - include: scope:source.c#preprocessor-line-continuation
1808 - include: scope:source.c#preprocessor-comments
1809 - match: \bdefined\b
1816 - match: $\n
1817 set: preprocessor-if-branch-statements
1822 preprocessor-if-branch-statements:
1823 - match: ^\s*(#\s*endif)\b
1827 - match: (?=^\s*#\s*(elif|else)\b)
1828 push: preprocessor-elif-else-branch-statements
1829 - match: \{
1831 set: preprocessor-block-if-branch-statements
1832 - match: (?=(?!{{non_func_keywords}}){{path_lookahead}}\s*\()
1833 set: preprocessor-if-branch-function-call
1834 - include: negated-block
1835 - include: statements
1837 preprocessor-if-branch-function-call:
1838 - meta_content_scope: meta.function-call.c++
1839 - include: scope:source.c#c99
1840 - match: '(?:(::)\s*)?{{identifier}}\s*(::)\s*'
1845 - match: '(?:(::)\s*)?{{identifier}}'
1849 - match: '\('
1851 set: preprocessor-if-branch-function-call-arguments
1853 preprocessor-if-branch-function-call-arguments:
1854 - meta_content_scope: meta.function-call.c++ meta.group.c++
1855 - match : \)
1856 scope: meta.function-call.c++ meta.group.c++ punctuation.section.group.end.c++
1857 set: preprocessor-if-branch-statements
1858 - match: ^\s*(#\s*(?:elif|else))\b
1861 set: preprocessor-if-branch-statements
1862 - match: ^\s*(#\s*endif)\b
1865 set: preprocessor-if-branch-function-call-arguments-finish
1866 - include: expressions
1868 preprocessor-if-branch-function-call-arguments-finish:
1869 - meta_content_scope: meta.function-call.c++ meta.group.c++
1870 - match: \)
1871 scope: meta.function-call.c++ meta.group.c++ punctuation.section.group.end.c++
1873 - include: expressions
1875 preprocessor-block-if-branch-statements:
1876 - meta_scope: meta.block.c++
1877 - match: ^\s*(#\s*endif)\b
1880 set: preprocessor-block-finish-statements
1881 - match: (?=^\s*#\s*(elif|else)\b)
1882 push: preprocessor-elif-else-branch-statements
1883 - match: \}
1885 set: preprocessor-if-branch-statements
1886 - include: statements
1888 preprocessor-block-finish-statements:
1889 - meta_scope: meta.block.c++
1890 - match: ^\s*(#\s*(?:if|ifdef|ifndef))\b
1893 set: preprocessor-block-finish-if-branch-statements
1894 - match: \}
1897 - include: statements
1899 preprocessor-block-finish-if-branch-statements:
1900 - match: ^\s*(#\s*endif)\b
1904 - match: \}
1906 set: preprocessor-if-branch-statements
1907 - include: statements
1909 preprocessor-elif-else-branch-statements:
1910 - match: (?=^\s*#\s*endif\b)
1912 - include: negated-block
1913 - include: statements
1917 negated-block:
1918 - match: '\}'
1921 - match: '\{'
1924 - match: (?=^\s*#\s*(elif|else|endif)\b)
1926 - include: statements
1928 preprocessor-macro-define:
1929 - match: ^\s*(\#\s*define)\b
1933 - meta_content_scope: meta.preprocessor.macro.c++
1934 - include: scope:source.c#preprocessor-line-continuation
1935 - include: scope:source.c#preprocessor-line-ending
1936 - include: scope:source.c#preprocessor-comments
1937 - match: '({{identifier}})(?=\()'
1940 - match: '\('
1942 set: preprocessor-macro-params
1943 - match: '{{identifier}}'
1945 set: preprocessor-macro-definition
1947 preprocessor-macro-params:
1948 - meta_scope: meta.preprocessor.macro.parameters.c++ meta.group.c++
1949 - match: '{{identifier}}'
1951 - match: \)
1953 set: preprocessor-macro-definition
1954 - match: ','
1957 - match: '{{identifier}}'
1960 - include: scope:source.c#preprocessor-line-continuation
1961 - include: scope:source.c#preprocessor-comments
1962 - match: '\.\.\.'
1964 - match: '(?=\))'
1966 - match: (/\*).*(\*/)
1971 - match: '\S+'
1972 scope: invalid.illegal.unexpected-character.c++
1973 - include: scope:source.c#preprocessor-line-continuation
1974 - include: scope:source.c#preprocessor-comments
1975 - match: '\.\.\.'
1977 - match: (/\*).*(\*/)
1982 - match: $\n
1983 scope: invalid.illegal.unexpected-end-of-line.c++
1985 preprocessor-macro-definition:
1986 - meta_content_scope: meta.preprocessor.macro.c++
1987 - include: scope:source.c#preprocessor-line-continuation
1988 - include: scope:source.c#preprocessor-line-ending
1989 - include: scope:source.c#preprocessor-comments
1991 - match: '\{'
1993 - match: '\}'
1995 - include: expressions
1997 preprocessor-practical-workarounds:
1998 - include: preprocessor-convention-ignore-uppercase-ident-lines
1999 - include: scope:source.c#preprocessor-convention-ignore-uppercase-calls-without-semicolon
2001 preprocessor-convention-ignore-uppercase-ident-lines:
2002 - match: ^(\s*{{macro_identifier}})+\s*$
2003 scope: meta.assumed-macro.c++
2007 - match: '(?={{path_lookahead}}({{generic_lookahead}}({{path_lookahead}})?)\s*\()'
2008 set: [function-definition-params, global-function-identifier-generic]
2009 - match: '(?={{path_lookahead}}\s*\()'
2010 set: [function-definition-params, global-function-identifier]
2011 - match: ^
2014 preprocessor-other:
2015 - match: ^\s*(#\s*(?:if|ifdef|ifndef|elif|else|line|pragma|undef))\b
2019 - meta_scope: meta.preprocessor.c++
2020 - include: scope:source.c#preprocessor-line-continuation
2021 - include: scope:source.c#preprocessor-line-ending
2022 - include: scope:source.c#preprocessor-comments
2023 - match: \bdefined\b
2025 - match: ^\s*(#\s*endif)\b
2028 - match: ^\s*(#\s*(?:error|warning))\b
2032 - meta_scope: meta.preprocessor.diagnostic.c++
2033 - include: scope:source.c#preprocessor-line-continuation
2034 - include: scope:source.c#preprocessor-line-ending
2035 - include: scope:source.c#preprocessor-comments
2036 - include: strings
2037 - match: '\S+'
2039 - match: ^\s*(#\s*(?:include|include_next|import))\b
2043 - meta_scope: meta.preprocessor.include.c++
2044 - include: scope:source.c#preprocessor-line-continuation
2045 - include: scope:source.c#preprocessor-line-ending
2046 - include: scope:source.c#preprocessor-comments
2047 - match: '"'
2050 - meta_scope: string.quoted.double.include.c++
2051 - match: '"'
2054 - match: <
2057 - meta_scope: string.quoted.other.lt-gt.include.c++
2058 - match: '>'
2061 - include: preprocessor-practical-workarounds