grammars/source.c.json in github-linguist-5.3.3 vs grammars/source.c.json in github-linguist-6.0.0

- old
+ new

@@ -1,13 +1,8 @@ { - "fileTypes": [ - "c", - "h" - ], - "firstLineMatch": "-[*]-( Mode:)? C -[*]-", - "keyEquivalent": "^~C", "name": "C", + "scopeName": "source.c", "patterns": [ { "include": "#preprocessor-rule-enabled" }, { @@ -21,95 +16,105 @@ }, { "include": "source.c.platform" }, { - "match": "\\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\\b", - "name": "keyword.control.c" + "name": "keyword.control.c", + "match": "\\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\\b" }, { - "match": "\\b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\b", - "name": "storage.type.c" + "name": "storage.type.c", + "match": "\\b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\b" }, { - "match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b", - "name": "storage.modifier.c" + "name": "storage.modifier.c", + "match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b" }, { - "comment": "common C constant naming idiom -- kConstantVariable", - "match": "\\bk[A-Z]\\w*\\b", - "name": "constant.other.variable.mac-classic.c" + "name": "constant.other.variable.mac-classic.c", + "match": "\\bk[A-Z]\\w*\\b" }, { - "match": "\\bg[A-Z]\\w*\\b", - "name": "variable.other.readwrite.global.mac-classic.c" + "name": "variable.other.readwrite.global.mac-classic.c", + "match": "\\bg[A-Z]\\w*\\b" }, { - "match": "\\bs[A-Z]\\w*\\b", - "name": "variable.other.readwrite.static.mac-classic.c" + "name": "variable.other.readwrite.static.mac-classic.c", + "match": "\\bs[A-Z]\\w*\\b" }, { - "match": "\\b(NULL|true|false|TRUE|FALSE)\\b", - "name": "constant.language.c" + "name": "constant.language.c", + "match": "\\b(NULL|true|false|TRUE|FALSE)\\b" }, { "include": "#sizeof" }, { + "name": "constant.numeric.c", + "match": "(?x)\\b\n\t\t\t( (?i:\n\t\t\t 0x ( [0-9A-Fa-f]+ ( ' [0-9A-Fa-f]+ )* )? # Hexadecimal\n\t\t\t | 0b ( [0-1]+ ( ' [0-1]+ )* )? # Binary\n\t\t\t | 0 ( [0-7]+ ( ' [0-7]+ )* ) # Octal\n\t\t\t | ( [0-9]+ ( ' [0-9]+ )* ) # Decimal\n\t\t\t )\n\t\t\t ( ([uUfF] | u?ll? | U?LL?)\\b | (?\u003cinc\u003e') | \\b )\n\t\t\t| ( [0-9]+ ( ' [0-9]+ )* )?\n\t\t\t (?i:\n\t\t\t \\. ( [0-9]+ ( ' [0-9]+ )* ) E(\\+|-)? ( [0-9]+ ( ' [0-9]+ )* )\n\t\t\t | \\. ( [0-9]+ ( ' [0-9]+ )* )\n\t\t\t | E(\\+|-)? ( [0-9]+ ( ' [0-9]+ )* )\n\t\t\t )\n\t\t\t ( (?\u003cinc\u003e') | \\b )\n\t\t\t)", "captures": { "inc": { "name": "invalid.illegal.digit-separator-should-not-be-last.c++" } - }, - "match": "(?x)\\b\n\t\t\t( (?i:\n\t\t\t 0x ( [0-9A-Fa-f]+ ( ' [0-9A-Fa-f]+ )* )? # Hexadecimal\n\t\t\t | 0b ( [0-1]+ ( ' [0-1]+ )* )? # Binary\n\t\t\t | 0 ( [0-7]+ ( ' [0-7]+ )* ) # Octal\n\t\t\t | ( [0-9]+ ( ' [0-9]+ )* ) # Decimal\n\t\t\t )\n\t\t\t ( ([uUfF] | u?ll? | U?LL?)\\b | (?<inc>') | \\b )\n\t\t\t| ( [0-9]+ ( ' [0-9]+ )* )?\n\t\t\t (?i:\n\t\t\t \\. ( [0-9]+ ( ' [0-9]+ )* ) E(\\+|-)? ( [0-9]+ ( ' [0-9]+ )* )\n\t\t\t | \\. ( [0-9]+ ( ' [0-9]+ )* )\n\t\t\t | E(\\+|-)? ( [0-9]+ ( ' [0-9]+ )* )\n\t\t\t )\n\t\t\t ( (?<inc>') | \\b )\n\t\t\t)", - "name": "constant.numeric.c" + } }, { + "name": "string.quoted.double.c", "begin": "\"", + "end": "\"", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + } + ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.c" } }, - "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.c" } - }, - "name": "string.quoted.double.c", + } + }, + { + "name": "string.quoted.single.c", + "begin": "'", + "end": "'", "patterns": [ { "include": "#string_escaped_char" - }, - { - "include": "#string_placeholder" } - ] - }, - { - "begin": "'", + ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.c" } }, - "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.c" } - }, - "name": "string.quoted.single.c", + } + }, + { + "name": "meta.preprocessor.macro.c", + "begin": "(?x)\n \t\t^\\s*\\#\\s*(define)\\s+ # define\n \t\t((?\u003cid\u003e[a-zA-Z_][a-zA-Z0-9_]*)) # macro name\n \t\t(?: # and optionally:\n \t\t (\\() # an open parenthesis\n \t\t (\n \t\t \\s* \\g\u003cid\u003e \\s* # first argument\n \t\t ((,) \\s* \\g\u003cid\u003e \\s*)* # additional arguments\n \t\t (?:\\.\\.\\.)? # varargs ellipsis?\n \t\t )\n \t\t (\\)) # a close parenthesis\n \t\t)?\n \t", + "end": "(?=(?://|/\\*))|$", "patterns": [ { - "include": "#string_escaped_char" + "name": "punctuation.separator.continuation.c", + "match": "(?\u003e\\\\\\s*\\n)" + }, + { + "include": "$base" } - ] - }, - { - "begin": "(?x)\n \t\t^\\s*\\#\\s*(define)\\s+ # define\n \t\t((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name\n \t\t(?: # and optionally:\n \t\t (\\() # an open parenthesis\n \t\t (\n \t\t \\s* \\g<id> \\s* # first argument\n \t\t ((,) \\s* \\g<id> \\s*)* # additional arguments\n \t\t (?:\\.\\.\\.)? # varargs ellipsis?\n \t\t )\n \t\t (\\)) # a close parenthesis\n \t\t)?\n \t", + ], "beginCaptures": { "1": { "name": "keyword.control.import.define.c" }, "2": { @@ -125,177 +130,165 @@ "name": "punctuation.separator.parameters.c" }, "8": { "name": "punctuation.definition.parameters.end.c" } - }, - "end": "(?=(?://|/\\*))|$", - "name": "meta.preprocessor.macro.c", - "patterns": [ - { - "match": "(?>\\\\\\s*\\n)", - "name": "punctuation.separator.continuation.c" - }, - { - "include": "$base" - } - ] + } }, { + "name": "meta.preprocessor.diagnostic.c", "begin": "^\\s*#\\s*(error|warning)\\b", - "captures": { - "1": { - "name": "keyword.control.import.error.c" - } - }, "end": "$", - "name": "meta.preprocessor.diagnostic.c", "patterns": [ { - "match": "(?>\\\\\\s*\\n)", - "name": "punctuation.separator.continuation.c" + "name": "punctuation.separator.continuation.c", + "match": "(?\u003e\\\\\\s*\\n)" } - ] - }, - { - "begin": "^\\s*#\\s*(include|import)\\b", + ], "captures": { "1": { - "name": "keyword.control.import.include.c" + "name": "keyword.control.import.error.c" } - }, - "end": "(?=(?://|/\\*))|$", + } + }, + { "name": "meta.preprocessor.c.include", + "begin": "^\\s*#\\s*(include|import)\\b", + "end": "(?=(?://|/\\*))|$", "patterns": [ { - "match": "(?>\\\\\\s*\\n)", - "name": "punctuation.separator.continuation.c" + "name": "punctuation.separator.continuation.c", + "match": "(?\u003e\\\\\\s*\\n)" }, { + "name": "string.quoted.double.include.c", "begin": "\"", + "end": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.c" } }, - "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.c" } - }, - "name": "string.quoted.double.include.c" + } }, { - "begin": "<", + "name": "string.quoted.other.lt-gt.include.c", + "begin": "\u003c", + "end": "\u003e", "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" + } } - ] + ], + "captures": { + "1": { + "name": "keyword.control.import.include.c" + } + } }, { "include": "#pragma-mark" }, { + "name": "meta.preprocessor.c", "begin": "^\\s*#\\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef)\\b", - "captures": { - "1": { - "name": "keyword.control.import.c" - } - }, "end": "(?=(?://|/\\*))|$", - "name": "meta.preprocessor.c", "patterns": [ { - "match": "(?>\\\\\\s*\\n)", - "name": "punctuation.separator.continuation.c" + "name": "punctuation.separator.continuation.c", + "match": "(?\u003e\\\\\\s*\\n)" } - ] + ], + "captures": { + "1": { + "name": "keyword.control.import.c" + } + } }, { - "comment": "Reserved POSIX types", - "match": "\\b([a-z0-9_]+_t)\\b", - "name": "support.type.posix-reserved.c" + "name": "support.type.posix-reserved.c", + "match": "\\b([a-z0-9_]+_t)\\b" }, { "include": "#block" }, { - "begin": "(?x)\n \t\t(?: ^ # begin-of-line\n \t\t | \n \t\t (?: (?= \\s ) (?<!else|new|return) (?<=\\w) # or word + space before name\n \t\t | (?= \\s*[A-Za-z_] ) (?<!&&) (?<=[*&>]) # or type modifier before name\n \t\t )\n \t\t)\n \t\t(\\s*) (?!(while|for|do|if|else|switch|catch|enumerate|return|sizeof|[cr]?iterate)\\s*\\()\n \t\t(\n \t\t\t(?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name\n \t\t\t(?: (?<=operator) (?: [-*&<>=+!]+ | \\(\\) | \\[\\] ) ) # if it is a C++ operator\n \t\t)\n \t\t \\s*(?=\\()", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.function.leading.c" - }, - "3": { - "name": "entity.name.function.c" - }, - "4": { - "name": "punctuation.definition.parameters.c" - } - }, - "end": "(?<=\\})|(?=#)|(;)", "name": "meta.function.c", + "begin": "(?x)\n \t\t(?: ^ # begin-of-line\n \t\t | \n \t\t (?: (?= \\s ) (?\u003c!else|new|return) (?\u003c=\\w) # or word + space before name\n \t\t | (?= \\s*[A-Za-z_] ) (?\u003c!\u0026\u0026) (?\u003c=[*\u0026\u003e]) # or type modifier before name\n \t\t )\n \t\t)\n \t\t(\\s*) (?!(while|for|do|if|else|switch|catch|enumerate|return|sizeof|[cr]?iterate)\\s*\\()\n \t\t(\n \t\t\t(?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name\n \t\t\t(?: (?\u003c=operator) (?: [-*\u0026\u003c\u003e=+!]+ | \\(\\) | \\[\\] ) ) # if it is a C++ operator\n \t\t)\n \t\t \\s*(?=\\()", + "end": "(?\u003c=\\})|(?=#)|(;)", "patterns": [ { "include": "#comments" }, { "include": "#parens" }, { - "match": "\\b(const|final|override|noexcept)\\b", - "name": "storage.modifier.$1.c++" + "name": "storage.modifier.$1.c++", + "match": "\\b(const|final|override|noexcept)\\b" }, { "include": "#block" } - ] + ], + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.function.leading.c" + }, + "3": { + "name": "entity.name.function.c" + }, + "4": { + "name": "punctuation.definition.parameters.c" + } + } } ], "repository": { "access": { + "match": "(\\.)([a-zA-Z_][a-zA-Z_0-9]*)\\b(?!\\s*\\()", "captures": { "1": { "name": "punctuation.separator.variable-access.c" }, "2": { "name": "variable.other.dot-access.c" } - }, - "match": "(\\.)([a-zA-Z_][a-zA-Z_0-9]*)\\b(?!\\s*\\()" + } }, "block": { "patterns": [ { + "name": "meta.block.c", "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#block_innards" + } + ], "beginCaptures": { "0": { "name": "punctuation.section.block.begin.c" } }, - "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.block.end.c" } - }, - "name": "meta.block.c", - "patterns": [ - { - "include": "#block_innards" - } - ] + } } ] }, "block_innards": { "patterns": [ @@ -319,115 +312,114 @@ }, { "include": "#c_function_call" }, { + "name": "meta.initialization.c", + "match": "(?x)\n\t\t\t (?x)\n\t\t\t(?: \n\t\t\t (?: (?= \\s ) (?\u003c!else|new|return) (?\u003c=\\w)\\s+ # or word + space before name\n\t\t\t )\n\t\t\t)\n\t\t\t(\n\t\t\t\t(?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name\n\t\t\t\t(?: (?\u003c=operator) (?: [-*\u0026\u003c\u003e=+!]+ | \\(\\) | \\[\\] ) )? # if it is a C++ operator\n\t\t\t)\n\t\t\t \\s*(\\()", "captures": { "1": { "name": "variable.other.c" }, "2": { "name": "punctuation.definition.parameters.c" } - }, - "match": "(?x)\n\t\t\t (?x)\n\t\t\t(?: \n\t\t\t (?: (?= \\s ) (?<!else|new|return) (?<=\\w)\\s+ # or word + space before name\n\t\t\t )\n\t\t\t)\n\t\t\t(\n\t\t\t\t(?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name\n\t\t\t\t(?: (?<=operator) (?: [-*&<>=+!]+ | \\(\\) | \\[\\] ) )? # if it is a C++ operator\n\t\t\t)\n\t\t\t \\s*(\\()", - "name": "meta.initialization.c" + } }, { "include": "#block" }, { "include": "$base" } ] }, "c_function_call": { + "name": "meta.function-call.c", + "match": "(?x) (?: (?= \\s ) (?:(?\u003c=else|new|return) | (?\u003c!\\w)) (\\s+))?\n\t\t\t(\\b \n\t\t\t\t(?!(while|for|do|if|else|switch|catch|enumerate|return|sizeof|[cr]?iterate)\\s*\\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\\b | :: )++ # actual name\n\t\t\t)\n\t\t\t \\s*(\\()", "captures": { "1": { "name": "punctuation.whitespace.function-call.leading.c" }, "2": { "name": "support.function.any-method.c" }, "3": { "name": "punctuation.definition.parameters.c" } - }, - "match": "(?x) (?: (?= \\s ) (?:(?<=else|new|return) | (?<!\\w)) (\\s+))?\n\t\t\t(\\b \n\t\t\t\t(?!(while|for|do|if|else|switch|catch|enumerate|return|sizeof|[cr]?iterate)\\s*\\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\\b | :: )++ # actual name\n\t\t\t)\n\t\t\t \\s*(\\()", - "name": "meta.function-call.c" + } }, "comments": { "patterns": [ { + "name": "comment.block.c", + "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", "captures": { "1": { "name": "meta.toc-list.banner.block.c" } - }, - "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", - "name": "comment.block.c" + } }, { + "name": "comment.block.c", "begin": "/\\*", + "end": "\\*/", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.c" } }, - "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.c" } - }, - "name": "comment.block.c" + } }, { - "match": "\\*/.*\\n", - "name": "invalid.illegal.stray-comment-end.c" + "name": "invalid.illegal.stray-comment-end.c", + "match": "\\*/.*\\n" }, { + "name": "comment.line.banner.c++", + "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", "captures": { "1": { "name": "meta.toc-list.banner.line.c" } - }, - "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", - "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": { - "0": { - "name": "punctuation.definition.comment.c++" - } - }, "end": "\\n", - "name": "comment.line.double-slash.c++", "patterns": [ { - "match": "(?>\\\\\\s*\\n)", - "name": "punctuation.separator.continuation.c++" + "name": "punctuation.separator.continuation.c++", + "match": "(?\u003e\\\\\\s*\\n)" } - ] + ], + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.c++" + } + } } - ] + ], + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.c++" + } + } } ] }, "disabled": { "begin": "^\\s*#\\s*if(n?def)?\\b.*$", - "comment": "eat nested preprocessor if(def)s", "end": "^\\s*#\\s*endif\\b", "patterns": [ { "include": "#disabled" }, @@ -435,289 +427,283 @@ "include": "#pragma-mark" } ] }, "parens": { + "name": "meta.parens.c", "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "$base" + } + ], "beginCaptures": { "0": { "name": "punctuation.section.parens.begin.c" } }, - "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.parens.end.c" } - }, - "name": "meta.parens.c", - "patterns": [ - { - "include": "$base" - } - ] + } }, "pragma-mark": { + "name": "meta.section", + "match": "^\\s*(#\\s*(pragma\\s+mark)\\s+(.*))", "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.pragma.c" }, "3": { "name": "meta.toc-list.pragma-mark.c" } - }, - "match": "^\\s*(#\\s*(pragma\\s+mark)\\s+(.*))", - "name": "meta.section" + } }, "preprocessor-rule-disabled": { "begin": "^\\s*(#(if)\\s+(0)\\b).*", - "captures": { - "1": { - "name": "meta.preprocessor.c" - }, - "2": { - "name": "keyword.control.import.if.c" - }, - "3": { - "name": "constant.numeric.preprocessor.c" - } - }, "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b)", + "end": "(?=^\\s*#\\s*endif\\b)", + "patterns": [ + { + "include": "$base" + } + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.else.c" } - }, - "end": "(?=^\\s*#\\s*endif\\b)", - "patterns": [ - { - "include": "$base" - } - ] + } }, { - "begin": "", - "end": "(?=^\\s*#\\s*(else|endif)\\b)", "name": "comment.block.preprocessor.if-branch", + "end": "(?=^\\s*#\\s*(else|endif)\\b)", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } ] } - ] - }, - "preprocessor-rule-disabled-block": { - "begin": "^\\s*(#(if)\\s+(0)\\b).*", + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.if.c" }, "3": { "name": "constant.numeric.preprocessor.c" } - }, + } + }, + "preprocessor-rule-disabled-block": { + "begin": "^\\s*(#(if)\\s+(0)\\b).*", "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b)", + "end": "(?=^\\s*#\\s*endif\\b)", + "patterns": [ + { + "include": "#block_innards" + } + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.else.c" } - }, - "end": "(?=^\\s*#\\s*endif\\b)", - "patterns": [ - { - "include": "#block_innards" - } - ] + } }, { - "begin": "", - "end": "(?=^\\s*#\\s*(else|endif)\\b)", "name": "comment.block.preprocessor.if-branch.in-block", + "end": "(?=^\\s*#\\s*(else|endif)\\b)", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } ] } - ] - }, - "preprocessor-rule-enabled": { - "begin": "^\\s*(#(if)\\s+(0*1)\\b)", + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.if.c" }, "3": { "name": "constant.numeric.preprocessor.c" } - }, + } + }, + "preprocessor-rule-enabled": { + "begin": "^\\s*(#(if)\\s+(0*1)\\b)", "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { - "begin": "^\\s*(#\\s*(else)\\b).*", - "captures": { - "1": { - "name": "meta.preprocessor.c" - }, - "2": { - "name": "keyword.control.import.else.c" - } - }, "contentName": "comment.block.preprocessor.else-branch", + "begin": "^\\s*(#\\s*(else)\\b).*", "end": "(?=^\\s*#\\s*endif\\b)", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } - ] + ], + "captures": { + "1": { + "name": "meta.preprocessor.c" + }, + "2": { + "name": "keyword.control.import.else.c" + } + } }, { - "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b)", "patterns": [ { "include": "$base" } ] } - ] - }, - "preprocessor-rule-enabled-block": { - "begin": "^\\s*(#(if)\\s+(0*1)\\b)", + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.if.c" }, "3": { "name": "constant.numeric.preprocessor.c" } - }, + } + }, + "preprocessor-rule-enabled-block": { + "begin": "^\\s*(#(if)\\s+(0*1)\\b)", "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { - "begin": "^\\s*(#\\s*(else)\\b).*", - "captures": { - "1": { - "name": "meta.preprocessor.c" - }, - "2": { - "name": "keyword.control.import.else.c" - } - }, "contentName": "comment.block.preprocessor.else-branch.in-block", + "begin": "^\\s*(#\\s*(else)\\b).*", "end": "(?=^\\s*#\\s*endif\\b)", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } - ] + ], + "captures": { + "1": { + "name": "meta.preprocessor.c" + }, + "2": { + "name": "keyword.control.import.else.c" + } + } }, { - "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b)", "patterns": [ { "include": "#block_innards" } ] } - ] - }, - "preprocessor-rule-other": { - "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { - "name": "keyword.control.import.c" + "name": "keyword.control.import.if.c" + }, + "3": { + "name": "constant.numeric.preprocessor.c" } - }, + } + }, + "preprocessor-rule-other": { + "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "include": "$base" } - ] - }, - "preprocessor-rule-other-block": { - "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", + ], "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.c" } - }, + } + }, + "preprocessor-rule-other-block": { + "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "include": "#block_innards" } - ] + ], + "captures": { + "1": { + "name": "meta.preprocessor.c" + }, + "2": { + "name": "keyword.control.import.c" + } + } }, "sizeof": { - "match": "\\b(sizeof)\\b", - "name": "keyword.operator.sizeof.c" + "name": "keyword.operator.sizeof.c", + "match": "\\b(sizeof)\\b" }, "string_escaped_char": { "patterns": [ { - "match": "\\\\(\\\\|[abefnprtv'\"?]|[0-3]\\d{0,2}|[4-7]\\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8})", - "name": "constant.character.escape.c" + "name": "constant.character.escape.c", + "match": "\\\\(\\\\|[abefnprtv'\"?]|[0-3]\\d{0,2}|[4-7]\\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8})" }, { - "match": "\\\\.", - "name": "invalid.illegal.unknown-escape.c" + "name": "invalid.illegal.unknown-escape.c", + "match": "\\\\." } ] }, "string_placeholder": { "patterns": [ { - "match": "(?x)%\n \t\t\t\t\t\t(\\d+\\$)? # field (argument #)\n \t\t\t\t\t\t[#0\\- +']* # flags\n \t\t\t\t\t\t[,;:_]? # separator character (AltiVec)\n \t\t\t\t\t\t((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n \t\t\t\t\t\t(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n \t\t\t\t\t\t(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n \t\t\t\t\t\t[diouxXDOUeEfFgGaACcSspn%] # conversion type\n \t\t\t\t\t", - "name": "constant.other.placeholder.c" + "name": "constant.other.placeholder.c", + "match": "(?x)%\n \t\t\t\t\t\t(\\d+\\$)? # field (argument #)\n \t\t\t\t\t\t[#0\\- +']* # flags\n \t\t\t\t\t\t[,;:_]? # separator character (AltiVec)\n \t\t\t\t\t\t((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n \t\t\t\t\t\t(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n \t\t\t\t\t\t(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n \t\t\t\t\t\t[diouxXDOUeEfFgGaACcSspn%] # conversion type\n \t\t\t\t\t" } ] } - }, - "scopeName": "source.c", - "uuid": "25066DC2-6B1D-11D9-9D5B-000D93589AF6" -} \ No newline at end of file + } +}