2016-04-12 09:32:01 +00:00
{
2017-05-25 10:26:41 +00:00
"information_for_contributors" : [
2019-03-04 10:15:47 +00:00
"This file has been converted from https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master//syntaxes/c.tmLanguage.json" ,
2017-05-25 10:26:41 +00:00
"If you want to provide a fix or improvement, please create a pull request against the original repository." ,
"Once accepted there, we are happy to receive an update request."
] ,
2019-11-04 13:11:27 +00:00
"version" : "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/d937b80a19706d518e5fe52357d7c50d34a26e60" ,
2016-08-09 09:41:00 +00:00
"name" : "C" ,
2018-02-12 15:54:35 +00:00
"scopeName" : "source.c" ,
2016-08-09 09:41:00 +00:00
"patterns" : [
{
"include" : "#preprocessor-rule-enabled"
} ,
{
"include" : "#preprocessor-rule-disabled"
} ,
{
2017-03-11 00:01:42 +00:00
"include" : "#preprocessor-rule-conditional"
2016-08-09 09:41:00 +00:00
} ,
2019-09-02 09:39:10 +00:00
{
"include" : "#predefined_macros"
} ,
2016-08-09 09:41:00 +00:00
{
"include" : "#comments"
} ,
{
2019-04-25 09:20:23 +00:00
"include" : "#switch_statement"
} ,
{
"match" : "\\b(break|continue|do|else|for|goto|if|_Pragma|return|while)\\b" ,
2016-08-09 09:41:00 +00:00
"name" : "keyword.control.c"
} ,
{
2017-03-11 00:01:42 +00:00
"include" : "#storage_types"
2016-08-09 09:41:00 +00:00
} ,
2019-04-11 09:05:55 +00:00
{
"match" : "typedef" ,
"name" : "keyword.other.typedef.c"
} ,
2016-08-09 09:41:00 +00:00
{
"match" : "\\b(const|extern|register|restrict|static|volatile|inline)\\b" ,
"name" : "storage.modifier.c"
} ,
{
"match" : "\\bk[A-Z]\\w*\\b" ,
"name" : "constant.other.variable.mac-classic.c"
} ,
{
"match" : "\\bg[A-Z]\\w*\\b" ,
"name" : "variable.other.readwrite.global.mac-classic.c"
} ,
{
"match" : "\\bs[A-Z]\\w*\\b" ,
"name" : "variable.other.readwrite.static.mac-classic.c"
} ,
{
"match" : "\\b(NULL|true|false|TRUE|FALSE)\\b" ,
"name" : "constant.language.c"
} ,
{
2016-10-18 07:46:07 +00:00
"include" : "#operators"
2016-08-09 09:41:00 +00:00
} ,
{
"include" : "#numbers"
} ,
{
"include" : "#strings"
} ,
{
2019-09-02 09:39:10 +00:00
"name" : "meta.preprocessor.macro.c" ,
"begin" : "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((#)\\s*define\\b)\\s+((?<!\\w)[a-zA-Z_]\\w*(?!\\w))(?:(\\()([^()\\\\]+)(\\)))?" ,
2016-08-09 09:41:00 +00:00
"beginCaptures" : {
"1" : {
2019-09-02 09:39:10 +00:00
"patterns" : [
{
"include" : "#inline_comment"
}
]
2016-08-09 09:41:00 +00:00
} ,
"2" : {
2019-09-02 09:39:10 +00:00
"name" : "comment.block.c punctuation.definition.comment.begin.c"
2016-08-09 09:41:00 +00:00
} ,
"3" : {
2019-09-02 09:39:10 +00:00
"name" : "comment.block.c"
} ,
"4" : {
"patterns" : [
{
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
} ,
{
"match" : "\\*" ,
"name" : "comment.block.c"
}
]
2016-08-09 09:41:00 +00:00
} ,
"5" : {
2019-09-02 09:39:10 +00:00
"name" : "keyword.control.directive.define.c"
2016-08-09 09:41:00 +00:00
} ,
"6" : {
2019-09-02 09:39:10 +00:00
"name" : "punctuation.definition.directive.c"
} ,
"7" : {
"name" : "entity.name.function.preprocessor.c"
2016-08-09 09:41:00 +00:00
} ,
"8" : {
2019-09-02 09:39:10 +00:00
"name" : "punctuation.definition.parameters.begin.c"
2016-08-09 09:41:00 +00:00
} ,
"9" : {
2019-09-02 09:39:10 +00:00
"patterns" : [
{
"match" : "(?<=[(,])\\s*((?<!\\w)[a-zA-Z_]\\w*(?!\\w))\\s*" ,
"captures" : {
"1" : {
"name" : "variable.parameter.preprocessor.c"
}
}
} ,
{
"match" : "," ,
"name" : "punctuation.separator.parameters.c"
} ,
{
"match" : "\\.\\.\\." ,
"name" : "ellipses.c punctuation.vararg-ellipses.variable.parameter.preprocessor.c"
}
]
} ,
"10" : {
2016-08-09 09:41:00 +00:00
"name" : "punctuation.definition.parameters.end.c"
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?<!\\\\)(?=\\n)" ,
2016-08-09 09:41:00 +00:00
"patterns" : [
{
2017-03-11 00:01:42 +00:00
"include" : "#preprocessor-rule-define-line-contents"
2016-08-09 09:41:00 +00:00
}
]
} ,
{
2019-03-04 10:15:47 +00:00
"begin" : "^\\s*((#)\\s*(error|warning))\\b\\s*" ,
"beginCaptures" : {
2016-08-09 09:41:00 +00:00
"1" : {
"name" : "keyword.control.directive.diagnostic.$3.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-03-04 10:15:47 +00:00
"end" : "(?<!\\\\)(?=\\n)" ,
2016-08-09 09:41:00 +00:00
"name" : "meta.preprocessor.diagnostic.c" ,
"patterns" : [
2017-03-11 00:01:42 +00:00
{
2019-03-04 10:15:47 +00:00
"begin" : "\"" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.definition.string.begin.c"
}
} ,
"end" : "\"|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.definition.string.end.c"
}
} ,
"name" : "string.quoted.double.c" ,
"patterns" : [
{
"include" : "#line_continuation_character"
}
]
2017-03-11 00:01:42 +00:00
} ,
{
2019-03-04 10:15:47 +00:00
"begin" : "'" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.definition.string.begin.c"
}
} ,
"end" : "'|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.definition.string.end.c"
}
} ,
"name" : "string.quoted.single.c" ,
"patterns" : [
{
"include" : "#line_continuation_character"
}
]
2017-03-11 00:01:42 +00:00
} ,
2016-08-09 09:41:00 +00:00
{
2019-03-04 10:15:47 +00:00
"begin" : "[^'\"]" ,
"end" : "(?<!\\\\)(?=\\s*\\n)" ,
"name" : "string.unquoted.single.c" ,
"patterns" : [
{
"include" : "#line_continuation_character"
} ,
{
"include" : "#comments"
}
]
2016-08-09 09:41:00 +00:00
}
]
} ,
{
2017-03-11 00:01:42 +00:00
"begin" : "^\\s*((#)\\s*(include(?:_next)?|import))\\b\\s*" ,
2016-08-09 09:41:00 +00:00
"beginCaptures" : {
"1" : {
"name" : "keyword.control.directive.$3.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.include.c" ,
"patterns" : [
{
"include" : "#line_continuation_character"
} ,
{
"begin" : "\"" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.definition.string.begin.c"
}
} ,
"end" : "\"" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.definition.string.end.c"
}
} ,
"name" : "string.quoted.double.include.c"
} ,
{
"begin" : "<" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.definition.string.begin.c"
}
} ,
"end" : ">" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.definition.string.end.c"
}
} ,
"name" : "string.quoted.other.lt-gt.include.c"
}
]
} ,
{
"include" : "#pragma-mark"
} ,
{
"begin" : "^\\s*((#)\\s*line)\\b" ,
"beginCaptures" : {
"1" : {
"name" : "keyword.control.directive.line.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#strings"
} ,
{
"include" : "#numbers"
} ,
{
"include" : "#line_continuation_character"
}
]
} ,
{
2017-03-11 00:01:42 +00:00
"begin" : "^\\s*(?:((#)\\s*undef))\\b" ,
2016-08-09 09:41:00 +00:00
"beginCaptures" : {
"1" : {
2017-03-11 00:01:42 +00:00
"name" : "keyword.control.directive.undef.c"
2016-08-09 09:41:00 +00:00
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
2017-03-11 00:01:42 +00:00
}
} ,
"end" : "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"match" : "[a-zA-Z_$][\\w$]*" ,
"name" : "entity.name.function.preprocessor.c"
2016-08-09 09:41:00 +00:00
} ,
2017-03-11 00:01:42 +00:00
{
"include" : "#line_continuation_character"
}
]
} ,
{
"begin" : "^\\s*(?:((#)\\s*pragma))\\b" ,
"beginCaptures" : {
"1" : {
"name" : "keyword.control.directive.pragma.c"
2016-08-09 09:41:00 +00:00
} ,
2017-03-11 00:01:42 +00:00
"2" : {
2016-08-09 09:41:00 +00:00
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)" ,
2017-03-11 00:01:42 +00:00
"name" : "meta.preprocessor.pragma.c" ,
2016-08-09 09:41:00 +00:00
"patterns" : [
2017-03-11 00:01:42 +00:00
{
"include" : "#strings"
} ,
{
"match" : "[a-zA-Z_$][\\w\\-$]*" ,
"name" : "entity.other.attribute-name.pragma.preprocessor.c"
} ,
{
"include" : "#numbers"
} ,
2016-08-09 09:41:00 +00:00
{
"include" : "#line_continuation_character"
}
]
} ,
{
2017-03-11 00:01:42 +00:00
"match" : "\\b(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)\\b" ,
2016-08-09 09:41:00 +00:00
"name" : "support.type.sys-types.c"
} ,
{
"match" : "\\b(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)\\b" ,
"name" : "support.type.pthread.c"
} ,
{
2016-10-18 07:46:07 +00:00
"match" : "(?x) \\b\n(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t\n|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t\n|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t\n|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t\n|uintmax_t|uintmax_t)\n\\b" ,
2016-08-09 09:41:00 +00:00
"name" : "support.type.stdint.c"
} ,
{
"match" : "\\b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\\b" ,
"name" : "support.constant.mac-classic.c"
} ,
{
2016-10-18 07:46:07 +00:00
"match" : "(?x) \\b\n(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam\n|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr\n|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber\n|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64\n|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32\n|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr\n|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\n\\b" ,
2016-08-09 09:41:00 +00:00
"name" : "support.type.mac-classic.c"
} ,
{
"match" : "\\b([A-Za-z0-9_]+_t)\\b" ,
"name" : "support.type.posix-reserved.c"
} ,
{
"include" : "#block"
} ,
{
2017-03-11 00:01:42 +00:00
"include" : "#parens"
} ,
{
2016-08-09 09:41:00 +00:00
"name" : "meta.function.c" ,
2019-11-04 13:11:27 +00:00
"begin" : "(?<!\\w)(?!\\s*(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_int_least64_t|atomic_int_least32_t|pthread_rwlockattr_t|atomic_uint_fast16_t|pthread_mutexattr_t|atomic_int_fast16_t|atomic_uint_fast8_t|atomic_int_fast64_t|atomic_int_least8_t|atomic_int_fast32_t|atomic_int_fast8_t|pthread_condattr_t|pthread_rwlock_t|atomic_uintptr_t|atomic_ptrdiff_t|atomic_uintmax_t|atomic_intmax_t|atomic_char32_t|atomic_intptr_t|atomic_char16_t|pthread_mutex_t|pthread_cond_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_once_t|pthread_attr_t|uint_least8_t|int_least32_t|int_least16_t|pthread_key_t|uint_fast32_t|uint_fast64_t|uint_fast16_t|atomic_size_t|atomic_ushort|atomic_ullong|int_least64_t|atomic_ulong|int_least8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|memory_order|atomic_schar|atomic_uchar|atomic_short|atomic_llong|thread_local|atomic_bool|atomic_uint|atomic_long|int_fast8_t|suseconds_t|atomic_char|atomic_int|useconds_t|_Imaginary|uintmax_t|uintmax_t|in_addr_t|in_port_t|_Noreturn|blksize_t|pthread_t|uintptr_t|volatile|u_quad_t|blkcnt_t|intmax_t|intptr_t|_Complex|uint16_t|uint32_t|uint64_t|_Alignof|_Alignas|continue|unsigned|restrict|intmax_t|register|int64_t|qaddr_t|segsz_t|_Atomic|alignas|default|caddr_t|nlink_t|typedef|u_short|fixpt_t|clock_t|swblk_t|ssize_t|alignof|daddr_t|int16_t|int32_t|uint8_t|struct|mode_t|size_t|time_t|ushort|u_long|u_char|int8_t|double|signed|static|extern|inline|return|switch|xor_eq|and_eq|bitand|not_eq|sizeof|quad_t|uid_t|bitor|union|off_t|key_t|ino_t|compl|u_int|short|const|false|while|float|pid_t|break|_Bool|or_eq|div_t|dev_t|gid_t|id_t|long|case|goto|else|bool|auto|id_t|enum|uint|true|NULL|void|char|for|not|int|and|xor|do|or|if)\\s*\\()(?=[a-zA-Z_]\\w*\\s*\\()" ,
2019-04-11 09:05:55 +00:00
"end" : "(?<=\\))" ,
2016-08-09 09:41:00 +00:00
"patterns" : [
{
2017-03-11 00:01:42 +00:00
"include" : "#function-innards"
2016-08-09 09:41:00 +00:00
}
]
} ,
{
"include" : "#line_continuation_character"
2017-03-11 00:01:42 +00:00
} ,
{
2019-03-04 10:15:47 +00:00
"name" : "meta.bracket.square.access.c" ,
"begin" : "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))?(\\[)(?!\\])" ,
"beginCaptures" : {
2017-03-11 00:01:42 +00:00
"1" : {
2019-03-04 10:15:47 +00:00
"name" : "variable.object.c"
2017-03-11 00:01:42 +00:00
} ,
"2" : {
2019-03-04 10:15:47 +00:00
"name" : "punctuation.definition.begin.bracket.square.c"
}
} ,
"end" : "\\]" ,
"endCaptures" : {
"0" : {
2017-03-11 00:01:42 +00:00
"name" : "punctuation.definition.end.bracket.square.c"
}
2019-03-04 10:15:47 +00:00
} ,
"patterns" : [
{
"include" : "#function-call-innards"
}
]
} ,
{
"name" : "storage.modifier.array.bracket.square.c" ,
"match" : "\\[\\s*\\]"
2017-03-11 00:01:42 +00:00
} ,
{
"match" : ";" ,
"name" : "punctuation.terminator.statement.c"
} ,
{
"match" : "," ,
"name" : "punctuation.separator.delimiter.c"
2016-08-09 09:41:00 +00:00
}
] ,
"repository" : {
2019-10-21 09:21:03 +00:00
"access-method" : {
"name" : "meta.function-call.member.c" ,
"begin" : "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))\\s*(?:(\\.)|(->))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()" ,
"beginCaptures" : {
2019-08-05 10:44:23 +00:00
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "variable.object.c"
2019-09-02 09:39:10 +00:00
} ,
"2" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.separator.dot-access.c"
2019-09-02 09:39:10 +00:00
} ,
"3" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.separator.pointer-access.c"
} ,
"4" : {
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"match" : "\\." ,
"name" : "punctuation.separator.dot-access.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "->" ,
"name" : "punctuation.separator.pointer-access.c"
} ,
{
"match" : "[a-zA-Z_][a-zA-Z_0-9]*" ,
"name" : "variable.object.c"
} ,
{
"name" : "everything.else.c" ,
"match" : ".+"
2019-09-02 09:39:10 +00:00
}
]
2019-10-21 09:21:03 +00:00
} ,
"5" : {
"name" : "entity.name.function.member.c"
} ,
"6" : {
"name" : "punctuation.section.arguments.begin.bracket.round.function.member.c"
2019-08-05 10:44:23 +00:00
}
2019-10-21 09:21:03 +00:00
} ,
"end" : "\\)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.arguments.end.bracket.round.function.member.c"
}
} ,
"patterns" : [
{
"include" : "#function-call-innards"
}
]
2019-08-05 10:44:23 +00:00
} ,
2019-10-21 09:21:03 +00:00
"backslash_escapes" : {
"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} )" ,
"name" : "constant.character.escape.c"
} ,
"block" : {
"patterns" : [
{
"begin" : "{" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.block.begin.bracket.curly.c"
}
} ,
"end" : "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.block.end.bracket.curly.c"
}
} ,
"name" : "meta.block.c" ,
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#block_innards"
2019-09-02 09:39:10 +00:00
}
]
2019-10-21 09:21:03 +00:00
}
]
} ,
"block_innards" : {
"patterns" : [
{
"include" : "#preprocessor-rule-enabled-block"
2019-07-08 14:07:31 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#preprocessor-rule-disabled-block"
2019-07-08 14:07:31 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#preprocessor-rule-conditional-block"
2019-07-08 14:07:31 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#method_access"
} ,
{
"include" : "#member_access"
} ,
{
"include" : "#c_function_call"
} ,
{
"name" : "meta.initialization.c" ,
"begin" : "(?x)\n(?:\n (?:\n\t(?=\\s)(?<!else|new|return)\n\t(?<=\\w) \\s+(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas) # or word + space before name\n )\n)\n(\n (?:[A-Za-z_][A-Za-z0-9_]*+ | :: )++ # actual name\n |\n (?:(?<=operator) (?:[-*&<>=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket" ,
"beginCaptures" : {
"1" : {
"name" : "variable.other.c"
} ,
"2" : {
"name" : "punctuation.section.parens.begin.bracket.round.initialization.c"
}
} ,
"end" : "\\)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.parens.end.bracket.round.initialization.c"
}
} ,
2019-07-08 14:07:31 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#function-call-innards"
}
]
} ,
{
"begin" : "{" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.block.begin.bracket.curly.c"
}
} ,
"end" : "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.block.end.bracket.curly.c"
}
} ,
"patterns" : [
2019-07-08 14:07:31 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#block_innards"
2019-07-08 14:07:31 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#parens-block"
} ,
{
"include" : "$base"
2019-07-01 14:39:15 +00:00
}
2019-10-21 09:21:03 +00:00
]
} ,
"c_conditional_context" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "$self"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#block_innards"
}
]
} ,
"c_function_call" : {
"begin" : "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)" ,
"end" : "(?<=\\))(?!\\w)" ,
"name" : "meta.function-call.c" ,
"patterns" : [
{
"include" : "#function-call-innards"
2019-07-01 14:39:15 +00:00
}
]
2019-03-04 10:15:47 +00:00
} ,
2019-09-02 09:39:10 +00:00
"case_statement" : {
"name" : "meta.conditional.case.c" ,
"begin" : "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)case(?!\\w))" ,
"beginCaptures" : {
"1" : {
"patterns" : [
{
"include" : "#inline_comment"
2019-08-27 09:42:11 +00:00
}
2019-09-02 09:39:10 +00:00
]
} ,
"2" : {
"name" : "comment.block.c punctuation.definition.comment.begin.c"
} ,
"3" : {
"name" : "comment.block.c"
} ,
"4" : {
2019-07-08 14:07:31 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
} ,
{
"match" : "\\*" ,
"name" : "comment.block.c"
2019-07-08 14:07:31 +00:00
}
]
2019-09-02 09:39:10 +00:00
} ,
"5" : {
"name" : "keyword.control.case.c"
2019-03-04 10:15:47 +00:00
}
2019-09-02 09:39:10 +00:00
} ,
"end" : "(:)" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.separator.colon.case.c"
}
} ,
2019-04-11 09:05:55 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"include" : "#evaluation_context"
2019-07-01 14:39:15 +00:00
} ,
2019-08-27 09:42:11 +00:00
{
2019-09-02 09:39:10 +00:00
"include" : "#c_conditional_context"
}
]
} ,
2019-10-21 09:21:03 +00:00
"comments" : {
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"name" : "comment.line.double-slash.documentation.c" ,
"begin" : "(?:^)(?>\\s*)(\\/\\/[!\\/]+)" ,
"beginCaptures" : {
2019-09-02 09:39:10 +00:00
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.definition.comment.documentation.c"
2016-08-09 09:41:00 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "(?<=\\n)(?<!\\\\\\n)" ,
2016-08-09 09:41:00 +00:00
"patterns" : [
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#line_continuation_character"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.italic.doxygen.c"
}
}
2019-09-02 09:39:10 +00:00
} ,
2016-08-09 09:41:00 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.bold.doxygen.c"
}
}
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.inline.raw.string.c"
}
}
} ,
2019-07-08 14:07:31 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "variable.parameter.c"
}
}
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "(?:\\b[A-Z]+:|@[a-z_]+:)" ,
"name" : "storage.type.class.gtkdoc"
2019-09-02 09:39:10 +00:00
}
]
2019-08-27 09:42:11 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"match" : "(\\/\\*[!*]+(?=\\s))(.+)([!*]*\\*\\/)" ,
"captures" : {
"1" : {
"name" : "punctuation.definition.comment.begin.documentation.c"
2019-07-01 14:39:15 +00:00
} ,
2019-10-21 09:21:03 +00:00
"2" : {
"patterns" : [
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.italic.doxygen.c"
}
}
} ,
{
"match" : "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.bold.doxygen.c"
}
}
} ,
{
"match" : "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.inline.raw.string.c"
}
}
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "variable.parameter.c"
}
}
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "(?:\\b[A-Z]+:|@[a-z_]+:)" ,
"name" : "storage.type.class.gtkdoc"
}
]
} ,
"3" : {
"name" : "punctuation.definition.comment.end.documentation.c"
2019-03-04 10:15:47 +00:00
}
2019-10-21 09:21:03 +00:00
} ,
"name" : "comment.block.documentation.c"
2019-09-02 09:39:10 +00:00
} ,
2016-08-09 09:41:00 +00:00
{
2019-10-21 09:21:03 +00:00
"name" : "comment.block.documentation.c" ,
"begin" : "((?>\\s*)\\/\\*[!*]+(?:(?:\\n|$)|(?=\\s)))" ,
2017-03-11 00:01:42 +00:00
"beginCaptures" : {
2019-09-02 09:39:10 +00:00
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.definition.comment.begin.documentation.c"
}
} ,
"end" : "([!*]*\\*\\/)" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.definition.comment.end.documentation.c"
2019-08-27 09:42:11 +00:00
}
} ,
2017-03-11 00:01:42 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"match" : "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
2016-08-09 09:41:00 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.italic.doxygen.c"
}
}
2019-07-01 14:39:15 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
} ,
"2" : {
"name" : "markup.bold.doxygen.c"
}
}
2019-07-01 14:39:15 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)" ,
2019-09-02 09:39:10 +00:00
"captures" : {
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "storage.type.class.doxygen.c"
2019-09-02 09:39:10 +00:00
} ,
"2" : {
2019-10-21 09:21:03 +00:00
"name" : "markup.inline.raw.string.c"
}
}
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)" ,
"captures" : {
"1" : {
"name" : "storage.type.class.doxygen.c"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"2" : {
"name" : "variable.parameter.c"
2019-09-02 09:39:10 +00:00
}
}
2019-10-21 09:21:03 +00:00
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?" ,
"name" : "storage.type.class.doxygen.c"
} ,
{
"match" : "(?:\\b[A-Z]+:|@[a-z_]+:)" ,
"name" : "storage.type.class.gtkdoc"
2019-09-02 09:39:10 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
{
"match" : "^\\/\\* =(\\s*.*?)\\s*= \\*\\/$\\n?" ,
"captures" : {
"1" : {
"name" : "meta.toc-list.banner.block.c"
}
} ,
"name" : "comment.block.banner.c"
} ,
{
"name" : "comment.block.c" ,
"begin" : "(\\/\\*)" ,
"beginCaptures" : {
"1" : {
"name" : "punctuation.definition.comment.begin.c"
}
} ,
"end" : "(\\*\\/)" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.definition.comment.end.c"
}
}
} ,
{
"match" : "^\\/\\/ =(\\s*.*?)\\s*=$\\n?" ,
"captures" : {
"1" : {
"name" : "meta.toc-list.banner.line.c"
}
} ,
"name" : "comment.line.banner.c"
} ,
{
"begin" : "((?:^[ \\t]+)?)(?=\\/\\/)" ,
"beginCaptures" : {
"1" : {
"name" : "punctuation.whitespace.comment.leading.c"
}
} ,
"end" : "(?!\\G)" ,
"patterns" : [
{
"name" : "comment.line.double-slash.c" ,
"begin" : "(\\/\\/)" ,
"beginCaptures" : {
"1" : {
"name" : "punctuation.definition.comment.c"
}
} ,
"end" : "(?=\\n)" ,
"patterns" : [
{
"include" : "#line_continuation_character"
}
]
}
]
2019-09-02 09:39:10 +00:00
}
2019-10-21 09:21:03 +00:00
]
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"default_statement" : {
"name" : "meta.conditional.case.c" ,
"begin" : "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)default(?!\\w))" ,
2019-09-02 09:39:10 +00:00
"beginCaptures" : {
"1" : {
2019-10-21 09:21:03 +00:00
"patterns" : [
{
"include" : "#inline_comment"
}
]
2019-09-02 09:39:10 +00:00
} ,
"2" : {
2019-10-21 09:21:03 +00:00
"name" : "comment.block.c punctuation.definition.comment.begin.c"
2019-09-02 09:39:10 +00:00
} ,
"3" : {
2019-10-21 09:21:03 +00:00
"name" : "comment.block.c"
2019-09-02 09:39:10 +00:00
} ,
"4" : {
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
2019-08-27 09:42:11 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "\\*" ,
"name" : "comment.block.c"
2016-08-09 09:41:00 +00:00
}
]
} ,
2019-09-02 09:39:10 +00:00
"5" : {
2019-10-21 09:21:03 +00:00
"name" : "keyword.control.default.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "(:)" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.separator.colon.case.default.c"
2019-09-02 09:39:10 +00:00
}
} ,
"patterns" : [
2019-08-27 09:42:11 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#evaluation_context"
} ,
{
"include" : "#c_conditional_context"
2019-09-02 09:39:10 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"disabled" : {
"begin" : "^\\s*#\\s*if(n?def)?\\b.*$" ,
"end" : "^\\s*#\\s*endif\\b" ,
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#disabled"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#pragma-mark"
2016-08-09 09:41:00 +00:00
}
2019-08-27 09:42:11 +00:00
]
2016-08-09 09:41:00 +00:00
} ,
2019-10-21 09:21:03 +00:00
"evalutation_context" : {
"patterns" : [
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#function-call-innards"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "$base"
2019-09-02 09:39:10 +00:00
}
2019-10-21 09:21:03 +00:00
]
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"function-call-innards" : {
"patterns" : [
{
"include" : "#comments"
2019-06-04 14:19:37 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#storage_types"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#method_access"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"include" : "#member_access"
} ,
{
"include" : "#operators"
} ,
{
"begin" : "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()" ,
"beginCaptures" : {
"1" : {
"name" : "entity.name.function.c"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"2" : {
"name" : "punctuation.section.arguments.begin.bracket.round.c"
}
} ,
"end" : "\\)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.arguments.end.bracket.round.c"
}
} ,
"patterns" : [
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#function-call-innards"
2019-07-01 14:39:15 +00:00
}
]
2019-06-04 14:19:37 +00:00
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"begin" : "\\(" ,
2019-09-02 09:39:10 +00:00
"beginCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.section.parens.begin.bracket.round.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "\\)" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.section.parens.end.bracket.round.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#function-call-innards"
2019-07-01 14:39:15 +00:00
}
]
2019-10-21 09:21:03 +00:00
} ,
{
"include" : "#block_innards"
2019-07-01 14:39:15 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"function-innards" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#comments"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#storage_types"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#operators"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#vararg_ellipses"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"name" : "meta.function.definition.parameters.c" ,
"begin" : "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "entity.name.function.c"
2019-07-01 14:39:15 +00:00
} ,
"2" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.section.parameters.begin.bracket.round.c"
2019-07-01 14:39:15 +00:00
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "\\)" ,
2019-07-01 14:39:15 +00:00
"endCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.section.parameters.end.bracket.round.c"
2019-07-01 14:39:15 +00:00
}
} ,
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#probably_a_parameter"
} ,
{
"include" : "#function-innards"
2019-09-02 09:39:10 +00:00
}
]
} ,
{
2019-10-21 09:21:03 +00:00
"begin" : "\\(" ,
2019-09-02 09:39:10 +00:00
"beginCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.section.parens.begin.bracket.round.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "\\)" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.section.parens.end.bracket.round.c"
2019-09-02 09:39:10 +00:00
}
} ,
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#function-innards"
2019-09-02 09:39:10 +00:00
}
]
} ,
{
"include" : "$base"
}
]
} ,
2019-10-21 09:21:03 +00:00
"inline_comment" : {
"match" : "(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))" ,
"captures" : {
"1" : {
"name" : "comment.block.c punctuation.definition.comment.begin.c"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"2" : {
"name" : "comment.block.c"
} ,
"3" : {
"patterns" : [
{
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
} ,
{
"match" : "\\*" ,
"name" : "comment.block.c"
}
]
2019-09-02 09:39:10 +00:00
}
2019-10-21 09:21:03 +00:00
}
2019-09-02 09:39:10 +00:00
} ,
"line_continuation_character" : {
"patterns" : [
{
"match" : "(\\\\)\\n" ,
"captures" : {
"1" : {
"name" : "constant.character.escape.line-continuation.c"
}
2019-10-21 09:21:03 +00:00
}
}
]
} ,
"member_access" : {
2019-11-04 13:11:27 +00:00
"match" : "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_int_least64_t|atomic_int_least32_t|pthread_rwlockattr_t|atomic_uint_fast16_t|pthread_mutexattr_t|atomic_int_fast16_t|atomic_uint_fast8_t|atomic_int_fast64_t|atomic_int_least8_t|atomic_int_fast32_t|atomic_int_fast8_t|pthread_condattr_t|atomic_uintptr_t|atomic_ptrdiff_t|pthread_rwlock_t|atomic_uintmax_t|pthread_mutex_t|atomic_intmax_t|atomic_intptr_t|atomic_char32_t|atomic_char16_t|pthread_attr_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_cond_t|pthread_once_t|uint_fast64_t|uint_fast16_t|atomic_size_t|uint_least8_t|int_least64_t|int_least32_t|int_least16_t|pthread_key_t|atomic_ullong|atomic_ushort|uint_fast32_t|atomic_schar|atomic_short|uint_fast8_t|int_fast64_t|int_fast32_t|int_fast16_t|atomic_ulong|atomic_llong|int_least8_t|atomic_uchar|memory_order|suseconds_t|int_fast8_t|atomic_bool|atomic_char|atomic_uint|atomic_long|atomic_int|useconds_t|_Imaginary|uintptr_t|pthread_t|in_addr_t|blksize_t|in_port_t|uintmax_t|uintmax_t|blkcnt_t|uint16_t|unsigned|_Complex|uint32_t|intptr_t|intmax_t|intmax_t|uint64_t|u_quad_t|int64_t|int32_t|ssize_t|caddr_t|clock_t|uint8_t|u_short|swblk_t|segsz_t|int16_t|fixpt_t|daddr_t|nlink_t|qaddr_t|size_t|time_t|mode_t|signed|quad_t|ushort|u_long|u_char|double|int8_t|ino_t|uid_t|pid_t|_Bool|float|dev_t|div_t|short|gid_t|off_t|u_int|key_t|id_t|uint|long|void|char|bool|id_t|int)\\b)[a-zA-Z_]\\w*\\b(?!\\())" ,
2019-10-21 09:21:03 +00:00
"captures" : {
"1" : {
"name" : "variable.other.object.access.c"
} ,
"2" : {
"name" : "punctuation.separator.dot-access.c"
} ,
"3" : {
"name" : "punctuation.separator.pointer-access.c"
} ,
"4" : {
"patterns" : [
{
"include" : "#member_access"
} ,
{
"include" : "#method_access"
} ,
{
"match" : "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))" ,
"captures" : {
"1" : {
"name" : "variable.other.object.access.c"
} ,
"2" : {
"name" : "punctuation.separator.dot-access.c"
} ,
"3" : {
"name" : "punctuation.separator.pointer-access.c"
}
}
}
]
} ,
"5" : {
"name" : "variable.other.member.c"
}
}
} ,
"method_access" : {
"contentName" : "meta.function-call.member.c" ,
"begin" : "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()" ,
"beginCaptures" : {
"1" : {
"name" : "variable.other.object.access.c"
} ,
"2" : {
"name" : "punctuation.separator.dot-access.c"
} ,
"3" : {
"name" : "punctuation.separator.pointer-access.c"
} ,
"4" : {
"patterns" : [
{
"include" : "#member_access"
} ,
{
"include" : "#method_access"
} ,
{
"match" : "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))" ,
"captures" : {
"1" : {
"name" : "variable.other.object.access.c"
} ,
"2" : {
"name" : "punctuation.separator.dot-access.c"
} ,
"3" : {
"name" : "punctuation.separator.pointer-access.c"
}
}
}
]
} ,
"5" : {
"name" : "entity.name.function.member.c"
} ,
"6" : {
"name" : "punctuation.section.arguments.begin.bracket.round.function.member.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "(\\))" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
2019-10-21 09:21:03 +00:00
"1" : {
"name" : "punctuation.section.arguments.end.bracket.round.function.member.c"
2019-09-02 09:39:10 +00:00
}
} ,
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#function-call-innards"
2019-09-02 09:39:10 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"numbers" : {
"match" : "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.]|')|(?<=[eEpP])[+-])*" ,
2019-09-02 09:39:10 +00:00
"captures" : {
2019-10-21 09:21:03 +00:00
"0" : {
"patterns" : [
{
"begin" : "(?=.)" ,
"end" : "$" ,
"patterns" : [
{
"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))?$" ,
"captures" : {
"1" : {
"name" : "keyword.other.unit.hexadecimal.c"
} ,
"2" : {
"name" : "constant.numeric.hexadecimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"3" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"4" : {
"name" : "constant.numeric.hexadecimal.c"
} ,
"5" : {
"name" : "constant.numeric.hexadecimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"6" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"8" : {
"name" : "keyword.other.unit.exponent.hexadecimal.c"
} ,
"9" : {
"name" : "keyword.operator.plus.exponent.hexadecimal.c"
} ,
"10" : {
"name" : "keyword.operator.minus.exponent.hexadecimal.c"
} ,
"11" : {
"name" : "constant.numeric.exponent.hexadecimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"12" : {
"name" : "keyword.other.unit.suffix.floating-point.c"
}
}
} ,
{
"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))?$" ,
"captures" : {
"2" : {
"name" : "constant.numeric.decimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"3" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"4" : {
"name" : "constant.numeric.decimal.point.c"
} ,
"5" : {
"name" : "constant.numeric.decimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"6" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"8" : {
"name" : "keyword.other.unit.exponent.decimal.c"
} ,
"9" : {
"name" : "keyword.operator.plus.exponent.decimal.c"
} ,
"10" : {
"name" : "keyword.operator.minus.exponent.decimal.c"
} ,
"11" : {
"name" : "constant.numeric.exponent.decimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"12" : {
"name" : "keyword.other.unit.suffix.floating-point.c"
}
}
} ,
{
"match" : "(\\G0[bB])([01](?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w))?$" ,
"captures" : {
"1" : {
"name" : "keyword.other.unit.binary.c"
} ,
"2" : {
"name" : "constant.numeric.binary.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"3" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"4" : {
"name" : "keyword.other.unit.suffix.integer.c"
}
}
} ,
{
"match" : "(\\G0)((?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))+)((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w))?$" ,
"captures" : {
"1" : {
"name" : "keyword.other.unit.octal.c"
} ,
"2" : {
"name" : "constant.numeric.octal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"3" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"4" : {
"name" : "keyword.other.unit.suffix.integer.c"
}
}
} ,
{
"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))?$" ,
"captures" : {
"1" : {
"name" : "keyword.other.unit.hexadecimal.c"
} ,
"2" : {
"name" : "constant.numeric.hexadecimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"3" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"5" : {
"name" : "keyword.other.unit.exponent.hexadecimal.c"
} ,
"6" : {
"name" : "keyword.operator.plus.exponent.hexadecimal.c"
} ,
"7" : {
"name" : "keyword.operator.minus.exponent.hexadecimal.c"
} ,
"8" : {
"name" : "constant.numeric.exponent.hexadecimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"9" : {
"name" : "keyword.other.unit.suffix.integer.c"
}
}
} ,
{
"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))?$" ,
"captures" : {
"2" : {
"name" : "constant.numeric.decimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"3" : {
"name" : "punctuation.separator.constant.numeric"
} ,
"5" : {
"name" : "keyword.other.unit.exponent.decimal.c"
} ,
"6" : {
"name" : "keyword.operator.plus.exponent.decimal.c"
} ,
"7" : {
"name" : "keyword.operator.minus.exponent.decimal.c"
} ,
"8" : {
"name" : "constant.numeric.exponent.decimal.c" ,
"patterns" : [
{
"match" : "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])" ,
"name" : "punctuation.separator.constant.numeric"
}
]
} ,
"9" : {
"name" : "keyword.other.unit.suffix.integer.c"
}
}
} ,
{
"match" : "(?:(?:[0-9a-zA-Z_\\.]|')|(?<=[eEpP])[+-])+" ,
"name" : "invalid.illegal.constant.numeric"
}
]
}
]
2019-09-02 09:39:10 +00:00
}
2019-10-21 09:21:03 +00:00
}
2019-09-02 09:39:10 +00:00
} ,
"operators" : {
"patterns" : [
{
"match" : "(?<![\\w$])(sizeof)(?![\\w$])" ,
"name" : "keyword.operator.sizeof.c"
} ,
{
"match" : "--" ,
"name" : "keyword.operator.decrement.c"
} ,
{
"match" : "\\+\\+" ,
"name" : "keyword.operator.increment.c"
} ,
{
"match" : "%=|\\+=|-=|\\*=|(?<!\\()/=" ,
"name" : "keyword.operator.assignment.compound.c"
} ,
{
"match" : "&=|\\^=|<<=|>>=|\\|=" ,
"name" : "keyword.operator.assignment.compound.bitwise.c"
} ,
{
"match" : "<<|>>" ,
"name" : "keyword.operator.bitwise.shift.c"
} ,
{
"match" : "!=|<=|>=|==|<|>" ,
"name" : "keyword.operator.comparison.c"
} ,
{
"match" : "&&|!|\\|\\|" ,
"name" : "keyword.operator.logical.c"
} ,
{
"match" : "&|\\||\\^|~" ,
"name" : "keyword.operator.c"
} ,
{
"match" : "=" ,
"name" : "keyword.operator.assignment.c"
} ,
{
"match" : "%|\\*|/|-|\\+" ,
"name" : "keyword.operator.c"
} ,
{
"begin" : "(\\?)" ,
"beginCaptures" : {
"1" : {
"name" : "keyword.operator.ternary.c"
}
} ,
"end" : "(:)" ,
"endCaptures" : {
"1" : {
"name" : "keyword.operator.ternary.c"
}
} ,
"patterns" : [
{
"include" : "#function-call-innards"
} ,
{
"include" : "$base"
}
]
}
]
} ,
2019-10-21 09:21:03 +00:00
"parens" : {
"name" : "meta.parens.c" ,
"begin" : "\\(" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.parens.begin.bracket.round.c"
2019-09-02 09:39:10 +00:00
}
2019-10-21 09:21:03 +00:00
} ,
"end" : "\\)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.parens.end.bracket.round.c"
2019-09-02 09:39:10 +00:00
}
2019-10-21 09:21:03 +00:00
} ,
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "$base"
2019-09-02 09:39:10 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"parens-block" : {
"name" : "meta.parens.block.c" ,
"begin" : "\\(" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.parens.begin.bracket.round.c"
}
} ,
"end" : "\\)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.parens.end.bracket.round.c"
}
} ,
"patterns" : [
{
"include" : "#block_innards"
} ,
{
"match" : "(?-mix:(?<!:):(?!:))" ,
"name" : "punctuation.range-based.c"
}
]
} ,
"pragma-mark" : {
"captures" : {
"1" : {
"name" : "meta.preprocessor.pragma.c"
} ,
"2" : {
"name" : "keyword.control.directive.pragma.pragma-mark.c"
} ,
"3" : {
"name" : "punctuation.definition.directive.c"
} ,
"4" : {
"name" : "entity.name.tag.pragma-mark.c"
}
} ,
"match" : "^\\s*(((#)\\s*pragma\\s+mark)\\s+(.*))" ,
"name" : "meta.section.c"
} ,
"predefined_macros" : {
"patterns" : [
{
"match" : "\\b(__cplusplus|__DATE__|__FILE__|__LINE__|__STDC__|__STDC_HOSTED__|__STDC_NO_COMPLEX__|__STDC_VERSION__|__STDCPP_THREADS__|__TIME__|NDEBUG|__OBJC__|__ASSEMBLER__|__ATOM__|__AVX__|__AVX2__|_CHAR_UNSIGNED|__CLR_VER|_CONTROL_FLOW_GUARD|__COUNTER__|__cplusplus_cli|__cplusplus_winrt|_CPPRTTI|_CPPUNWIND|_DEBUG|_DLL|__FUNCDNAME__|__FUNCSIG__|__FUNCTION__|_INTEGRAL_MAX_BITS|__INTELLISENSE__|_ISO_VOLATILE|_KERNEL_MODE|_M_AMD64|_M_ARM|_M_ARM_ARMV7VE|_M_ARM_FP|_M_ARM64|_M_CEE|_M_CEE_PURE|_M_CEE_SAFE|_M_FP_EXCEPT|_M_FP_FAST|_M_FP_PRECISE|_M_FP_STRICT|_M_IX86|_M_IX86_FP|_M_X64|_MANAGED|_MSC_BUILD|_MSC_EXTENSIONS|_MSC_FULL_VER|_MSC_VER|_MSVC_LANG|__MSVC_RUNTIME_CHECKS|_MT|_NATIVE_WCHAR_T_DEFINED|_OPENMP|_PREFAST|__TIMESTAMP__|_VC_NO_DEFAULTLIB|_WCHAR_T_DEFINED|_WIN32|_WIN64|_WINRT_DLL|_ATL_VER|_MFC_VER|__GFORTRAN__|__GNUC__|__GNUC_MINOR__|__GNUC_PATCHLEVEL__|__GNUG__|__STRICT_ANSI__|__BASE_FILE__|__INCLUDE_LEVEL__|__ELF__|__VERSION__|__OPTIMIZE__|__OPTIMIZE_SIZE__|__NO_INLINE__|__GNUC_STDC_INLINE__|__CHAR_UNSIGNED__|__WCHAR_UNSIGNED__|__REGISTER_PREFIX__|__REGISTER_PREFIX__|__SIZE_TYPE__|__PTRDIFF_TYPE__|__WCHAR_TYPE__|__WINT_TYPE__|__INTMAX_TYPE__|__UINTMAX_TYPE__|__SIG_ATOMIC_TYPE__|__INT8_TYPE__|__INT16_TYPE__|__INT32_TYPE__|__INT64_TYPE__|__UINT8_TYPE__|__UINT16_TYPE__|__UINT32_TYPE__|__UINT64_TYPE__|__INT_LEAST8_TYPE__|__INT_LEAST16_TYPE__|__INT_LEAST32_TYPE__|__INT_LEAST64_TYPE__|__UINT_LEAST8_TYPE__|__UINT_LEAST16_TYPE__|__UINT_LEAST32_TYPE__|__UINT_LEAST64_TYPE__|__INT_FAST8_TYPE__|__INT_FAST16_TYPE__|__INT_FAST32_TYPE__|__INT_FAST64_TYPE__|__UINT_FAST8_TYPE__|__UINT_FAST16_TYPE__|__UINT_FAST32_TYPE__|__UINT_FAST64_TYPE__|__INTPTR_TYPE__|__UINTPTR_TYPE__|__CHAR_BIT__|__SCHAR_MAX__|__WCHAR_MAX__|__SHRT_MAX__|__INT_MAX__|__LONG_MAX__|__LONG_LONG_MAX__|__WINT_MAX__|__SIZE_MAX__|__PTRDIFF_MAX__|__INTMAX_MAX__|__UINTMAX_MAX__|__SIG_ATOMIC_MAX__|__INT8_MAX__|__INT16_MAX__|__INT32_MAX__|__INT64_MAX__|__UINT8_MAX__|__UINT16_MAX__|__UINT32_MAX__|__UINT64_MAX__|__INT_LEAST8_MAX__|__INT_LEAST16_MAX__|__INT_LEAST32_MAX__|__INT_LEAST64_MAX__|__UINT_LEAST8_MAX__|__UINT_LEAST16_MAX__|__UINT_LEAST32_MAX__|__UINT_LEAST64_MAX__|__INT_FAST8_MAX__|__INT_FAST16_MAX__|__INT_FAST32_MAX__|__INT_FAST64_MAX__|__UINT_FAST8_MAX__|__UINT_FAST16_MAX__|__UINT_FAST32_MAX__|__UINT_FAST64_MAX__|__INTPTR_MAX__|__UINTPTR_MAX__|__WCHAR_MIN__|__WINT_MIN__|__SIG_ATOMIC_MIN__|__SCHAR_WIDTH__|__SHRT_WIDTH__|__INT_WIDTH__|__LONG_WIDTH__|__LONG_LONG_WIDTH__|__PTRDIFF_WIDTH__|__SIG_ATOMIC_WIDTH__|__SIZE_WIDTH__|__WCHAR_WIDTH__|__WINT_WIDTH__|__INT_LEAST8_WIDTH__|__INT_LEAST16_WIDTH__|__INT_LEAST32_WIDTH__|__INT_LEAST64_WIDTH__|__INT_FAST8_WIDTH__|__INT_FAST16_WIDTH__|__INT_FAST32_WIDTH__|__INT_FAST64_WIDTH__|__INTPTR_WIDTH__|__INTMAX_WIDTH__|__SIZEOF_INT__|__SIZEOF_LONG__|__SIZEOF_LONG_LONG__|__SIZEOF_SHORT__|__SIZEOF_POINTER__|__SIZEOF_FLOAT__|__SIZEOF_DOUBLE__|__SIZEOF_LONG_DOUBLE__|__SIZEOF_SIZE_T__|__SIZEOF_WCHAR_T__|__SIZEOF_WINT_T__|__SIZEOF_PTRDIFF_T__|__BYTE_ORDER__|__ORDER_LITTLE_ENDIAN__|__ORDER_BIG_ENDIAN__|__ORDER_PDP_ENDIAN__|__FLOAT_WORD_ORDER__|__DEPRECATED|__EXCEPTIONS|__GXX_RTTI|__USING_SJLJ_EXCEPTIONS__|__GXX_EXPERIMENTAL_CXX0X__|__GXX_WEAK__|__NEXT_RUNTIME__|__LP64__|_LP64|__SSP__|__SSP_ALL__|__SSP_STRONG__|__SSP_EXPLICIT__|__SANITIZE_ADDRESS__|__SANITIZE_THREAD__|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16|__HAVE_SPECULATION_SAFE_VALUE|__GCC_HAVE_DWARF2_CFI_ASM|__FP_FAST_FMA|__FP_FAST_FMAF|__FP_FAST_FMAL|__FP_FAST_FMAF16|__FP_FAST_FMAF32|__FP_FAST_FMAF64|__FP_FAST_FMAF128|__FP_FAST_FMAF32X|__FP_FAST_FMAF64X|__FP_FAST_FMAF128X|__GCC_IEC_559|__GCC_IEC_559_COMPLEX|__NO_MATH_ERRNO__|__has_builtin|__has_feature|__has_extension|__has_cpp_attribute|__has_c_attribute|__has_attribute|__has_declspec_attribute|__is_identifier|__has_include|__has_include_next|__has_warning|__BASE_FILE__|__FILE_NAME__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__fp16|_Float16)\\b" ,
"captures" : {
"1" : {
"name" : "entity.name.other.preprocessor.macro.predefined.$1.c"
}
}
} ,
{
"match" : "\\b__([A-Z_]+)__\\b" ,
"name" : "entity.name.other.preprocessor.macro.predefined.probably.$1.c"
}
]
2019-09-02 09:39:10 +00:00
} ,
"preprocessor-rule-conditional" : {
"patterns" : [
{
"begin" : "^\\s*((#)\\s*if(?:n?def)?\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "^\\s*((#)\\s*endif\\b)" ,
"endCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"patterns" : [
{
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-conditional-line"
2019-07-01 14:39:15 +00:00
}
]
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-enabled-elif"
} ,
{
"include" : "#preprocessor-rule-enabled-else"
} ,
{
"include" : "#preprocessor-rule-disabled-elif"
} ,
{
2019-08-27 09:42:11 +00:00
"begin" : "^\\s*((#)\\s*elif\\b)" ,
"beginCaptures" : {
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-conditional-line"
2019-07-01 14:39:15 +00:00
}
]
2019-08-27 09:42:11 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "$base"
2019-07-01 14:39:15 +00:00
}
]
2019-09-02 09:39:10 +00:00
} ,
{
"match" : "^\\s*#\\s*(else|elif|endif)\\b" ,
"captures" : {
"0" : {
"name" : "invalid.illegal.stray-$1.c"
}
}
2019-07-01 14:39:15 +00:00
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-conditional-block" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*if(?:n?def)?\\b)" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "^\\s*((#)\\s*endif\\b)" ,
"endCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"patterns" : [
{
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
2019-09-02 09:39:10 +00:00
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
2019-07-01 14:39:15 +00:00
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-enabled-elif-block"
2019-07-01 14:39:15 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-enabled-else-block"
} ,
{
"include" : "#preprocessor-rule-disabled-elif"
2019-07-01 14:39:15 +00:00
} ,
{
2019-08-27 09:42:11 +00:00
"begin" : "^\\s*((#)\\s*elif\\b)" ,
"beginCaptures" : {
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
2019-08-27 09:42:11 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-conditional-line"
2019-08-27 09:42:11 +00:00
}
]
2019-07-01 14:39:15 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#block_innards"
2019-08-27 09:42:11 +00:00
}
]
2019-09-02 09:39:10 +00:00
} ,
{
"match" : "^\\s*#\\s*(else|elif|endif)\\b" ,
"captures" : {
"0" : {
"name" : "invalid.illegal.stray-$1.c"
}
}
2019-08-27 09:42:11 +00:00
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-conditional-line" : {
"patterns" : [
{
"match" : "(?:\\bdefined\\b\\s*$)|(?:\\bdefined\\b(?=\\s*\\(*\\s*(?:(?!defined\\b)[a-zA-Z_$][\\w$]*\\b)\\s*\\)*\\s*(?:\\n|//|/\\*|\\?|\\:|&&|\\|\\||\\\\\\s*\\n)))" ,
2019-08-27 09:42:11 +00:00
"name" : "keyword.control.directive.conditional.c"
} ,
2019-09-02 09:39:10 +00:00
{
"match" : "\\bdefined\\b" ,
"name" : "invalid.illegal.macro-name.c"
} ,
{
"include" : "#comments"
} ,
{
"include" : "#strings"
} ,
{
"include" : "#numbers"
} ,
{
"begin" : "\\?" ,
"beginCaptures" : {
"0" : {
"name" : "keyword.operator.ternary.c"
}
} ,
"end" : ":" ,
"endCaptures" : {
"0" : {
"name" : "keyword.operator.ternary.c"
}
} ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
} ,
{
"include" : "#operators"
} ,
{
"match" : "\\b(NULL|true|false|TRUE|FALSE)\\b" ,
"name" : "constant.language.c"
} ,
{
"match" : "[a-zA-Z_$][\\w$]*" ,
"name" : "entity.name.function.preprocessor.c"
} ,
{
"include" : "#line_continuation_character"
} ,
{
"begin" : "\\(" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.parens.begin.bracket.round.c"
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "\\)|(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.parens.end.bracket.round.c"
}
} ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
}
]
} ,
"preprocessor-rule-define-line-blocks" : {
"patterns" : [
{
"begin" : "{" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.block.begin.bracket.curly.c"
}
} ,
"end" : "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.block.end.bracket.curly.c"
}
} ,
"patterns" : [
{
"include" : "#preprocessor-rule-define-line-blocks"
} ,
{
"include" : "#preprocessor-rule-define-line-contents"
}
]
} ,
{
"include" : "#preprocessor-rule-define-line-contents"
}
]
} ,
"preprocessor-rule-define-line-contents" : {
"patterns" : [
{
"include" : "#vararg_ellipses"
} ,
{
"begin" : "{" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.block.begin.bracket.curly.c"
}
} ,
"end" : "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.section.block.end.bracket.curly.c"
}
} ,
"name" : "meta.block.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-define-line-blocks"
}
]
} ,
{
"match" : "\\(" ,
"name" : "punctuation.section.parens.begin.bracket.round.c"
} ,
{
"match" : "\\)" ,
"name" : "punctuation.section.parens.end.bracket.round.c"
} ,
{
"begin" : "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas|asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\s*\\()\n(?=\n (?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n |\n (?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)" ,
"end" : "(?<=\\))(?!\\w)|(?<!\\\\)(?=\\s*\\n)" ,
"name" : "meta.function.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-define-line-functions"
}
]
} ,
{
"begin" : "\"" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.definition.string.begin.c"
}
} ,
"end" : "\"|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.definition.string.end.c"
}
} ,
"name" : "string.quoted.double.c" ,
"patterns" : [
{
"include" : "#string_escaped_char"
} ,
{
"include" : "#string_placeholder"
} ,
{
"include" : "#line_continuation_character"
}
]
} ,
{
"begin" : "'" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.definition.string.begin.c"
}
} ,
"end" : "'|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"0" : {
"name" : "punctuation.definition.string.end.c"
}
} ,
"name" : "string.quoted.single.c" ,
"patterns" : [
{
"include" : "#string_escaped_char"
} ,
{
"include" : "#line_continuation_character"
}
]
} ,
{
"include" : "#method_access"
} ,
{
"include" : "#member_access"
} ,
{
"include" : "$base"
}
]
} ,
"preprocessor-rule-define-line-functions" : {
"patterns" : [
{
"include" : "#comments"
} ,
{
"include" : "#storage_types"
} ,
{
"include" : "#vararg_ellipses"
} ,
{
"include" : "#method_access"
} ,
{
"include" : "#member_access"
} ,
{
"include" : "#operators"
} ,
{
"begin" : "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()" ,
"beginCaptures" : {
"1" : {
"name" : "entity.name.function.c"
} ,
"2" : {
"name" : "punctuation.section.arguments.begin.bracket.round.c"
}
} ,
"end" : "(\\))|(?<!\\\\)(?=\\s*\\n)" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.section.arguments.end.bracket.round.c"
}
} ,
"patterns" : [
{
"include" : "#preprocessor-rule-define-line-functions"
}
]
} ,
{
"begin" : "\\(" ,
"beginCaptures" : {
"0" : {
"name" : "punctuation.section.parens.begin.bracket.round.c"
}
} ,
"end" : "(\\))|(?<!\\\\)(?=\\s*\\n)" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
2019-10-21 09:21:03 +00:00
"1" : {
2019-09-02 09:39:10 +00:00
"name" : "punctuation.section.parens.end.bracket.round.c"
}
} ,
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#preprocessor-rule-define-line-functions"
2019-09-02 09:39:10 +00:00
}
]
2019-10-21 09:21:03 +00:00
} ,
{
"include" : "#preprocessor-rule-define-line-contents"
2019-08-27 09:42:11 +00:00
}
2019-09-02 09:39:10 +00:00
]
} ,
"preprocessor-rule-disabled" : {
2019-08-27 09:42:11 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "^\\s*((#)\\s*endif\\b)" ,
"endCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-08-27 09:42:11 +00:00
"patterns" : [
2019-07-01 14:39:15 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
} ,
{
"include" : "#comments"
} ,
{
"include" : "#preprocessor-rule-enabled-elif"
} ,
2019-08-27 09:42:11 +00:00
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-enabled-else"
} ,
{
"include" : "#preprocessor-rule-disabled-elif"
} ,
{
"begin" : "^\\s*((#)\\s*elif\\b)" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
2019-08-27 09:42:11 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
2019-07-01 14:39:15 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "$base"
2019-07-01 14:39:15 +00:00
}
]
} ,
{
2019-09-02 09:39:10 +00:00
"begin" : "\\n" ,
2019-07-01 14:39:15 +00:00
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
2019-09-02 09:39:10 +00:00
"contentName" : "comment.block.preprocessor.if-branch.c" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
}
]
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-disabled-block" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
2019-07-01 14:39:15 +00:00
}
2019-09-02 09:39:10 +00:00
} ,
"end" : "^\\s*((#)\\s*endif\\b)" ,
"endCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
} ,
{
"include" : "#comments"
} ,
{
"include" : "#preprocessor-rule-enabled-elif-block"
} ,
{
"include" : "#preprocessor-rule-enabled-else-block"
} ,
{
"include" : "#preprocessor-rule-disabled-elif"
} ,
{
"begin" : "^\\s*((#)\\s*elif\\b)" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
2019-07-01 14:39:15 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#block_innards"
2019-07-01 14:39:15 +00:00
}
]
} ,
{
2019-09-02 09:39:10 +00:00
"begin" : "\\n" ,
2019-07-01 14:39:15 +00:00
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
2019-09-02 09:39:10 +00:00
"contentName" : "comment.block.preprocessor.if-branch.in-block.c" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
2019-08-27 09:42:11 +00:00
}
]
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-disabled-elif" : {
"begin" : "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))" ,
2019-08-27 09:42:11 +00:00
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))" ,
2019-08-27 09:42:11 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
2019-08-27 09:42:11 +00:00
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-conditional-line"
2019-08-27 09:42:11 +00:00
}
]
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#comments"
} ,
{
"begin" : "\\n" ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"contentName" : "comment.block.preprocessor.elif-branch.c" ,
2019-08-27 09:42:11 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"include" : "#disabled"
2019-08-27 09:42:11 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#pragma-mark"
2019-08-27 09:42:11 +00:00
}
]
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-enabled" : {
2019-08-27 09:42:11 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))" ,
2019-08-27 09:42:11 +00:00
"beginCaptures" : {
"0" : {
2019-09-02 09:39:10 +00:00
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
} ,
"3" : {
"name" : "constant.numeric.preprocessor.c"
2019-08-27 09:42:11 +00:00
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "^\\s*((#)\\s*endif\\b)" ,
2019-08-27 09:42:11 +00:00
"endCaptures" : {
"0" : {
2019-09-02 09:39:10 +00:00
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
2019-08-27 09:42:11 +00:00
}
} ,
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
2019-08-27 09:42:11 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#comments"
} ,
{
"begin" : "^\\s*((#)\\s*else\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
"contentName" : "comment.block.preprocessor.else-branch.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
{
"begin" : "^\\s*((#)\\s*elif\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"contentName" : "comment.block.preprocessor.if-branch.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
{
"begin" : "\\n" ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"patterns" : [
{
"include" : "$base"
}
]
2019-07-01 14:39:15 +00:00
}
]
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-enabled-block" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
2019-09-02 09:39:10 +00:00
"0" : {
"name" : "meta.preprocessor.c"
} ,
2019-07-01 14:39:15 +00:00
"1" : {
2019-09-02 09:39:10 +00:00
"name" : "keyword.control.directive.conditional.c"
2019-07-01 14:39:15 +00:00
} ,
"2" : {
2019-09-02 09:39:10 +00:00
"name" : "punctuation.definition.directive.c"
2019-07-01 14:39:15 +00:00
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "^\\s*((#)\\s*endif\\b)" ,
2019-07-01 14:39:15 +00:00
"endCaptures" : {
2019-08-27 09:42:11 +00:00
"0" : {
2019-09-02 09:39:10 +00:00
"name" : "meta.preprocessor.c"
} ,
2019-08-27 09:42:11 +00:00
"1" : {
2019-09-02 09:39:10 +00:00
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
2019-08-27 09:42:11 +00:00
}
} ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
} ,
{
"include" : "#comments"
} ,
{
"begin" : "^\\s*((#)\\s*else\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
"contentName" : "comment.block.preprocessor.else-branch.in-block.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
{
"begin" : "^\\s*((#)\\s*elif\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"contentName" : "comment.block.preprocessor.if-branch.in-block.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
{
"begin" : "\\n" ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"patterns" : [
{
"include" : "#block_innards"
}
]
2019-07-01 14:39:15 +00:00
}
]
2019-08-27 09:42:11 +00:00
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-enabled-elif" : {
"begin" : "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
2019-06-04 14:19:37 +00:00
} ,
2019-09-02 09:39:10 +00:00
"1" : {
"name" : "keyword.control.directive.conditional.c"
2019-08-27 09:42:11 +00:00
} ,
2019-09-02 09:39:10 +00:00
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
"patterns" : [
2019-08-27 09:42:11 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
"patterns" : [
{
"include" : "#preprocessor-rule-conditional-line"
}
]
2019-08-27 09:42:11 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#comments"
2019-08-27 09:42:11 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"begin" : "\\n" ,
"end" : "(?=^\\s*((#)\\s*(?:endif)\\b))" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*(else)\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
"contentName" : "comment.block.preprocessor.elif-branch.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
2019-07-01 14:39:15 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"begin" : "^\\s*((#)\\s*(elif)\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"contentName" : "comment.block.preprocessor.elif-branch.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
2019-07-01 14:39:15 +00:00
{
2019-09-02 09:39:10 +00:00
"include" : "$base"
2019-07-01 14:39:15 +00:00
}
]
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-enabled-elif-block" : {
"begin" : "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
2019-08-27 09:42:11 +00:00
} ,
2019-09-02 09:39:10 +00:00
"1" : {
"name" : "keyword.control.directive.conditional.c"
2019-08-27 09:42:11 +00:00
} ,
2019-09-02 09:39:10 +00:00
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
"patterns" : [
2019-08-27 09:42:11 +00:00
{
2019-09-02 09:39:10 +00:00
"begin" : "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))" ,
"end" : "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)" ,
"name" : "meta.preprocessor.c" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-09-02 09:39:10 +00:00
"include" : "#preprocessor-rule-conditional-line"
2019-07-01 14:39:15 +00:00
}
]
2019-06-04 14:19:37 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"include" : "#comments"
2019-08-27 09:42:11 +00:00
} ,
{
2019-09-02 09:39:10 +00:00
"begin" : "\\n" ,
"end" : "(?=^\\s*((#)\\s*(?:endif)\\b))" ,
"patterns" : [
{
"begin" : "^\\s*((#)\\s*(else)\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
"contentName" : "comment.block.preprocessor.elif-branch.in-block.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
{
"begin" : "^\\s*((#)\\s*(elif)\\b)" ,
"beginCaptures" : {
"0" : {
"name" : "meta.preprocessor.c"
} ,
"1" : {
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
}
} ,
"end" : "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))" ,
"contentName" : "comment.block.preprocessor.elif-branch.c" ,
"patterns" : [
{
"include" : "#disabled"
} ,
{
"include" : "#pragma-mark"
}
]
} ,
{
"include" : "#block_innards"
}
]
2019-07-01 14:39:15 +00:00
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-enabled-else" : {
"begin" : "^\\s*((#)\\s*else\\b)" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
2019-09-02 09:39:10 +00:00
"0" : {
"name" : "meta.preprocessor.c"
} ,
2019-07-01 14:39:15 +00:00
"1" : {
2019-09-02 09:39:10 +00:00
"name" : "keyword.control.directive.conditional.c"
} ,
"2" : {
"name" : "punctuation.definition.directive.c"
2019-07-01 14:39:15 +00:00
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-09-02 09:39:10 +00:00
"include" : "$base"
2019-07-01 14:39:15 +00:00
}
]
} ,
2019-09-02 09:39:10 +00:00
"preprocessor-rule-enabled-else-block" : {
"begin" : "^\\s*((#)\\s*else\\b)" ,
2019-08-27 09:42:11 +00:00
"beginCaptures" : {
2019-09-02 09:39:10 +00:00
"0" : {
"name" : "meta.preprocessor.c"
} ,
2019-08-27 09:42:11 +00:00
"1" : {
2019-09-02 09:39:10 +00:00
"name" : "keyword.control.directive.conditional.c"
2019-06-04 14:19:37 +00:00
} ,
2019-08-27 09:42:11 +00:00
"2" : {
2019-09-02 09:39:10 +00:00
"name" : "punctuation.definition.directive.c"
2019-08-27 09:42:11 +00:00
}
} ,
2019-09-02 09:39:10 +00:00
"end" : "(?=^\\s*((#)\\s*endif\\b))" ,
2019-08-27 09:42:11 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-09-02 09:39:10 +00:00
"include" : "#block_innards"
}
]
} ,
2019-10-21 09:21:03 +00:00
"probably_a_parameter" : {
"match" : "(?<=(?:[a-zA-Z_0-9] |[&*>\\]\\)]))\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))" ,
"captures" : {
"1" : {
"name" : "variable.parameter.probably.c"
}
}
} ,
"static_assert" : {
"begin" : "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)static_assert|_Static_assert(?!\\w))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()" ,
"beginCaptures" : {
"1" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#inline_comment"
2019-09-02 09:39:10 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"2" : {
"name" : "comment.block.c punctuation.definition.comment.begin.c"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"3" : {
"name" : "comment.block.c"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"4" : {
2019-09-02 09:39:10 +00:00
"patterns" : [
2019-07-01 14:39:15 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
} ,
{
"match" : "\\*" ,
"name" : "comment.block.c"
2019-07-01 14:39:15 +00:00
}
]
2019-06-04 14:19:37 +00:00
} ,
2019-10-21 09:21:03 +00:00
"5" : {
"name" : "keyword.other.static_assert.c"
} ,
"6" : {
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#inline_comment"
2019-08-27 09:42:11 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"7" : {
"name" : "comment.block.c punctuation.definition.comment.begin.c"
} ,
"8" : {
"name" : "comment.block.c"
} ,
"9" : {
2019-08-27 09:42:11 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "\\*" ,
"name" : "comment.block.c"
2019-07-01 14:39:15 +00:00
}
]
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"10" : {
"name" : "punctuation.section.arguments.begin.bracket.round.static_assert.c"
2019-08-27 09:42:11 +00:00
}
2019-10-21 09:21:03 +00:00
} ,
"end" : "(\\))" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.section.arguments.end.bracket.round.static_assert.c"
}
} ,
2019-08-27 09:42:11 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-10-21 09:21:03 +00:00
"name" : "meta.static_assert.message.c" ,
"begin" : "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)" ,
2019-07-01 14:39:15 +00:00
"beginCaptures" : {
2019-10-21 09:21:03 +00:00
"1" : {
"name" : "punctuation.separator.delimiter.comma.c"
2019-07-01 14:39:15 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "(?=\\))" ,
2019-07-01 14:39:15 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#string_context"
2019-07-01 14:39:15 +00:00
}
]
2019-06-04 14:19:37 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#evaluation_context"
2019-08-27 09:42:11 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"storage_types" : {
2019-08-27 09:42:11 +00:00
"patterns" : [
2019-06-04 14:19:37 +00:00
{
2019-11-04 13:11:27 +00:00
"match" : "(?-mix:(?<!\\w)(?:unsigned|signed|double|_Bool|short|float|long|void|char|bool|int)(?!\\w))" ,
2019-10-21 09:21:03 +00:00
"name" : "storage.type.built-in.primitive.c"
2019-08-27 09:42:11 +00:00
} ,
2019-09-02 09:39:10 +00:00
{
2019-11-04 13:11:27 +00:00
"match" : "(?-mix:(?<!\\w)(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|pthread_rwlockattr_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_uint_fast16_t|atomic_int_least64_t|atomic_int_least32_t|atomic_int_least16_t|atomic_uint_least8_t|atomic_uint_fast8_t|atomic_int_least8_t|atomic_int_fast16_t|pthread_mutexattr_t|atomic_int_fast32_t|atomic_int_fast64_t|atomic_int_fast8_t|pthread_condattr_t|atomic_ptrdiff_t|pthread_rwlock_t|atomic_uintptr_t|atomic_uintmax_t|atomic_intmax_t|atomic_intptr_t|atomic_char32_t|atomic_char16_t|pthread_mutex_t|pthread_cond_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_once_t|pthread_attr_t|int_least32_t|pthread_key_t|int_least16_t|int_least64_t|uint_least8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|atomic_ushort|atomic_ullong|atomic_size_t|int_fast16_t|int_fast64_t|uint_fast8_t|atomic_short|atomic_uchar|atomic_schar|int_least8_t|memory_order|atomic_llong|atomic_ulong|int_fast32_t|atomic_long|atomic_uint|atomic_char|int_fast8_t|suseconds_t|atomic_bool|atomic_int|_Imaginary|useconds_t|in_port_t|uintmax_t|uintmax_t|pthread_t|blksize_t|in_addr_t|uintptr_t|blkcnt_t|uint16_t|uint32_t|uint64_t|u_quad_t|_Complex|intptr_t|intmax_t|intmax_t|segsz_t|u_short|nlink_t|uint8_t|int64_t|int32_t|int16_t|fixpt_t|daddr_t|caddr_t|qaddr_t|ssize_t|clock_t|swblk_t|u_long|mode_t|int8_t|time_t|ushort|u_char|quad_t|size_t|pid_t|gid_t|uid_t|dev_t|div_t|off_t|u_int|key_t|ino_t|uint|id_t|id_t)(?!\\w))" ,
2019-10-21 09:21:03 +00:00
"name" : "storage.type.built-in.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : "(?-mix:\\b(enum|struct|union)\\b)" ,
"name" : "storage.type.$1.c"
2019-09-02 09:39:10 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"name" : "meta.asm.c" ,
"begin" : "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()" ,
2019-09-02 09:39:10 +00:00
"beginCaptures" : {
"1" : {
2019-10-21 09:21:03 +00:00
"name" : "storage.type.asm.c"
} ,
"2" : {
"name" : "storage.modifier.c"
} ,
"3" : {
"name" : "punctuation.section.parens.begin.bracket.round.assembly.c"
}
} ,
"end" : "(\\))" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.section.parens.end.bracket.round.assembly.c"
}
} ,
"patterns" : [
{
"name" : "string.quoted.double.c" ,
"contentName" : "meta.embedded.assembly.c" ,
"begin" : "(R?)(\")" ,
"beginCaptures" : {
"1" : {
"name" : "meta.encoding.c"
} ,
"2" : {
"name" : "punctuation.definition.string.begin.assembly.c"
}
} ,
"end" : "(\")" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.definition.string.end.assembly.c"
}
} ,
"patterns" : [
{
"include" : "source.asm"
} ,
{
"include" : "source.x86"
} ,
{
"include" : "source.x86_64"
} ,
{
"include" : "source.arm"
} ,
{
"include" : "#backslash_escapes"
} ,
{
"include" : "#string_escaped_char"
} ,
{
"match" : "(?=not)possible"
}
]
} ,
{
"begin" : "(\\()" ,
"beginCaptures" : {
"1" : {
"name" : "punctuation.section.parens.begin.bracket.round.assembly.inner.c"
}
} ,
"end" : "(\\))" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.section.parens.end.bracket.round.assembly.inner.c"
}
} ,
"patterns" : [
{
"include" : "#evaluation_context"
}
]
2019-08-27 09:42:11 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"match" : ":" ,
"name" : "punctuation.separator.delimiter.colon.assembly.c"
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#comments_context"
} ,
{
"include" : "#comments"
2019-05-16 17:17:43 +00:00
}
2019-07-01 14:39:15 +00:00
]
}
2019-09-02 09:39:10 +00:00
]
2019-07-01 14:39:15 +00:00
} ,
2019-10-21 09:21:03 +00:00
"string_escaped_char" : {
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"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} )" ,
"name" : "constant.character.escape.c"
2019-07-01 14:39:15 +00:00
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "\\\\." ,
"name" : "invalid.illegal.unknown-escape.c"
}
]
} ,
"string_placeholder" : {
"patterns" : [
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "(?x) %\n(\\d+\\$)?\t\t\t\t\t\t # field (argument #)\n[#0\\- +']*\t\t\t\t\t\t # flags\n[,;:_]?\t\t\t\t\t\t\t # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)?\t\t # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\t# precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%]\t\t # conversion type" ,
"name" : "constant.other.placeholder.c"
2019-05-16 17:17:43 +00:00
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"match" : "(%)(?!\"\\s*(PRI|SCN))" ,
"captures" : {
"1" : {
"name" : "invalid.illegal.placeholder.c"
}
}
}
]
} ,
"strings" : {
"patterns" : [
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"begin" : "\"" ,
2019-09-02 09:39:10 +00:00
"beginCaptures" : {
2019-10-21 09:21:03 +00:00
"0" : {
"name" : "punctuation.definition.string.begin.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "\"" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.definition.string.end.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"name" : "string.quoted.double.c" ,
2019-09-02 09:39:10 +00:00
"patterns" : [
2019-08-27 09:42:11 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#string_escaped_char"
2019-08-27 09:42:11 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#string_placeholder"
} ,
{
"include" : "#line_continuation_character"
2019-08-27 09:42:11 +00:00
}
]
2019-07-01 14:39:15 +00:00
} ,
2019-09-02 09:39:10 +00:00
{
2019-10-21 09:21:03 +00:00
"begin" : "'" ,
2019-09-02 09:39:10 +00:00
"beginCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.definition.string.begin.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"end" : "'" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
"0" : {
2019-10-21 09:21:03 +00:00
"name" : "punctuation.definition.string.end.c"
2019-09-02 09:39:10 +00:00
}
} ,
2019-10-21 09:21:03 +00:00
"name" : "string.quoted.single.c" ,
2019-09-02 09:39:10 +00:00
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#string_escaped_char"
} ,
{
"include" : "#line_continuation_character"
2019-09-02 09:39:10 +00:00
}
]
2019-08-27 09:42:11 +00:00
}
]
} ,
2019-10-21 09:21:03 +00:00
"switch_conditional_parentheses" : {
"name" : "meta.conditional.switch.c" ,
"begin" : "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()" ,
"beginCaptures" : {
"1" : {
"patterns" : [
{
"include" : "#inline_comment"
}
]
} ,
"2" : {
"name" : "comment.block.c punctuation.definition.comment.begin.c"
} ,
"3" : {
"name" : "comment.block.c"
} ,
"4" : {
"patterns" : [
{
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
} ,
{
"match" : "\\*" ,
"name" : "comment.block.c"
}
]
} ,
"5" : {
"name" : "punctuation.section.parens.begin.bracket.round.conditional.switch.c"
}
} ,
"end" : "(\\))" ,
"endCaptures" : {
"1" : {
"name" : "punctuation.section.parens.end.bracket.round.conditional.switch.c"
}
} ,
2019-08-27 09:42:11 +00:00
"patterns" : [
2019-07-01 14:39:15 +00:00
{
2019-10-21 09:21:03 +00:00
"include" : "#evaluation_context"
2019-08-27 09:42:11 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"include" : "#c_conditional_context"
}
]
} ,
"switch_statement" : {
"name" : "meta.block.switch.c" ,
"begin" : "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)switch(?!\\w)))" ,
"beginCaptures" : {
"1" : {
"name" : "meta.head.switch.c"
2019-05-16 17:17:43 +00:00
} ,
2019-10-21 09:21:03 +00:00
"2" : {
"patterns" : [
{
"include" : "#inline_comment"
}
]
2019-07-01 14:39:15 +00:00
} ,
2019-10-21 09:21:03 +00:00
"3" : {
"name" : "comment.block.c punctuation.definition.comment.begin.c"
2019-07-01 14:39:15 +00:00
} ,
2019-10-21 09:21:03 +00:00
"4" : {
"name" : "comment.block.c"
2019-09-02 09:39:10 +00:00
} ,
2019-10-21 09:21:03 +00:00
"5" : {
"patterns" : [
{
"match" : "\\*\\/" ,
"name" : "comment.block.c punctuation.definition.comment.end.c"
2019-05-16 17:17:43 +00:00
} ,
2019-10-21 09:21:03 +00:00
{
"match" : "\\*" ,
"name" : "comment.block.c"
2019-07-01 14:39:15 +00:00
}
2019-10-21 09:21:03 +00:00
]
} ,
"6" : {
"name" : "keyword.control.switch.c"
}
} ,
"end" : "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))" ,
"patterns" : [
{
"name" : "meta.head.switch.c" ,
"begin" : "\\G ?" ,
"end" : "((?:\\{|<%|\\?\\?<|(?=;)))" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
2019-10-21 09:21:03 +00:00
"1" : {
"name" : "punctuation.section.block.begin.bracket.curly.switch.c"
2019-09-02 09:39:10 +00:00
}
} ,
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#switch_conditional_parentheses"
} ,
{
"include" : "$self"
2019-09-02 09:39:10 +00:00
}
]
2019-05-16 17:17:43 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"name" : "meta.body.switch.c" ,
"begin" : "(?<=\\{|<%|\\?\\?<)" ,
"end" : "(\\}|%>|\\?\\?>)" ,
2019-09-02 09:39:10 +00:00
"endCaptures" : {
2019-10-21 09:21:03 +00:00
"1" : {
"name" : "punctuation.section.block.end.bracket.curly.switch.c"
2019-09-02 09:39:10 +00:00
}
} ,
"patterns" : [
{
2019-10-21 09:21:03 +00:00
"include" : "#default_statement"
} ,
{
"include" : "#case_statement"
} ,
{
"include" : "$self"
} ,
{
"include" : "#block_innards"
2019-09-02 09:39:10 +00:00
}
]
2019-05-16 17:17:43 +00:00
} ,
{
2019-10-21 09:21:03 +00:00
"name" : "meta.tail.switch.c" ,
"begin" : "(?<=\\}|%>|\\?\\?>)[\\s\\n]*" ,
"end" : "[\\s\\n]*(?=;)" ,
"patterns" : [
{
"include" : "$self"
}
]
2019-05-16 17:17:43 +00:00
}
]
2019-10-21 09:21:03 +00:00
} ,
"vararg_ellipses" : {
"match" : "(?<!\\.)\\.\\.\\.(?!\\.)" ,
"name" : "punctuation.vararg-ellipses.c"
2016-08-09 09:41:00 +00:00
}
2017-05-25 10:26:41 +00:00
}
2019-09-02 09:39:10 +00:00
}