syntax-muscript/syntaxes/muscript.tmLanguage.json

146 lines
2.5 KiB
JSON
Raw Normal View History

2024-09-30 16:47:17 +02:00
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"scopeName": "source.mu",
"name": "muScript",
"patterns": [
{
2024-09-30 17:07:23 +02:00
"name": "meta.preprocessor.include.muscript",
2024-09-30 16:47:17 +02:00
"match": "^\\s*#\\w+"
},
{
"include": "#expressions"
}
],
"repository": {
"expressions": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#closure"
},
{
"include": "#identifiers"
},
{
"include": "#operators"
}
]
},
"identifiers": {
"patterns": [
{
"captures": {
"0": {
"name": "constant.numeric.boolean.muscript"
}
},
"name": "meta.literals",
"match": "\\b(true|false|null)\\b"
},
{
"captures": {
"0": {
"name": "variable.other.muscript"
}
},
2024-09-30 17:07:23 +02:00
"name": "variable.name",
2024-09-30 16:47:17 +02:00
"match": "\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\b"
},
2024-09-30 17:07:23 +02:00
{
"name": "variable.name",
"begin": "`",
"end": "`"
},
2024-09-30 16:47:17 +02:00
{
"captures": {
"0": {
"name": "constant.numeric.muscript"
}
},
"name": "meta.literals",
"match": "\\b(\\d+(?:\\.\\d*))\\b"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.muscript",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.muscript",
"match": "\\\\."
}
]
},
{
"name": "string.quoted.single.muscript",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.muscript",
"match": "\\\\."
}
]
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.muscript",
"match": "//.*$"
},
{
"name": "comment.block.muscript",
"begin": "/\\*",
"end": "\\*/"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.muscript",
"match": "[-+*/%^<>=!&|]"
},
{
"name": ""
}
]
},
"closure": {
"patterns": [
{
"name": "meta.function.muscript",
2024-09-30 17:07:23 +02:00
"begin": "\\{",
"end": "->",
2024-09-30 16:47:17 +02:00
"patterns": [
{
2024-09-30 17:07:23 +02:00
"captures": {
"0": {
"name": "variable.other.muscript"
}
},
"name": "variable.parameter.muscript",
"match": "\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\b"
2024-09-30 16:47:17 +02:00
},
{
2024-09-30 17:07:23 +02:00
"name": "variable.parameter.muscript",
"begin": "`",
"end": "`"
2024-09-30 16:47:17 +02:00
}
]
}
]
}
}
}