Pretty much same as sublime

This commit is contained in:
Dag Evensberget 2019-11-27 01:01:09 +10:00
parent 4f08ea86c3
commit 9e7d87d6ca

View File

@ -2,6 +2,9 @@
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "SWMF Config", "name": "SWMF Config",
"patterns": [ "patterns": [
{
"include": "#comment"
},
{ {
"include": "#marker" "include": "#marker"
}, },
@ -16,15 +19,27 @@
} }
], ],
"repository": { "repository": {
"comment": {
"name":"comment.swmf",
"match": "^[^#].*\n"
},
"command": { "command": {
"patterns": [{ "patterns": [{
"match": "^(#[a-zA-Z0-9_]+)(\\s.*)?\n" "name":"cat.comment.swmf",
"begin": "^(#[a-zA-Z0-9_]+)(\\s.*)?\n",
"end": "(?=(^\\s*\n|^#.*\n))"
, ,
"captures": "beginCaptures":
{ {
"1" : {"name" : "support.function.swmf" }, "1" : {"name" : "support.function.swmf" },
"2" : {"name" : "comment.swmf"} "2" : {"name" : "comment.swmf"}
} },
"patterns": [
{"include": "#param-integer"},
{"include": "#param-float"},
{"include": "#param-boolean"},
{"include": "#param-string"}
]
}] }]
}, },
"marker": { "marker": {
@ -32,7 +47,7 @@
"match": "^(#(?:BEGIN|END)_COMP) ([A-Z][A-Z])(\\s.*)?\n", "match": "^(#(?:BEGIN|END)_COMP) ([A-Z][A-Z])(\\s.*)?\n",
"captures": "captures":
{ {
"1" : {"name" : "support.function.swmf"}, "1" : {"name" : "entity.name.function.subroutine.swmf"},
"2" : {"name" : "string.swmf"}, "2" : {"name" : "string.swmf"},
"3" : {"name" : "comment.swmf"} "3" : {"name" : "comment.swmf"}
} }
@ -49,16 +64,33 @@
} }
}] }]
}, },
"strings": { "param-float": {
"name": "string.quoted.double.swmf", "match": "^ ?([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:\\d[eE][+-]?\\d+)?)(\\s.*)?\n",
"begin": "\"", "captures": {
"end": "\"", "1" : {"name" : "constant.numeric.integer.swmf" },
"patterns": [ "2" : {"name" : "comment.swmf"}
{ }
"name": "constant.character.escape.swmf", },
"match": "\\\\." "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" "scopeName": "source.swmf"