sapphire/editors/vscode/sapphirelang/syntaxes/sapphire.tmLanguage.json
2022-08-26 12:09:28 +02:00

68 lines
1.2 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Sapphire",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#comments"
},
{
"include": "#types"
},
{
"include": "#functions"
},
{
"include": "#variables"
}
],
"repository": {
"keywords": {
"patterns": [
{
"name": "keyword.control.sapphire",
"match": "\\b(let|in|syscall0|syscall1|syscall2|syscall3|syscall4|syscall5)\\b"
}
]
},
"types": {
"patterns": [
{
"name": "entity.name.type",
"match": "\\b(u8|u16|u32|u64|i8|i16|i32|i64|ptr8|ptr16|ptr32|ptr64|str|void)\\b"
}
]
},
"strings": {
"name": "string.quoted.sapphire",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.sapphire",
"match": "\\\\."
}
]
},
"comments": {
"name": "comment.line",
"begin": "//",
"end": "\n"
},
"functions": {
"name": "support.function",
"begin": "@",
"end": "\\b(in|;)\\b"
},
"variables": {
"name": "variable.name",
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
}
},
"scopeName": "source.sp"
}