1
0
Fork 0
mirror of https://github.com/Reuh/vscode-candran.git synced 2025-10-27 10:09:31 +00:00

Initial commit

This commit is contained in:
Étienne Fildadut 2024-12-22 16:14:47 +01:00
commit 2a0b47fa48
11 changed files with 1150 additions and 0 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Set default behavior to automatically normalize line endings.
* text=auto

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules
*.vsix

17
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,17 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}

4
.vscodeignore Normal file
View file

@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md

9
CHANGELOG.md Normal file
View file

@ -0,0 +1,9 @@
# Change Log
All notable changes to the "candran" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [Unreleased]
- Initial release

21
LICENSE.md Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 最萌小汐
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

13
README.md Normal file
View file

@ -0,0 +1,13 @@
# candran README
Basic support for the Candran language for Visual Studio Code.
Based on VS Code's built-in (Lua grammar)[https://github.com/LuaLS/lua.tmbundle].
## Installation
Clone this repository into your VS Code extension directory:
* Windows: `%USERPROFILE%\.vscode\extensions`
* macOS: `~/.vscode/extensions`
* Linux: `~/.vscode/extensions`

View file

@ -0,0 +1,34 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "--",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": [ "--[[", "]]--" ]
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "'", "close": "'", "notIn": ["string"] }
],
// symbols that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
"indentationRules": {
"increaseIndentPattern": "((^\\s*\\b(((local|let)?[\\s\\w=]+)?function|repeat|else|elseif|if|while)\\b|^.*\\b(do|then)\\b|^.*([\\(\\,\\=\\[\\{\\+\\-\\*\\/\\^\\%\\&\\|\\:]|and|or|\\/\\/|\\.\\.|\\>\\>|\\<\\<)\\s*(\\(\\)|\\([A-Za-z_][A-Za-z0-9_]*[=,\\)]))((?!\\bend\\b).)*$|^.*\\{((?!\\}).)*$)",
"decreaseIndentPattern": "(^\\s*\\b(elsei|elseif|else|end|until)\\b.*$|^((?!\\{).)*\\}\\;?.*$)"
}
}

15
package-lock.json generated Normal file
View file

@ -0,0 +1,15 @@
{
"name": "candran",
"version": "0.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "candran",
"version": "0.0.1",
"engines": {
"vscode": "^1.96.0"
}
}
}
}

35
package.json Normal file
View file

@ -0,0 +1,35 @@
{
"name": "candran",
"displayName": "candran",
"description": "Add language support for Candran",
"version": "0.0.1",
"engines": {
"vscode": "^1.96.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "candran",
"aliases": [
"Candran",
"candran"
],
"extensions": [
"can",
"candran"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "candran",
"scopeName": "source.candran",
"path": "./syntaxes/candran.tmLanguage.json"
}
]
}
}

View file

