2018-11-26 11:50:46 +00:00
|
|
|
{
|
|
|
|
"$schema": "./tmLanguageSchema.json",
|
|
|
|
"scopeName": "source.upsilon",
|
|
|
|
"fileTypes": ["lua", "yup"],
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"name": "keyword.control",
|
2019-02-17 17:07:28 +00:00
|
|
|
"match": "\\b(if|while|for|return|in|end|local|true|false|not|then|elseif|else|break|yield)\\b"
|
2018-11-26 11:50:46 +00:00
|
|
|
},
|
|
|
|
{
|
2019-02-17 17:07:28 +00:00
|
|
|
"begin": "\\b(?:(local)\\s+)?(function|coroutine)\\s*(?:\\s+([a-zA-Z_][a-zA-Z0-9_]*(?:([\\.:])[a-zA-Z_][a-zA-Z0-9_]*)?)\\s*)?(\\()",
|
2018-11-26 11:50:46 +00:00
|
|
|
"beginCaptures": {
|
|
|
|
"1": {
|
|
|
|
"name": "storage.modifier.local"
|
|
|
|
},
|
|
|
|
"2": {
|
|
|
|
"name": "keyword.control"
|
|
|
|
},
|
|
|
|
"3": {
|
|
|
|
"name": "entity.name.function"
|
|
|
|
},
|
|
|
|
"4": {
|
|
|
|
"name": "keyword.control"
|
|
|
|
},
|
|
|
|
"5": {
|
|
|
|
"name": "keyword.control"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"end": "\\)",
|
|
|
|
"endCaptures": {
|
|
|
|
"0": {
|
|
|
|
"name": "keyword.control"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"name": "meta.function",
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"match": "[a-zA-Z_][a-zA-Z0-9_]*",
|
|
|
|
"name": "variable.parameter"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "keyword.operator",
|
|
|
|
"match": "\\b(and|or|not|\\+|-|==|=)\\b"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "constant",
|
|
|
|
"match": "\\bnil\\b"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "string.quoted.double",
|
|
|
|
"begin": "\"",
|
|
|
|
"end": "\"",
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"name": "constant.character.escape",
|
|
|
|
"match": "\\\\"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "string.quoted.single",
|
|
|
|
"begin": "'",
|
|
|
|
"end": "'",
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"name": "constant.character.escape",
|
|
|
|
"match": "\\\\"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2018-11-27 13:59:17 +00:00
|
|
|
"match": "\\b([0-9]+(.[0-9])?)\\b",
|
2018-11-26 11:50:46 +00:00
|
|
|
"name": "constant.numeric"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
|
|
|
|
"name": "variable"
|
2018-11-26 13:05:40 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"match": "(--.*)",
|
|
|
|
"name": "comment"
|
2018-11-26 11:50:46 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|