{ "fileTypes": [ "pwn", "inc" ], "firstLineMatch": "-[*]-( Mode:)? C -[*]-", "foldingStartMarker": "(?x)\n\t\t /\\*\\*(?!\\*)\n\t\t|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))\n\t", "foldingStopMarker": "(?[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 \\s* # first argument\n \t\t ((,) \\s* \\g \\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.c" }, "2": { "name": "entity.name.function.preprocessor.c" }, "4": { "name": "punctuation.definition.parameters.c" }, "5": { "name": "variable.parameter.preprocessor.c" }, "7": { "name": "punctuation.separator.parameters.c" }, "8": { "name": "punctuation.definition.parameters.c" } }, "end": "(?=(?://|/\\*))|$", "name": "meta.preprocessor.macro.c", "patterns": [ { "match": "(?>\\\\\\s*\\n)", "name": "punctuation.separator.continuation.c" }, { "include": "$base" } ] }, { "captures": { "1": { "name": "keyword.control.import.error.c" } }, "end": "$", "name": "meta.preprocessor.diagnostic.c", "patterns": [ { "match": "(?>\\\\\\s*\\n)", "name": "punctuation.separator.continuation.c" } ] }, { "begin": "^\\s*#\\s*(include|tryinclude)\\b\\s+", "captures": { "1": { "name": "keyword.control.import.include.c" } }, "end": "(?=(?://|/\\*))|$", "name": "meta.preprocessor.macro.c", "patterns": [ { "match": "(?>\\\\\\s*\\n)", "name": "punctuation.separator.continuation.c" }, { "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*(assert|endinput|file|else|line|section)\\b", "captures": { "1": { "name": "keyword.control.import.c" } }, "end": "(?=(?://|/\\*))|$", "name": "meta.preprocessor.macro.c", "patterns": [ { "match": "(?>\\\\\\s*\\n)", "name": "punctuation.separator.continuation.c" } ] }, { "begin": "^\\s*#\\s*(pragma|undef)\\s+([a-zA-Z0-9_]*?)(?:(?=(?://|/\\*))|$)", "captures": { "1": { "name": "keyword.control.import.c" }, "2": { "name": "entity.name.function.preprocessor.c" } }, "end": "(?=(?://|/\\*))|$", "name": "meta.preprocessor.macro.c", "patterns": [ { "match": "(?>\\\\\\s*\\n)", "name": "punctuation.separator.continuation.c" } ] }, { "begin": "^\\s*#\\s*(error|warning)\\s+(.*?)(?:(?=(?://|/\\*))|$)", "captures": { "1": { "name": "keyword.control.import.c" }, "2": { "name": "string.quoted.double.c" } }, "end": "(?=(?://|/\\*))|$", "name": "meta.preprocessor.macro.c", "patterns": [ { "match": "(?>\\\\\\s*\\n)", "name": "punctuation.separator.continuation.c" } ] }, { "include": "#block" }, { "begin": "(?x)\n \t\t(?: ^ # begin-of-line\n \t\t |\n \t\t (?: (?= \\s ) (?]) # or type modifier before name\n \t\t )\n \t\t)\n \t\t(\\s*) (?!(assert|break|case|continue|default|do|else|exit|for|foreach|goto|if|return|sleep|state|switch|while)\\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", "patterns": [ { "include": "#comments" }, { "include": "#parens" }, { "match": "\\b(const|override)\\b", "name": "storage.modifier.c" }, { "include": "#block" } ] } ], "repository": { "block": { "begin": "\\{", "end": "\\}", "name": "meta.block.c", "patterns": [ { "include": "#block_innards" } ] }, "block_innards": { "patterns": [ { "include": "#preprocessor-rule-enabled-block" }, { "include": "#preprocessor-rule-disabled-block" }, { "include": "#preprocessor-rule-other-block" }, { "include": "#sizeof" }, { "include": "#access" }, { "captures": { "1": { "name": "punctuation.whitespace.support.function.leading.c" }, "2": { "name": "support.function.C99.c" } } }, { "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) | (?=+!]+ | \\(\\) | \\[\\] ) )? # if it is a C++ operator\n\t\t\t)\n\t\t\t \\s*(\\()", "name": "meta.initialization.c" }, { "include": "#block" }, { "include": "$base" } ] }, "comments": { "patterns": [ { "captures": { "1": { "name": "meta.toc-list.banner.block.c" } }, "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", "name": "comment.block.c" }, { "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.c" } }, "end": "\\*/", "name": "comment.block.c" }, { "match": "\\*/.*\\n", "name": "invalid.illegal.stray-comment-end.c" }, { "captures": { "1": { "name": "meta.toc-list.banner.line.c" } }, "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", "name": "comment.line.banner.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++" } ] } ] }, "disabled": { "begin": "^\\s*#\\s*(if|elseif)\\s*(!?defined)?\\b.*$", "comment": "eat nested preprocessor if(def)s", "end": "^\\s*#\\s*endif\\b.*$", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } ] }, "parens": { "begin": "\\(", "end": "\\)", "name": "meta.parens.c", "patterns": [ { "include": "$base" } ] }, "pragma-mark": { "captures": { "1": { "name": "meta.preprocessor.c" }, "2": { "name": "keyword.control.import.pragma.c" }, "3": { "name": "keyword.control.import.pragma.c" } }, "match": "^\\s*(#\\s*(pragma)\\s+(align|amxlimit|amxram|codepage|compress|ctrlchar|deprecated|dynamic|library|overlay|pack|rational|semicolon|tabsize|unused))", "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)", "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", "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" } }, "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b)", "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", "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" } }, "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", "end": "(?=^\\s*#\\s*endif\\b.*$)", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } ] }, { "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" } }, "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", "end": "(?=^\\s*#\\s*endif\\b.*$)", "patterns": [ { "include": "#disabled" }, { "include": "#pragma-mark" } ] }, { "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b.*$)", "patterns": [ { "include": "#block_innards" } ] } ] }, "preprocessor-rule-other": { "begin": "^\\s*(#\\s*((if|elseif)\\s*(!?defined)?)\\b\\s*(.*?)(?:(?=(?://|/\\*))|$))", "captures": { "1": { "name": "meta.preprocessor.macro.c" }, "2": { "name": "keyword.control.import.c" }, "5": { "name": "entity.name.function.preprocessor.c" } }, "end": "^\\s*(#\\s*(endif)\\b).*$", "patterns": [ { "include": "$base" } ] }, "preprocessor-rule-other-block": { "begin": "^\\s*(#\\s*((if|elseif)\\s*(!?defined)?)\\b\\s*(.*?)(?:(?=(?://|/\\*))|$))", "captures": { "1": { "name": "meta.preprocessor.macro.c" }, "2": { "name": "keyword.control.import.c" }, "5": { "name": "entity.name.function.preprocessor.c" } }, "end": "^\\s*(#\\s*(endif)\\b).*$", "patterns": [ { "include": "#block_innards" } ] }, "sizeof": { "match": "\\b(sizeof)\\b", "name": "keyword.operator.sizeof.c" }, "string_escaped_char": { "patterns": [ { "match": "\\\\(\\\\|[abefnprtv'\"?]|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8})", "name": "constant.character.escape.c" }, { "match": "\\\\.", "name": "invalid.illegal.unknown-escape.c" } ] }, "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[a-zA-Z%] # all letters, thanks to formatex specifier extensions\n \t\t\t\t\t", "name": "constant.other.placeholder.c" } ] }, "operators": { "match": "\\=|\\+|\\-|\\*|\\/|\\%|\\+\\+|\\-\\-|\\=\\=|\\!\\=|<|>|<\\=|>\\=|\\!|&&|\\||\\~|&|\\||\\^|>|\\+\\=|\\-\\=|\\*\\=|/\\=|\\%\\=|&\\=|\\|\\=|\\^\\=|<<\\=|>>\\=|\\->|\\->\\*|\\.|\\.\\*|\\?|\\\\:\\:", "name": "keyword.operator.sizeof.c" } }, "scopeName": "source.pawn", "uuid": "25066DC2-6B1D-11D9-9D5B-000D93589AF6" }