@ -0,0 +1,998 @@
{
"name": "Candran",
"scopeName": "source.candran",
"patterns": [
{
"begin": "\\b(?:(local)\\s+)?(function)\\b(?![,:])",
"beginCaptures": {
"1": {
"name": "keyword.local.candran"
},
"2": {
"name": "keyword.control.candran"
}
},
"end": "(?<=[\\)\\-{}\\[\\]\"'])",
"name": "meta.function.candran",
"patterns": [
{
"include": "#comment"
},
{
"include": "#function-parameters"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s*(?=:)",
"name": "entity.name.class.candran"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"name": "entity.name.function.candran"
}
]
},
{
"begin": ":(?=\\()",
"beginCaptures": {
"0": {
"name": "keyword.control.candran"
}
},
"end": "(?<=[\\)\\-{}\\[\\]\"'])",
"name": "meta.function.candran",
"patterns": [
{
"include": "#comment"
},
{
"include": "#function-parameters"
}
]
},
{
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]*)?([eE]-?\\d*)?([pP][-+]\\d+)?",
"name": "constant.numeric.float.hexadecimal.candran"
},
{
"match": "(?<![\\w\\d.])0[xX]\\.[0-9A-Fa-f]+([eE]-?\\d*)?([pP][-+]\\d+)?",
"name": "constant.numeric.float.hexadecimal.candran"
},
{
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])",
"name": "constant.numeric.integer.hexadecimal.candran"
},
{
"match": "(?<![\\w\\d.])\\d+(\\.\\d*)?([eE]-?\\d*)?",
"name": "constant.numeric.float.candran"
},
{
"match": "(?<![\\w\\d.])\\.\\d+([eE]-?\\d*)?",
"name": "constant.numeric.float.candran"
},
{
"match": "(?<![\\w\\d.])\\d+(?![pPeE.0-9])",
"name": "constant.numeric.integer.candran"
},
{
"include": "#string"
},
{
"captures": {
"1": {
"name": "punctuation.definition.comment.candran"
}
},
"match": "\\A(#!).*$\\n?",
"name": "comment.line.shebang.candran"
},
{
"include": "#comment"
},
{
"captures": {
"1": {
"name": "keyword.control.goto.candran"
},
"2": {
"name": "string.tag.candran"
}
},
"match": "\\b(goto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)"
},
{
"captures": {
"1": {
"name": "punctuation.section.embedded.begin.candran"
},
"2": {
"name": "punctuation.section.embedded.end.candran"
}
},
"match": "(::)\\s*[a-zA-Z_][a-zA-Z0-9_]*\\s*(::)",
"name": "string.tag.candran"
},
{
"match": "<\\s*(const|close)\\s*>",
"captures": {
"0": {
"name": "storage.type.attribute.candran"
}
}
},
{
"match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>",
"name": "storage.type.generic.candran"
},
{
"match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in|continue|push)\\b",
"name": "keyword.control.candran"
},
{
"match": "\\b(local|let)\\b",
"name": "keyword.local.candran"
},
{
"match": "\\b(const)\\b",
"name": "keyword.const.candran"
},
{
"match": "\\b(close)\\b",
"name": "keyword.close.candran"
},
{
"match": "\\b(function)\\b(?![,:])",
"name": "keyword.control.candran"
},
{
"match": "(?<![^.]\\.|:)\\b(false|nil(?!:)|true|_ENV|_G|_VERSION|math\\.(pi|huge|maxinteger|mininteger)|utf8\\.charpattern|io\\.(stdin|stdout|stderr)|package\\.(config|cpath|loaded|loaders|path|preload|searchers))\\b|(?<![.])\\.{3}(?!\\.)",
"name": "constant.language.candran"
},
{
"match": "(?<![^.]\\.|:)\\b(self)\\b|@",
"name": "variable.language.self.candran"
},
{
"match": "(?<![^.]\\.|:)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b(?!\\s*=(?!=))",
"name": "support.function.candran"
},
{
"match": "(?<![^.]\\.|:)\\b(async)\\b(?!\\s*=(?!=))",
"name": "entity.name.tag.candran"
},
{
"match": "(?<![^.]\\.|:)\\b(coroutine\\.(create|isyieldable|close|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)|table\\.(concat|insert|maxn|move|pack|remove|sort|unpack)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?|tointeger|type)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(loadlib|seeall|searchpath)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|[gs]etuservalue|set[Cc]stacklimit|traceback|upvalueid|upvaluejoin)|bit32\\.(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)|utf8\\.(char|codes|codepoint|len|offset))\\b(?!\\s*=(?!=))",
"name": "support.function.library.candran"
},
{
"match": "\\b(and|or|not|\\|\\||\\&\\&|\\!)\\b",
"name": "keyword.operator.candran"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*(?:[({\"']|\\[\\[))",
"name": "support.function.any-method.candran"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*\\??:)",
"name": "entity.name.class.candran"
},
{
"match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)",
"name": "entity.other.attribute.candran"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)",
"name": "variable.other.candran"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*=\\s*\\b(function)\\b)",
"name": "entity.name.function.candran"
},
{
"match": "\\+|-|%|#|\\*|\\/|\\^|\\&|\\|>>|<<|==?|~=|!=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
"name": "keyword.operator.candran"
}
],
"repository": {
"escaped_char": {
"patterns": [
{
"match": "\\\\[abfnrtv\\\\\"'\\n]",
"name": "constant.character.escape.candran"
},
{
"match": "\\\\z[\\n\\t ]*",
"name": "constant.character.escape.candran"
},
{
"match": "\\\\\\d{1,3}",
"name": "constant.character.escape.byte.candran"
},
{
"match": "\\\\x[0-9A-Fa-f][0-9A-Fa-f]",
"name": "constant.character.escape.byte.candran"
},
{
"match": "\\\\u\\{[0-9A-Fa-f]+\\}",
"name": "constant.character.escape.unicode.candran"
},
{
"match": "\\\\.",
"name": "invalid.illegal.character.escape.candran"
}
]
},
"string": {
"patterns": [
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.candran"
}
},
"end": "'[ \\t]*|(?=\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.candran"
}
},
"name": "string.quoted.single.candran",
"patterns": [
{
"include": "#escaped_char"
}
]
},
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.candran"
}
},
"end": "\"[ \\t]*|(?=\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.candran"
}
},
"name": "string.quoted.double.candran",
"patterns": [
{
"include": "#escaped_char"
}
]
},
{
"begin": "`",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.candran"
}
},
"end": "`[ \\t]*|(?=\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.candran"
}
},
"name": "string.quoted.double.candran"
},
{
"begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)",
"beginCaptures": {
"0": {
"name": "string.quoted.other.multiline.candran"
},
"1": {
"name": "punctuation.definition.string.begin.candran"
}
},
"contentName": "meta.embedded.candran",
"end": "(\\]\\2\\])[ \\t]*",
"endCaptures": {
"0": {
"name": "string.quoted.other.multiline.candran"
},
"1": {
"name": "punctuation.definition.string.end.candran"
}
},
"patterns": [
{
"include": "source.c"
}
]
},
{
"begin": "(?<!--)\\[(=*)\\[",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.candran"
}
},
"end": "\\]\\1\\][ \\t]*",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.candran"
}
},
"name": "string.quoted.other.multiline.candran"
}
]
},
"comment": {
"patterns": [
{
"begin": "(^[ \\t]+)?(?=--)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.candran"
}
},
"end": "(?!\\G)((?!^)[ \\t]+\\n)?",
"endCaptures": {
"1": {
"name": "punctuation.whitespace.comment.trailing.candran"
}
},
"patterns": [
{
"begin": "--\\[(=*)\\[@@@",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.candran"
}
},
"end": "(--)?\\]\\1\\]",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.candran"
}
},
"name": "",
"patterns": [
{
"include": "source.candran"
}
]
},
{
"begin": "--\\[(=*)\\[",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.candran"
}
},
"end": "(--)?\\]\\1\\]",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.candran"
}
},
"name": "comment.block.candran",
"patterns": [
{
"include": "#emmydoc"
},
{
"include": "#ldoc_tag"
}
]
},
{
"begin": "----",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.candran"
}
},
"end": "\\n",
"name": "comment.line.double-dash.candran"
},
{
"begin": "---",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.candran"
}
},
"end": "\\n",
"name": "comment.line.double-dash.documentation.candran",
"patterns": [
{
"include": "#emmydoc"
},
{
"include": "#ldoc_tag"
}
]
},
{
"begin": "--",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.candran"
}
},
"end": "\\n",
"name": "comment.line.double-dash.candran",
"patterns": [
{
"include": "#ldoc_tag"
}
]
}
]
},
{
"begin": "\\/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.candran"
}
},
"end": "\\*\\/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.candran"
}
},
"name": "comment.block.candran",
"patterns": [
{
"include": "#emmydoc"
},
{
"include": "#ldoc_tag"
}
]
}
]
},
"function-parameters": {
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.definition.parameters.begin.candran"
}
},
"end": "(\\))|(?=[\\-\\.{}\\[\\]\"'])",
"endCaptures": {
"1": {
"name": "punctuation.definition.parameters.finish.candran"
}
},
"name": "meta.parameter.candran",
"patterns": [
{
"include": "#comment"
},
{
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
"name": "variable.parameter.function.candran"
},
{
"match": ",",
"name": "punctuation.separator.arguments.candran"
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.arguments.candran"
}
},
"end": "(?=[\\),])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "keyword.operator.candran"
}
},
"end": "(?=[\\),])",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"emmydoc": {
"patterns": [
{
"begin": "(?<=---)[ \\t]*@class",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"name": "support.class.candran"
},
{
"match": ":|,",
"name": "keyword.operator.candran"
}
]
},
{
"begin": "(?<=---)[ \\t]*@enum",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"beginCaptures": {
"0": {
"name": "variable.candran"
}
},
"end": "(?=\\n)"
}
]
},
{
"begin": "(?<=---)[ \\t]*@type",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
},
{
"begin": "(?<=---)[ \\t]*@alias",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"beginCaptures": {
"0": {
"name": "variable.candran"
}
},
"end": "(?=[\\n#])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
}
]
},
{
"begin": "(?<=---)[ \\t]*(@operator)\\s*(\\b[a-z]+)?",
"beginCaptures": {
"1": {
"name": "storage.type.annotation.candran"
},
"2": {
"name": "support.function.library.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
},
{
"begin": "(?<=---)[ \\t]*@cast",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"beginCaptures": {
"0": {
"name": "variable.other.candran"
}
},
"end": "(?=\\n)",
"patterns": [
{
"include": "#emmydoc.type"
},
{
"match": "([+-|])",
"name": "keyword.operator.candran"
}
]
}
]
},
{
"begin": "(?<=---)[ \\t]*@param",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(\\??)",
"beginCaptures": {
"1": {
"name": "entity.name.variable.candran"
},
"2": {
"name": "keyword.operator.candran"
}
},
"end": "(?=[\\n#])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
}
]
},
{
"begin": "(?<=---)[ \\t]*@return",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"match": "\\?",
"name": "keyword.operator.candran"
},
{
"include": "#emmydoc.type"
}
]
},
{
"begin": "(?<=---)[ \\t]*@field",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "(\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b|(\\[))(\\??)",
"beginCaptures": {
"2": {
"name": "entity.name.variable.candran"
},
"3": {
"name": "keyword.operator.candran"
}
},
"end": "(?=[\\n#])",
"patterns": [
{
"include": "#string"
},
{
"include": "#emmydoc.type"
},
{
"match": "\\]",
"name": "keyword.operator.candran"
}
]
}
]
},
{
"begin": "(?<=---)[ \\t]*@generic",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"beginCaptures": {
"0": {
"name": "storage.type.generic.candran"
}
},
"end": "(?=\\n)|(,)",
"endCaptures": {
"0": {
"name": "keyword.operator.candran"
}
},
"patterns": [
{
"match": ":",
"name": "keyword.operator.candran"
},
{
"include": "#emmydoc.type"
}
]
}
]
},
{
"begin": "(?<=---)[ \\t]*@vararg",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
},
{
"begin": "(?<=---)[ \\t]*@overload",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#emmydoc.type"
}
]
},
{
"begin": "(?<=---)[ \\t]*@deprecated",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---)[ \\t]*@meta",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---)[ \\t]*@private",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---)[ \\t]*@protected",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---)[ \\t]*@package",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---)[ \\t]*@version",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"match": "\\b(5\\.1|5\\.2|5\\.3|5\\.4|JIT)\\b",
"name": "support.class.candran"
},
{
"match": ",|\\>|\\<",
"name": "keyword.operator.candran"
}
]
},
{
"begin": "(?<=---)[ \\t]*@see",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"name": "support.class.candran"
},
{
"match": "#",
"name": "keyword.operator.candran"
}
]
},
{
"begin": "(?<=---)[ \\t]*@diagnostic",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "([a-zA-Z_\\-0-9]+)[ \\t]*(:)?",
"beginCaptures": {
"1": {
"name": "keyword.other.unit"
},
"2": {
"name": "keyword.operator.unit"
}
},
"end": "(?=\\n)",
"patterns": [
{
"match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\-]*)",
"name": "support.class.candran"
},
{
"match": ",",
"name": "keyword.operator.candran"
}
]
}
]
},
{
"begin": "(?<=---)[ \\t]*@module",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#string"
}
]
},
{
"match": "(?<=---)[ \\t]*@(async|nodiscard)",
"name": "storage.type.annotation.candran"
},
{
"begin": "(?<=---)\\|\\s*[\\>\\+]?",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.candran"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#string"
}
]
}
]
},
"emmydoc.type": {
"patterns": [
{
"begin": "\\bfun\\b",
"beginCaptures": {
"0": {
"name": "keyword.control.candran"
}
},
"end": "(?=[\\s#])",
"patterns": [
{
"match": "[\\(\\),:\\?][ \\t]*",
"name": "keyword.operator.candran"
},
{
"match": "([a-zA-Z_][a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]*)(?<!,)[ \\t]*(?=\\??:)",
"name": "entity.name.variable.candran"
},
{
"include": "#emmydoc.type"
},
{
"include": "#string"
}
]
},
{
"match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>",
"name": "storage.type.generic.candran"
},
{
"match": "\\basync\\b",
"name": "entity.name.tag.candran"
},
{
"match": "[\\{\\}\\:\\,\\?\\|\\`][ \\t]*",
"name": "keyword.operator.candran"
},
{
"begin": "(?=[a-zA-Z_\\.\\*\"'\\[])",
"end": "(?=[\\s\\)\\,\\?\\:\\}\\|#])",
"patterns": [
{
"match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*",
"name": "support.type.candran"
},
{
"match": "(\\.\\.\\.)[ \\t]*",
"name": "constant.language.candran"
},
{
"include": "#string"
}
]
}
]
},
"ldoc_tag": {
"match": "\\G[ \\t]*(@)(alias|annotation|author|charset|class|classmod|comment|constructor|copyright|description|example|export|factory|field|file|fixme|function|include|lfunction|license|local|module|name|param|pragma|private|raise|release|return|script|section|see|set|static|submodule|summary|tfield|thread|tparam|treturn|todo|topic|type|usage|warning|within)\\b",
"captures": {
"1": {
"name": "punctuation.definition.block.tag.ldoc"
},
"2": {
"name": "storage.type.class.ldoc"
}
}
}
}
}