tm-grammars
Version:
Collecton of TextMate grammars in JSON
1,963 lines (1,962 loc) • 55.3 kB
JSON
{
"displayName": "C3",
"fileTypes": [
"c3",
"c3i",
"c3t"
],
"name": "c3",
"patterns": [
{
"include": "#top_level"
},
{
"include": "#statements"
}
],
"repository": {
"assign_right_expression": {
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#expression"
}
]
},
"attribute": {
"patterns": [
{
"begin": "@(?:(?:align|allow_deprecated|benchmark|bigendian|builtin|callconv|cname|compact|const|deprecated|dynamic|export|extern|finalizer|format|if|inline|init|jump|link|littleendian|local|maydiscard|naked|noalias|nodiscard|noinit|noinline|nopadding|norecurse|noreturn|nosanitize|nostrip|obfuscate|operator|operator_r|operator_s|optional|overlap|packed|private|public|pure|reflect|safeinfer|safemacro|simd|section|structlike|tag|test|unused|used|wasm|weak|winmain)|\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*)\\b",
"beginCaptures": {
"0": {
"name": "keyword.annotation.c3"
}
},
"end": "(?=[^\\t (])|(?<=\\))",
"name": "meta.annotation.c3",
"patterns": [
{
"include": "#parens"
}
]
}
]
},
"block": {
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c3"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c3"
}
},
"name": "meta.block.c3",
"patterns": [
{
"include": "#statements"
}
]
}
]
},
"block_comment": {
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.c3"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.c3"
}
},
"name": "comment.block.c3",
"patterns": [
{
"include": "#block_comment_body"
}
]
},
"block_comment_body": {
"patterns": [
{
"begin": "/\\*",
"end": "\\*/",
"patterns": [
{
"include": "#block_comment_body"
}
]
}
]
},
"brackets": {
"patterns": [
{
"begin": "\\[<?",
"beginCaptures": {
"0": {
"name": "punctuation.section.brackets.begin.c3"
}
},
"end": ">?]",
"endCaptures": {
"0": {
"name": "punctuation.section.brackets.end.c3"
}
},
"name": "meta.brackets.c3",
"patterns": [
{
"include": "#expression"
}
]
}
]
},
"builtin": {
"patterns": [
{
"captures": {
"1": {
"name": "constant.language.c3"
},
"2": {
"name": "entity.name.function.builtin.c3"
}
},
"match": "(?:(\\$\\$\\b_*[A-Z][0-9A-Z_]*)|(\\$\\$\\b_*[a-z][0-9A-Z_a-z]*))\\b"
}
]
},
"bytes_literal": {
"patterns": [
{
"begin": "(x)([\"'`])",
"beginCaptures": {
"1": {
"name": "keyword.other.c3"
},
"2": {
"name": "punctuation.definition.string.begin.c3"
}
},
"end": "\\2",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c3"
}
},
"name": "string.quoted.other.c3",
"patterns": [
{
"match": "[f\\s\\h]+",
"name": "constant.numeric.integer.c3"
}
]
},
{
"begin": "(b64)([\"'`])",
"beginCaptures": {
"1": {
"name": "keyword.other.c3"
},
"2": {
"name": "punctuation.definition.string.begin.c3"
}
},
"end": "\\2",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c3"
}
},
"name": "string.quoted.other.c3",
"patterns": [
{
"match": "[+/-9=A-Za-z\\s]+",
"name": "constant.numeric.integer.c3"
}
]
}
]
},
"char_literal": {
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c3"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c3"
}
},
"name": "string.quoted.single.c3",
"patterns": [
{
"include": "#escape_sequence"
}
]
},
"comments": {
"patterns": [
{
"include": "#line_comment"
},
{
"include": "#block_comment"
},
{
"include": "#doc_comment"
}
]
},
"constants": {
"patterns": [
{
"match": "\\b(true|false|null)\\b",
"name": "constant.language.c3"
},
{
"begin": "\\b_*[A-Z][0-9A-Z_]*\\b",
"beginCaptures": {
"0": {
"name": "variable.other.constant.c3"
}
},
"end": "(?=[^\\t {])|(?<=})",
"patterns": [
{
"include": "#generic_args"
}
]
}
]
},
"contract_expression": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#function"
},
{
"include": "#constants"
},
{
"include": "#builtin"
},
{
"include": "#real_literal"
},
{
"include": "#integer_literal"
},
{
"include": "#operators"
},
{
"include": "#keywords"
},
{
"include": "#type"
},
{
"include": "#path"
},
{
"include": "#function_call"
},
{
"include": "#variable"
},
{
"include": "#parens"
},
{
"include": "#brackets"
},
{
"include": "#block"
},
{
"include": "#punctuation"
},
{
"include": "#leftover_at_ident"
}
]
},
"control_statements": {
"patterns": [
{
"begin": "\\$for\\b",
"beginCaptures": {
"0": {
"name": "keyword.control.ct.c3"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"patterns": [
{
"include": "#statements"
}
]
},
{
"begin": "\\$foreach\\b",
"beginCaptures": {
"0": {
"name": "keyword.control.ct.c3"
}
},
"end": "(?<=:)",
"patterns": [
{
"include": "#comments"
},
{
"match": "\\$\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "variable.other.c3"
},
{
"match": ",",
"name": "punctuation.separator.c3"
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "keyword.operator.c3"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"patterns": [
{
"include": "#expression"
}
]
}
]
},
{
"begin": "\\bfor\\b",
"beginCaptures": {
"0": {
"name": "keyword.control.c3"
}
},
"end": "(?<=\\))",
"patterns": [
{
"include": "#comments"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"patterns": [
{
"include": "#statements"
}
]
}
]
},
{
"begin": "\\$(?:switch|case|default|if)\\b",
"beginCaptures": {
"0": {
"name": "keyword.control.ct.c3"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"patterns": [
{
"include": "#expression"
}
]
},
{
"begin": "\\b(?:case|default)\\b",
"beginCaptures": {
"0": {
"name": "keyword.control.c3"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"patterns": [
{
"include": "#expression"
}
]
}
]
},
"doc_comment": {
"begin": "(?=<\\*)",
"end": "(\\*>)",
"endCaptures": {
"0": {
"name": "comment.block.documentation.c3"
},
"1": {
"name": "punctuation.definition.comment.end.c3"
}
},
"patterns": [
{
"include": "#doc_comment_body"
}
]
},
"doc_comment_body": {
"patterns": [
{
"begin": "(<\\*)\\s*(?=@)",
"beginCaptures": {
"0": {
"name": "comment.block.documentation.c3"
},
"1": {
"name": "punctuation.definition.comment.begin.c3"
}
},
"end": "(?=\\*>)",
"patterns": [
{
"captures": {
"0": {
"name": "comment.block.documentation.c3"
},
"1": {
"name": "variable.parameter.c3"
},
"2": {
"name": "support.type.c3"
},
"3": {
"name": "keyword.operator.variadic.c3"
}
},
"match": "@param(?:\\s*\\[&?(?:in|out|inout)])?\\s*(?:([#$]?\\b_*[a-z][0-9A-Z_a-z]*)\\b|(\\$\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*)\\b|(\\.\\.\\.))"
},
{
"begin": "@(?:require\\b|ensure\\b|return\\?)",
"beginCaptures": {
"0": {
"name": "comment.block.documentation.c3"
}
},
"end": "(?=:|\\*>|$)",
"patterns": [
{
"include": "#contract_expression"
}
]
},
{
"match": "@\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "comment.block.documentation.c3"
},
{
"match": ":",
"name": "comment.block.documentation.c3"
},
{
"match": "`[^`]*`|\"[^\"]*\"",
"name": "comment.block.documentation.c3"
}
]
},
{
"begin": "(<\\*)",
"beginCaptures": {
"0": {
"name": "comment.block.documentation.c3"
},
"1": {
"name": "punctuation.definition.comment.begin.c3"
}
},
"end": "(?=^\\s*@|\\*>)",
"name": "comment.block.documentation.c3"
},
{
"begin": "",
"end": "(?=\\*>)",
"patterns": [
{
"captures": {
"0": {
"name": "comment.block.documentation.c3"
},
"1": {
"name": "variable.parameter.c3"
},
"2": {
"name": "support.type.c3"
},
"3": {
"name": "keyword.operator.variadic.c3"
}
},
"match": "^\\s*@param(?:\\s*\\[&?(?:in|out|inout)])?\\s*(?:([#$]?\\b_*[a-z][0-9A-Z_a-z]*)\\b|(\\$\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*)\\b|(\\.\\.\\.))"
},
{
"begin": "^\\s*@(?:require\\b|ensure\\b|return\\?)",
"beginCaptures": {
"0": {
"name": "comment.block.documentation.c3"
}
},
"end": "(?=:|\\*>|$)",
"patterns": [
{
"include": "#contract_expression"
}
]
},
{
"match": "^\\s*@\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "comment.block.documentation.c3"
},
{
"match": ":",
"name": "comment.block.documentation.c3"
},
{
"match": "`[^`]*`|\"[^\"]*\"",
"name": "comment.block.documentation.c3"
}
]
}
]
},
"escape_sequence": {
"match": "\\\\([\"'0\\\\abefnrtv]|x\\h{2}|u\\h{4}|U\\h{8})",
"name": "constant.character.escape.c3"
},
"expression": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#function"
},
{
"include": "#constants"
},
{
"include": "#builtin"
},
{
"include": "#literals"
},
{
"include": "#operators"
},
{
"include": "#keywords"
},
{
"include": "#type"
},
{
"include": "#path"
},
{
"include": "#function_call"
},
{
"include": "#variable"
},
{
"include": "#parens"
},
{
"include": "#brackets"
},
{
"include": "#block"
},
{
"include": "#punctuation"
},
{
"include": "#leftover_at_ident"
}
]
},
"function": {
"begin": "(?=\\b(fn|macro)\\b)",
"end": "(?=[;={])",
"patterns": [
{
"begin": "\\b(fn|macro)\\b",
"beginCaptures": {
"1": {
"name": "keyword.declaration.function.c3"
}
},
"end": "(?=\\()",
"name": "meta.function.c3",
"patterns": [
{
"include": "#comments"
},
{
"include": "#function_header"
}
]
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"name": "meta.function.parameters.c3",
"patterns": [
{
"include": "#parameters"
}
]
},
{
"begin": "(?<=\\))",
"contentName": "meta.function.c3",
"end": "(?=[;={])",
"patterns": [
{
"include": "#comments"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
}
]
}
]
},
"function_call": {
"begin": "([#@]?\\b_*[a-z][0-9A-Z_a-z]*)\\b(?=\\s*(\\{.*})?\\s*\\()",
"beginCaptures": {
"1": {
"name": "entity.name.function.c3"
}
},
"end": "(?<=\\))",
"name": "meta.function_call.c3",
"patterns": [
{
"include": "#generic_args"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"name": "meta.group.c3",
"patterns": [
{
"include": "#comments"
},
{
"begin": "([#$]?\\b_*[a-z][0-9A-Z_a-z]*|\\$\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*)\\b\\s*(:)(?!:)",
"beginCaptures": {
"1": {
"name": "variable.parameter.c3"
},
"2": {
"name": "punctuation.separator.c3"
}
},
"end": "(?=\\))|([,;])",
"endCaptures": {
"1": {
"name": "punctuation.separator.c3"
}
},
"patterns": [
{
"include": "#expression"
}
]
},
{
"begin": "(?=\\S)",
"end": "(?=\\))|([,;])",
"endCaptures": {
"1": {
"name": "punctuation.separator.c3"
}
},
"patterns": [
{
"include": "#expression"
}
]
},
{
"match": ";",
"name": "punctuation.separator.c3"
}
]
}
]
},
"function_header": {
"patterns": [
{
"include": "#type"
},
{
"match": "\\.",
"name": "punctuation.accessor.c3"
},
{
"match": "@?\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "entity.name.function.c3"
}
]
},
"generic_args": {
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.generic.begin.c3"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.generic.end.c3"
}
},
"name": "meta.generic.c3",
"patterns": [
{
"include": "#expression"
}
]
}
]
},
"generic_params": {
"patterns": [
{
"begin": "<",
"beginCaptures": {
"0": {
"name": "punctuation.definition.generic.begin.c3"
}
},
"end": ">",
"endCaptures": {
"0": {
"name": "punctuation.definition.generic.end.c3"
}
},
"name": "meta.generic.c3",
"patterns": [
{
"include": "#comments"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"name": "support.type.c3"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*\\b",
"name": "variable.other.constant.c3"
},
{
"match": ",",
"name": "punctuation.separator.c3"
}
]
}
]
},
"integer_literal": {
"match": "\\b(?:0[Xx]\\h(?:_?\\h)*|0[Oo][0-7](_?[0-7])*|0[Bb][01](_?[01])*|[0-9](?:_?[0-9])*)(?:[IUiu](?:8|16|32|64|128)|[Uu][Ll]{0,2}|[Ll]{1,2})?",
"name": "constant.numeric.integer.c3"
},
"keywords": {
"patterns": [
{
"match": "\\$(?:alignof|assert|assignable|default|defined|echo|embed|eval|error|exec|extnameof|feature|include|is_const|kindof|nameof|offsetof|qnameof|sizeof|stringify|vacount|vaconst|vaarg|vaexpr|vasplat)\\b",
"name": "keyword.other.ct.c3"
},
{
"match": "\\$(?:case|else|endfor|endforeach|endif|endswitch|for|foreach|if|switch)\\b",
"name": "keyword.control.ct.c3"
},
{
"match": "\\b(?:assert|asm|catch|inline|import|module|interface|try|var)\\b",
"name": "keyword.other.c3"
},
{
"match": "\\b(?:break|case|continue|default|defer|do|else|for|foreach|foreach_r|if|nextcase|return|switch|while)\\b",
"name": "keyword.control.c3"
}
]
},
"leftover_at_ident": {
"patterns": [
{
"captures": {
"0": {
"name": "keyword.annotation.c3"
}
},
"match": "@(?:pure|inline|noinline)",
"name": "meta.annotation.c3"
},
{
"begin": "@\\b_*[a-z][0-9A-Z_a-z]*\\b",
"beginCaptures": {
"0": {
"name": "entity.name.function.c3"
}
},
"end": "(?=[^\\t {])|(?<=})",
"patterns": [
{
"include": "#generic_args"
}
]
}
]
},
"line_comment": {
"match": "//.*$",
"name": "comment.line.double-slash.c3"
},
"literals": {
"patterns": [
{
"include": "#string_literal"
},
{
"include": "#char_literal"
},
{
"include": "#raw_string_literal"
},
{
"include": "#real_literal"
},
{
"include": "#integer_literal"
},
{
"include": "#bytes_literal"
}
]
},
"modifier_keywords": {
"patterns": [
{
"match": "\\b(?:const|extern|static|tlocal|inline)\\b",
"name": "storage.modifier.c3"
}
]
},
"module_path": {
"patterns": [
{
"include": "#path"
},
{
"captures": {
"1": {
"name": "entity.name.scope-resolution.c3"
}
},
"match": "\\b(_*[a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.path.c3"
}
]
},
"operators": {
"patterns": [
{
"match": "=>",
"name": "keyword.declaration.function.arrow.c3"
},
{
"match": "(?:[-%\\&*+/^|]|>>|<<|\\+\\+\\+)=",
"name": "keyword.operator.assignment.augmented.c3"
},
{
"match": "<=|>=|==|[<>]|!=",
"name": "keyword.operator.comparison.c3"
},
{
"match": "\\.\\.\\.",
"name": "keyword.operator.variadic.c3"
},
{
"match": "\\.\\.",
"name": "keyword.operator.range.c3"
},
{
"match": "\\+\\+\\+?|--",
"name": "keyword.operator.arithmetic.c3"
},
{
"match": "<<|>>|&&&?|\\|\\|\\|?",
"name": "keyword.operator.arithmetic.c3"
},
{
"match": "[-%+/^|~]",
"name": "keyword.operator.arithmetic.c3"
},
{
"match": "=",
"name": "keyword.operator.assignment.c3"
},
{
"match": "\\?\\?\\??|\\?:|[!\\&*:?]",
"name": "keyword.operator.c3"
}
]
},
"parameters": {
"patterns": [
{
"include": "#comments"
},
{
"begin": "\\$\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"beginCaptures": {
"0": {
"name": "support.type.c3"
}
},
"end": "(?=[),;])",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=[),;])",
"patterns": [
{
"include": "#expression"
}
]
}
]
},
{
"include": "#type"
},
{
"include": "#punctuation"
},
{
"match": "\\.\\.\\.",
"name": "keyword.operator.variadic.c3"
},
{
"match": "&",
"name": "keyword.operator.address.c3"
},
{
"begin": ";",
"beginCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"end": "(?=\\))",
"patterns": [
{
"include": "#comments"
},
{
"match": "@\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "entity.name.function.c3"
},
{
"include": "#parameters"
}
]
},
{
"begin": "[#$]?\\b_*[a-z][0-9A-Z_a-z]*\\b",
"beginCaptures": {
"0": {
"name": "variable.parameter.c3"
}
},
"end": "(?=[),;])",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"match": "\\.\\.\\.",
"name": "keyword.operator.variadic.c3"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=[),;])",
"patterns": [
{
"include": "#expression"
}
]
}
]
}
]
},
"parens": {
"patterns": [
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"name": "meta.group.c3",
"patterns": [
{
"include": "#expression"
}
]
}
]
},
"path": {
"captures": {
"1": {
"name": "entity.name.scope-resolution.c3"
},
"2": {
"name": "punctuation.separator.scope-resolution.c3"
}
},
"match": "\\b(_*[a-z][0-9A-Z_a-z]*)\\b\\s*(::)",
"name": "meta.path.c3"
},
"punctuation": {
"patterns": [
{
"match": ",",
"name": "punctuation.separator.c3"
},
{
"match": ":",
"name": "punctuation.separator.c3"
},
{
"match": "\\.(?!\\.\\.)",
"name": "punctuation.accessor.c3"
}
]
},
"raw_string_literal": {
"begin": "`",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c3"
}
},
"end": "`(?!`)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c3"
}
},
"name": "string.quoted.other.c3",
"patterns": [
{
"match": "``",
"name": "constant.character.escape.c3"
}
]
},
"real_literal": {
"patterns": [
{
"match": "\\b[0-9](?:_?[0-9])*(?:[Ff](?:16|32|64|128)?|[Dd])",
"name": "constant.numeric.float.c3"
},
{
"match": "\\b(?:[0-9](?:_?[0-9])*[Ee][-+]?[0-9]+|[0-9](?:_?[0-9])*\\.(?!\\.)(?:[0-9](?:_?[0-9])*)?(?:[Ee][-+]?[0-9]+)?)(?:[Ff](?:16|32|64|128)?|[Dd])?",
"name": "constant.numeric.float.c3"
},
{
"match": "\\b0[Xx]\\h(?:_?\\h)*(?:\\.(?:\\h(?:_?\\h)*)?)?[Pp][-+]?[0-9]+(?:[Ff](?:16|32|64|128)?|[Dd])?",
"name": "constant.numeric.float.c3"
}
]
},
"statements": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#modifier_keywords"
},
{
"match": ";",
"name": "punctuation.terminator.c3"
},
{
"include": "#control_statements"
},
{
"include": "#attribute"
},
{
"include": "#block"
},
{
"include": "#expression"
}
]
},
"string_literal": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c3"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c3"
}
},
"name": "string.quoted.double.c3",
"patterns": [
{
"include": "#escape_sequence"
}
]
},
"structlike": {
"begin": "(?=\\b(?:((?:|bit)struct)|(union))\\b)",
"end": "(?<=})",
"patterns": [
{
"begin": "\\b(?:((?:|bit)struct)|(union))\\b",
"beginCaptures": {
"1": {
"name": "keyword.declaration.struct.c3"
},
"2": {
"name": "keyword.declaration.union.c3"
}
},
"end": "(?=\\{)",
"name": "meta.struct.c3",
"patterns": [
{
"include": "#comments"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"name": "entity.name.type.struct.c3"
},
{
"match": "\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "variable.other.member.c3"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"end": "(?=\\{)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#type_no_generics"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
}
]
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"name": "meta.group.c3",
"patterns": [
{
"include": "#comments"
},
{
"include": "#path"
},
{
"include": "#type"
},
{
"include": "#punctuation"
}
]
}
]
},
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c3"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c3"
}
},
"name": "meta.struct.body.c3",
"patterns": [
{
"include": "#comments"
},
{
"include": "#structlike"
},
{
"include": "#modifier_keywords"
},
{
"include": "#type"
},
{
"match": "\\b_*[a-z][0-9A-Z_a-z]*\\b",
"name": "variable.other.member.c3"
},
{
"include": "#attribute"
},
{
"match": ";",
"name": "punctuation.terminator.c3"
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#attribute"
},
{
"include": "#expression"
}
]
}
]
}
]
},
"top_level": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#modifier_keywords"
},
{
"begin": "\\$(?:assert|include|echo|exec)\\b",
"beginCaptures": {
"0": {
"name": "keyword.other.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"patterns": [
{
"include": "#comments"
},
{
"include": "#expression"
}
]
},
{
"begin": "\\bmodule\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.module.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"name": "meta.module.c3",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"include": "#module_path"
},
{
"include": "#generic_args"
},
{
"include": "#generic_params"
}
]
},
{
"begin": "\\bimport\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.import.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"name": "meta.import.c3",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"include": "#module_path"
},
{
"match": ",",
"name": "punctuation.separator.c3"
}
]
},
{
"include": "#function"
},
{
"begin": "\\balias\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.alias.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"name": "meta.alias.c3",
"patterns": [
{
"include": "#comments"
},
{
"begin": "(?=\\b(_*[a-z][0-9A-Z_a-z]*)\\b\\s*=\\s*module)",
"end": "(?=;)",
"patterns": [
{
"begin": "\\b(_*[a-z][0-9A-Z_a-z]*)\\b",
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"begin": "module",
"beginCaptures": {
"0": {
"name": "keyword.declaration.module.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#module_path"
}
]
}
]
}
]
}
]
},
{
"begin": "(?:(@\\b_*[a-z][0-9A-Z_a-z]*)|\\b(_*[a-z][0-9A-Z_a-z]*)|\\b(_*[A-Z][0-9A-Z_]*))\\b",
"beginCaptures": {
"1": {
"name": "entity.name.function.c3"
},
"2": {
"name": "variable.global.c3"
},
"3": {
"name": "variable.other.constant.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
},
{
"include": "#assign_right_expression"
}
]
},
{
"begin": "\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"beginCaptures": {
"0": {
"name": "entity.name.type.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
},
{
"include": "#assign_right_expression"
}
]
}
]
},
{
"begin": "\\btypedef\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.typedef.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"name": "meta.typedef.c3",
"patterns": [
{
"include": "#comments"
},
{
"begin": "\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"beginCaptures": {
"0": {
"name": "entity.name.type.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#parens"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
},
{
"include": "#assign_right_expression"
}
]
}
]
},
{
"begin": "\\bfaultdef\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.faultdef.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"name": "meta.faultdef.c3",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*\\b",
"name": "variable.other.constant.c3"
},
{
"match": ",",
"name": "punctuation.separator.c3"
}
]
},
{
"begin": "\\battrdef\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.attrdef.c3"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.c3"
}
},
"name": "meta.attrdef.c3",
"patterns": [
{
"include": "#comments"
},
{
"begin": "@\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"beginCaptures": {
"0": {
"name": "keyword.annotation.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"name": "meta.group.c3",
"patterns": [
{
"include": "#parameters"
}
]
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=;)",
"patterns": [
{
"include": "#comments"
},
{
"include": "#attribute"
},
{
"match": ",",
"name": "punctuation.separator.c3"
}
]
}
]
}
]
},
{
"include": "#structlike"
},
{
"begin": "(?=\\benum\\b)",
"end": "(?<=})",
"patterns": [
{
"begin": "\\benum\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.enum.c3"
}
},
"end": "(?=\\{)",
"name": "meta.enum.c3",
"patterns": [
{
"include": "#comments"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"name": "entity.name.type.enum.c3"
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.c3"
}
},
"end": "(?=\\{)",
"patterns": [
{
"include": "#comments"
},
{
"match": "\\b(?:inline|const)\\b",
"name": "storage.modifier.c3"
},
{
"include": "#type_no_generics"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.c3"
}
},
"contentName": "meta.group.c3",
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.c3"
}
},
"patterns": [
{
"include": "#comments"
},
{
"match": "\\b(?:inline|const)\\b",
"name": "storage.modifier.c3"
},
{
"include": "#parameters"
}
]
},
{
"include": "#generic_params"
},
{
"include": "#attribute"
}
]
}
]
},
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c3"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c3"
}
},
"name": "meta.enum.body.c3",
"patterns": [
{
"include": "#comments"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=,)",
"patterns": [
{
"include": "#expression"
}
]
},
{
"include": "#attribute"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*\\b",
"name": "variable.other.constant.c3"
},
{
"match": ",",
"name": "punctuation.separator.c3"
}
]
}
]
},
{
"begin": "(?=\\bconstdef\\b)",
"end": "(?<=})",
"patterns": [
{
"begin": "\\bconstdef\\b",
"beginCaptures": {
"0": {
"name": "keyword.declaration.constdef.c3"
}
},
"end": "(?=\\{)",
"name": "meta.constdef.c3",
"patterns": [
{
"include": "#comments"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*[a-z][0-9A-Z_a-z]*\\b",
"name": "entity.name.type.enum.c3"
},
{
"include": "#attribute"
}
]
},
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c3"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c3"
}
},
"name": "meta.constdef.body.c3",
"patterns": [
{
"include": "#comments"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.assignment.c3"
}
},
"end": "(?=[,}])",
"patterns": [
{
"include": "#expression"
}
]
},
{
"include": "#attribute"
},
{
"match": "\\b_*[A-Z][0-9A-Z_]*\\b",
"name": "variable.other.constant.c3"
},
{
"match": ",",
"name": "punctuation.separator.c3"
}
]
}