{ "name": "Chapel", "scopeName": "source.chapel", "patterns": [ { "include": "#comments" }, { "name": "keyword.control.chapel", "match": "\\b(align|as|atomic|begin|borrowed|break|by|catch|class|cobegin|coforall|continue|delete|dmapped|do|else|enum|except|export|extern|for|forall|if|index|inline|in|inout|iter|label|lambda|let|local|module|new|noinit|on|only|otherwise|out|override|owned|pragma|private|proc|prototype|public|record|reduce|ref|require|return|scan|select|serial|shared|sync|then|throw|throws|try|union|unmanaged|use|var|when|where|while|with|yield|zip)\\b" }, { "name": "storage.type.chapel", "match": "\\b(bool|complex|dmap|domain|imag|int|opaque|range|real|string|subdomain|tuple|uint)\\b" }, { "name": "storage.modifier.chapel", "match": "\\b(borrowed|config|const|enum|owned|param|private|public|single|shared|sparse|sync|type|unmanaged)\\b" }, { "name": "constant.language.chapel", "match": "\\b(true|false|nil)\\b" }, { "name": "constant.numeric.chapel", "match": "\\b((0(b|B)[0-1]([0-1]|_)*)|(0(o|O)[0-7]([0-7]|_)*)|(0(x|X)((([0-9a-fA-F]([0-9a-fA-F]|_)*\\.?([0-9a-fA-F]([0-9a-fA-F]|_)*)?)|(\\.[0-9a-fA-F]([0-9a-fA-F]|_)*))((p|P)(\\+|-)?[0-9]([0-9]|_)*)?))|(0(x|X)[0-9a-fA-F]([0-9a-fA-F]|_)*)|((([0-9]([0-9]|_)*\\.?([0-9]([0-9]|_)*)?)|(\\.[0-9]([0-9]|_)*))((e|E)(\\+|-)?[0-9]([0-9]|_)*)?))\\b" }, { "name": "variable.language.chapel", "match": "\\b(FileAccessMode|here|LocaleSpace|Locales|locale|numLocales|super|these|this)\\b" }, { "name": "string.quoted.double.chapel", "begin": "\"", "end": "\"", "patterns": [ { "include": "#string_escaped_char" }, { "include": "#string_placeholder" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.chapel" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.chapel" } } }, { "name": "string.quoted.single.chapel", "begin": "'", "end": "'", "patterns": [ { "include": "#string_escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.chapel" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.chapel" } } }, { "name": "keyword.operator.comparison.chapel", "match": "\u003c\\=|\u003e\\=|\\=\\=|\u003c|\u003e|\\!\\=" }, { "name": "keyword.operator.assignment.augmented.chapel", "match": "\\+\\=|-\\=|\\*\\=|/\\=|//\\=|%\\=|\u0026\\=|\\|\\=|\\^\\=|\u003e\u003e\\=|\u003c\u003c\\=|\\*\\*\\=" }, { "name": "keyword.operator.arithmetic.chapel", "match": "\\+|\\-|\\*|\\*\\*|/|//|%|\u003c\u003c|\u003e\u003e|\u0026|\\||\\^|~|\u003c\\=\u003e\\\\.\\.\\." }, { "name": "keyword.operator.assignment.chapel", "match": "\\=" }, { "name": "keyword.operator.others.chapel", "match": ":" }, { "name": "keyword.operator.domain.chapel", "match": "\\[|\\]" }, { "name": "meta.function.chapel", "begin": "^\\s*(proc)\\s+(?=[A-Za-z_][A-Za-z0-9_]*)", "end": "(\\()|\\s*($\\n?|#.*$\\n?)", "patterns": [ { "contentName": "entity.name.function.chapel", "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "end": "(?![A-Za-z0-9_])" }, { "contentName": "keyword.control.chapel", "match": "proc" }, { "contentName": "meta.function.parameters.chapel", "begin": "(\\()", "end": "(?=\\)).*\\{", "patterns": [ { "match": "\\b([a-zA-Z_][a-zA-Z_0-9]*)", "captures": { "1": { "name": "variable.parameter.function.chapel" } } } ] } ], "beginCaptures": { "1": { "name": "keyword.control.chapel" } } }, { "name": "meta.function-call.chapel", "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*\\s*\\()", "end": "(\\))", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\()", "end": "(?=\\s*\\()", "patterns": [ { "include": "#builtin_functions" } ] }, { "contentName": "meta.function-call.arguments.chapel", "begin": "(\\()", "end": "(?=\\))", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.chapel" } } } ] } ], "repository": { "builtin_functions": { "name": "support.function.builtin.chapel", "match": "(?x)\\b(\n \t abs | close | exit| max | min | open | read | readln | sqrt | write | writeln\n\t\t\t\n\t\t\t)\\b" }, "comments": { "patterns": [ { "name": "comment.block.chapel", "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", "captures": { "1": { "name": "meta.toc-list.banner.block.c" } } }, { "name": "comment.block.chapel", "begin": "/\\*", "end": "\\*/", "captures": { "0": { "name": "punctuation.definition.comment.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" } } }, { "name": "comment.line.double-slash.c++", "begin": "//", "end": "$\\n?", "patterns": [ { "name": "punctuation.separator.continuation.c++", "match": "(?\u003e\\\\\\s*\\n)" } ], "beginCaptures": { "0": { "name": "punctuation.definition.comment.c" } } } ] }, "entity_name_function": { "patterns": [ { "include": "#illegal_names" }, { "include": "#generic_names" } ] }, "generic_names": { "match": "[A-Za-z_][A-Za-z0-9_]*" }, "illegal_names": { "name": "invalid.illegal.name.chapel", "match": "\\b(align|as|atomic|begin|borrowed|break|by|catch|class|cobegin|coforall|continue|delete|dmapped|do|else|enum|except|export|extern|for|forall|if|index|inline|in|inout|iter|label|lambda|let|local|module|new|noinit|on|only|otherwise|out|override|owned|pragma|private|proc|public|record|reduce|ref|require|return|scan|select|serial|shared|single|sync|then|throw|throws|try|union|unmanaged|use|var|when|where|while|with|yield|zip)\\b" }, "string_escaped_char": { "patterns": [ { "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})" }, { "name": "invalid.illegal.unknown-escape.c", "match": "\\\\." } ] }, "string_placeholder": { "patterns": [ { "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" } ] } } }