vue2-grammar/syntaxes/swmf.tmLanguage.json
2019-11-27 01:01:09 +10:00

97 lines
2.1 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "SWMF Config",
"patterns": [
{
"include": "#comment"
},
{
"include": "#marker"
},
{
"include": "#run_end"
},
{
"include": "#command"
},
{
"include": "#strings"
}
],
"repository": {
"comment": {
"name":"comment.swmf",
"match": "^[^#].*\n"
},
"command": {
"patterns": [{
"name":"cat.comment.swmf",
"begin": "^(#[a-zA-Z0-9_]+)(\\s.*)?\n",
"end": "(?=(^\\s*\n|^#.*\n))"
,
"beginCaptures":
{
"1" : {"name" : "support.function.swmf" },
"2" : {"name" : "comment.swmf"}
},
"patterns": [
{"include": "#param-integer"},
{"include": "#param-float"},
{"include": "#param-boolean"},
{"include": "#param-string"}
]
}]
},
"marker": {
"patterns": [{
"match": "^(#(?:BEGIN|END)_COMP) ([A-Z][A-Z])(\\s.*)?\n",
"captures":
{
"1" : {"name" : "entity.name.function.subroutine.swmf"},
"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"}
}
}]
},
"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"}
}
}
},
"scopeName": "source.swmf"
}