Dino compiler: language, formatter, language server, docs, editor support
Compiler in Rust (lexer, parser, checker, C codegen), maps, chars, dino fmt, dino lsp (diagnostics, formatting, outline, definition, hover, completion, signature help), docs, examples, VS Code/Vim files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e2779f447
commit
eaf9567a36
117 files changed
+19970
No files matched your search
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
"name": "Dino",
|
||||
"scopeName": "source.dino",
|
||||
"patterns": [
|
||||
{ "include": "#comments" },
|
||||
{ "include": "#strings" },
|
||||
{ "include": "#chars" },
|
||||
{ "include": "#declarations" },
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#constants" },
|
||||
{ "include": "#numbers" },
|
||||
{ "include": "#types" },
|
||||
{ "include": "#calls" },
|
||||
{ "include": "#operators" }
|
||||
],
|
||||
"repository": {
|
||||
"comments": {
|
||||
"patterns": [
|
||||
{ "name": "comment.line.double-slash.dino", "match": "//.*$" },
|
||||
{ "name": "comment.block.dino", "begin": "/\\*", "end": "\\*/" }
|
||||
]
|
||||
},
|
||||
"strings": {
|
||||
"name": "string.quoted.double.dino",
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"patterns": [
|
||||
{ "name": "constant.character.escape.dino", "match": "\\\\." },
|
||||
{
|
||||
"name": "meta.interpolation.dino",
|
||||
"begin": "\\{",
|
||||
"end": "\\}",
|
||||
"beginCaptures": { "0": { "name": "punctuation.section.interpolation.begin.dino" } },
|
||||
"endCaptures": { "0": { "name": "punctuation.section.interpolation.end.dino" } },
|
||||
"patterns": [{ "include": "$self" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
"chars": {
|
||||
"name": "string.quoted.single.dino",
|
||||
"match": "'(?:\\\\.|[^'\\\\])'",
|
||||
"captures": {}
|
||||
},
|
||||
"declarations": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\b(func)\\s+([A-Za-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.declaration.function.dino" },
|
||||
"2": { "name": "entity.name.function.dino" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "\\b(struct|enum|interface)\\s+([A-Za-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.declaration.type.dino" },
|
||||
"2": { "name": "entity.name.type.dino" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"keywords": {
|
||||
"patterns": [
|
||||
{ "name": "keyword.control.dino", "match": "\\b(if|else|for|in|step|match|return|break|continue)\\b" },
|
||||
{ "name": "keyword.declaration.dino", "match": "\\b(func|var|const|import|struct|enum|interface|pub)\\b" },
|
||||
{ "name": "storage.modifier.dino", "match": "\\b(shared|weak)\\b" }
|
||||
]
|
||||
},
|
||||
"constants": {
|
||||
"name": "constant.language.dino",
|
||||
"match": "\\b(true|false|nil)\\b"
|
||||
},
|
||||
"numbers": {
|
||||
"name": "constant.numeric.dino",
|
||||
"match": "\\b[0-9][0-9_]*(?:\\.[0-9][0-9_]*)?\\b"
|
||||
},
|
||||
"types": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.type.builtin.dino",
|
||||
"match": "\\b(int|float|bool|char|string|error|map|i8|i16|i32|i64|u8|u16|u32|u64|f32|f64)\\b"
|
||||
},
|
||||
{ "name": "entity.name.type.dino", "match": "\\b[A-Z][A-Za-z0-9_]*\\b" }
|
||||
]
|
||||
},
|
||||
"calls": {
|
||||
"name": "entity.name.function.call.dino",
|
||||
"match": "\\b[a-z_][A-Za-z0-9_]*(?=\\s*\\()"
|
||||
},
|
||||
"operators": {
|
||||
"patterns": [
|
||||
{ "name": "keyword.operator.arrow.dino", "match": "=>" },
|
||||
{ "name": "keyword.operator.range.dino", "match": "\\.\\." },
|
||||
{ "name": "keyword.operator.comparison.dino", "match": "==|!=|<=|>=|<|>" },
|
||||
{ "name": "keyword.operator.logical.dino", "match": "&&|\\|\\||!" },
|
||||
{ "name": "keyword.operator.assignment.dino", "match": "[-+*/%]?=" },
|
||||
{ "name": "keyword.operator.arithmetic.dino", "match": "[-+*/%]" },
|
||||
{ "name": "keyword.operator.optional.dino", "match": "\\?" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user