138 lines
2.3 KiB
JSON
138 lines
2.3 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
"scopeName": "source.mu",
|
|
"name": "muScript",
|
|
"patterns": [
|
|
{
|
|
"name": "meta.preprocessor",
|
|
"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"
|
|
}
|
|
},
|
|
"name": "meta.literals",
|
|
"match": "\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\b"
|
|
},
|
|
{
|
|
"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",
|
|
"begin": "\\{\\s*(?:([a-zA-Z_$][a-zA-Z0-9_$]*)(?:, )?)*\\s*->",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "variable.parameter"
|
|
}
|
|
},
|
|
"end": "\\}",
|
|
"patterns": [
|
|
{
|
|
"include": "#identifiers"
|
|
},
|
|
{
|
|
"include": "#expressions"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |