sapphire/editors/vscode/sapphirelang/syntaxes/sapphire.tmLanguage.json

64 lines
1.1 KiB
JSON
Raw Normal View History

{
"$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(out|var|import|ret|asm)\\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": "(\\s|\\{|\\()"
},
"variables": {
"name": "variable.name",
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
}
},
"scopeName": "source.sp"
}