Files
core/editor/vscode/syntaxes/dever.tmLanguage.json
T
2026-11-27 06:03:56 +00:00

198 lines
5.1 KiB
JSON

{
"name": "Dever",
"scopeName": "source.dever",
"patterns": [
{
"include": "#strings"
},
{
"include": "#comments"
},
{
"include": "#unsupported"
},
{
"include": "#declarations"
},
{
"include": "#constants"
},
{
"include": "#numbers"
},
{
"include": "#names"
},
{
"include": "#keywords"
},
{
"include": "#operators"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.number-sign.dever",
"match": "(#).*$",
"captures": { "1": { "name": "punctuation.definition.comment.dever" } }
},
{
"name": "comment.block.dever",
"begin": "/\\*",
"end": "\\*/",
"beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.dever" } },
"endCaptures": { "0": { "name": "punctuation.definition.comment.end.dever" } }
}
]
},
"strings": {
"name": "string.quoted.double.dever",
"begin": "\"",
"end": "\"|$",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.dever"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.dever"
}
},
"patterns": [
{
"name": "constant.character.escape.dever",
"match": "\\\\(?:[\"\\\\nrt]|u\\{[0-9A-Fa-f]{1,6}\\})"
},
{
"name": "invalid.illegal.escape.dever",
"match": "\\\\."
}
]
},
"declarations": {
"patterns": [
{
"match": "\\b(type)\\s+([A-Z][A-Za-z0-9_]*)",
"captures": {
"1": {
"name": "storage.type.dever"
},
"2": {
"name": "entity.name.type.dever"
}
}
},
{
"match": "^\\s*(?:(public)\\s+)?(get|post|put|delete|cmd|rest)\\b",
"captures": {
"1": {
"name": "storage.modifier.dever"
},
"2": {
"name": "keyword.control.api.dever"
}
}
},
{
"match": "^\\s*(external)\\s+(command|exec|pip|npm|go)\\b",
"captures": {
"1": {
"name": "storage.modifier.external.dever"
},
"2": {
"name": "keyword.other.external.dever"
}
}
},
{
"name": "keyword.other.declaration.dever",
"match": "^\\s*(database|relation|seed|migrate|sql|index|unique|schedule)\\b"
}
]
},
"constants": {
"name": "constant.language.dever",
"match": "\\b(true|false|null|other)\\b"
},
"unsupported": {
"name": "invalid.illegal.keyword.dever",
"match": "\\b(package|exposes|pure|if|switch|match|when|by|for|while|break|continue|iterate|recur|repeat|return|function|throw|catch|try|import|use|class|interface|unsafe|macro)\\b"
},
"numbers": {
"name": "constant.numeric.dever",
"match": "(?<![A-Za-z0-9_])[0-9](?:_?[0-9])*(?:\\.[0-9](?:_?[0-9])*)?(?:[eE][+-]?[0-9](?:_?[0-9])*)?(?![A-Za-z0-9_])"
},
"names": {
"patterns": [
{
"name": "variable.other.member.dever",
"match": "\\b[a-z_][A-Za-z0-9_]*(?=\\s*:)"
},
{
"name": "entity.name.function.dever",
"match": "\\b[a-z_][A-Za-z0-9_]*(?=\\s*\\()"
},
{
"name": "support.type.dever",
"match": "\\b(Int|Float|Decimal|Bool|Text|Bytes|Secret|List|Map|Stream|AsyncStream|Channel|Task|Group|Json|Date|Time|DateTime|Duration|Id|Uuid|Upload)\\b"
},
{
"name": "entity.name.type.dever",
"match": "\\b[A-Z][A-Za-z0-9_]*\\b"
},
{
"name": "entity.name.namespace.dever",
"match": "\\b(dever|app|domain|data|port|adapter)(?=\\.)"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.operator.logical.dever",
"match": "\\b(and|or|not)\\b"
},
{
"name": "storage.modifier.dever",
"match": "\\b(public|authenticated|long|global|transaction|job|recover|fails|private|owner)\\b"
},
{
"name": "keyword.other.data.dever",
"match": "\\b(default|unique|index|raw|lower|upper|before|after|drop)\\b"
},
{
"name": "keyword.other.adapter.dever",
"match": "\\b(setting|lib|file|allow)\\b"
},
{
"name": "keyword.control.dever",
"match": "\\b(rule|flow|loop|each|in|skip|check|else|parallel|const)\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "punctuation.separator.table.dever",
"match": "\\|"
},
{
"name": "keyword.operator.dever",
"match": "//|=>|==|!=|<=|>=|[=+*/%<>?-]"
},
{
"name": "punctuation.section.dever",
"match": "[{}()\\[\\]]"
},
{
"name": "punctuation.separator.dever",
"match": "[,:.]"
}
]
}
}
}