2019-11-26 14:02:14 +01:00
|
|
|
{
|
|
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
|
|
"name": "SWMF Config",
|
|
|
|
"patterns": [
|
2019-11-26 16:01:09 +01:00
|
|
|
{
|
|
|
|
"include": "#comment"
|
|
|
|
},
|
2019-11-26 14:02:14 +01:00
|
|
|
{
|
2019-11-26 15:15:38 +01:00
|
|
|
"include": "#marker"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"include": "#run_end"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"include": "#command"
|
2019-11-26 14:02:14 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"include": "#strings"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"repository": {
|
2019-11-26 16:01:09 +01:00
|
|
|
"comment": {
|
|
|
|
"name":"comment.swmf",
|
|
|
|
"match": "^[^#].*\n"
|
|
|
|
},
|
2019-11-26 15:15:38 +01:00
|
|
|
"command": {
|
2019-11-26 14:02:14 +01:00
|
|
|
"patterns": [{
|
2019-11-28 06:37:37 +01:00
|
|
|
"name":"source.swmf",
|
2019-11-26 16:01:09 +01:00
|
|
|
"begin": "^(#[a-zA-Z0-9_]+)(\\s.*)?\n",
|
|
|
|
"end": "(?=(^\\s*\n|^#.*\n))"
|
2019-11-26 15:15:38 +01:00
|
|
|
,
|
2019-11-26 16:01:09 +01:00
|
|
|
"beginCaptures":
|
2019-11-26 15:15:38 +01:00
|
|
|
{
|
|
|
|
"1" : {"name" : "support.function.swmf" },
|
|
|
|
"2" : {"name" : "comment.swmf"}
|
2019-11-26 16:01:09 +01:00
|
|
|
},
|
|
|
|
"patterns": [
|
|
|
|
{"include": "#param-integer"},
|
|
|
|
{"include": "#param-float"},
|
|
|
|
{"include": "#param-boolean"},
|
|
|
|
{"include": "#param-string"}
|
|
|
|
]
|
2019-11-26 15:15:38 +01:00
|
|
|
}]
|
|
|
|
},
|
|
|
|
"marker": {
|
|
|
|
"patterns": [{
|
|
|
|
"match": "^(#(?:BEGIN|END)_COMP) ([A-Z][A-Z])(\\s.*)?\n",
|
|
|
|
"captures":
|
|
|
|
{
|
2019-11-26 16:01:09 +01:00
|
|
|
"1" : {"name" : "entity.name.function.subroutine.swmf"},
|
2019-11-26 15:15:38 +01:00
|
|
|
"2" : {"name" : "string.swmf"},
|
|
|
|
"3" : {"name" : "comment.swmf"}
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
"run_end": {
|
|
|
|
"patterns":
|
|
|
|
[{
|
|
|
|
"match": "(^#(?:RUN|END))(\\s.*)?\n",
|
|
|
|
"captures":
|
|
|
|
{
|
|
|
|
"1" : {"name" : "keyword.swmf" },
|
|
|
|
"2" : {"name" : "comment.swmf"}
|
|
|
|
}
|
2019-11-26 14:02:14 +01:00
|
|
|
}]
|
|
|
|
},
|
2019-11-26 16:01:09 +01:00
|
|
|
"param-float": {
|
|
|
|
"match": "^ ?([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:\\d[eE][+-]?\\d+)?)(\\s.*)?\n",
|
|
|
|
"captures": {
|
|
|
|
"1" : {"name" : "constant.numeric.integer.swmf" },
|
|
|
|
"2" : {"name" : "comment.swmf"}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"param-integer": {
|
|
|
|
"match": "^ ?([+-]?[0-9]+)(\\s.*)?\n",
|
|
|
|
"captures": {
|
|
|
|
"1" : {"name" : "constant.numeric.integer.swmf" },
|
|
|
|
"2" : {"name" : "comment.swmf"}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"param-boolean": {
|
|
|
|
"match": "^ ?((?:\\.true\\.|\\.false\\.|T|F))(\\s.*)?\n",
|
|
|
|
"captures": {
|
|
|
|
"1" : {"name" : "constant.language.swmf" },
|
|
|
|
"2" : {"name" : "comment.swmf"}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"param-string": {
|
|
|
|
"match": "^ ?((?:\\S+ ? ?)*)(\\s.*)?\n",
|
|
|
|
"captures": {
|
|
|
|
"1" : {"name" : "string.swmf" },
|
|
|
|
"2" : {"name" : "comment.swmf"}
|
|
|
|
}
|
2019-11-26 14:02:14 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"scopeName": "source.swmf"
|
2019-11-28 06:37:37 +01:00
|
|
|
}
|