|
@@ -1,78 +1,28 @@
|
|
|
{
|
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
|
"name": "QSP",
|
|
|
+ "scopeName": "text.qsp.qsrc",
|
|
|
"patterns": [
|
|
|
{
|
|
|
- "include": "#strings"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "entity.other.attribute-name.qsp",
|
|
|
- "match": "^(:)[^'\"]*$\n?"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "variable.parameter.url.qsp",
|
|
|
- "match": "^-{1,2}\\S.*?\\S-{1,2}$"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "constant.character.qsp",
|
|
|
- "match": "^(#)\\s?.+$"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "constant.character.qsp",
|
|
|
- "match": "\\b\\d+\\b"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "variable.parameter.url.qsp",
|
|
|
- "match": "\\b(?i:([$]dyneval|[$]user_text|[$]usrtxt|[$]maintxt|[$]stattxt|[$]func|[$]curloc|[$]selobj|[$]selact|[$]curact|[$]getobj|[$]mid|[$](u|l)case|[$]trim|[$]replace|[$]str|[$]loc|[$]strfind))\\b"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "variable.parameter.url.qsp",
|
|
|
- "match": "\\b(?i:(dyneval|input|user_text|usrtxt|iif|rgb|isplay|msecscount|desc|maintxt|stattxt|qspver|func|curloc|selobj|no|and|mod|selact|curact|arrsize|arrpos|countobj|getobj|led|mid|(u|l)case|trim|replace|instr|isnum|val|str|loc|or|max|min|r(a)?nd|(arr|str)comp|str(find|pos)))\\b"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "keyword.control.qsp",
|
|
|
- "match": "\\b[$](?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "keyword.control.qsp",
|
|
|
- "match": "\\b(?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "keyword.control.qsp",
|
|
|
- "match": "\\b(?i:(nosave|disablescroll|disablesubex|debug|usehtml|(b|f|l)color|fsize))\\b"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "support.function.qsp",
|
|
|
- "match": "\\b(?i:(act|exit|killvar|cla|\\*?clr|\\*?clear|gs|xgt|gt|goto|gosub|\\[|\\]|xgoto|if|else|elseif|end|jump|\\*|&|\\*?(n|p)l))\\b"
|
|
|
+ "include": "#begin-end"
|
|
|
},
|
|
|
{
|
|
|
- "name": "support.function.qsp",
|
|
|
- "match": "(?i:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\+|=|-|(<|>)=?|=?(<|>)))"
|
|
|
+ "include": "#comments"
|
|
|
},
|
|
|
{
|
|
|
- "name": "comment.block.doubleexclamation.qsp",
|
|
|
- "begin": "!!{",
|
|
|
- "end": "}$"
|
|
|
+ "include": "#keyword-control"
|
|
|
},
|
|
|
{
|
|
|
- "name": "comment.block.exclamation.qsp",
|
|
|
- "begin": "!{",
|
|
|
- "end": "}$"
|
|
|
+ "include": "#keyword-operators"
|
|
|
},
|
|
|
{
|
|
|
- "name": "comment.line.doubleexclamation.qsp",
|
|
|
- "begin": "!!",
|
|
|
- "end": "$"
|
|
|
+ "include": "#marks"
|
|
|
},
|
|
|
{
|
|
|
- "name": "comment.line.exclamation.qsp",
|
|
|
- "begin": "^!",
|
|
|
- "end": "$"
|
|
|
+ "include": "#strings"
|
|
|
},
|
|
|
{
|
|
|
- "name": "comment.line.exclamation.qsp",
|
|
|
- "begin": "^\\s+!.*",
|
|
|
- "end": "$"
|
|
|
+ "include": "#support-objects"
|
|
|
},
|
|
|
{
|
|
|
"folds": [
|
|
@@ -93,25 +43,149 @@
|
|
|
}
|
|
|
],
|
|
|
"repository": {
|
|
|
- "strings": {
|
|
|
- "name": "string.quoted.double.qsp",
|
|
|
- "begin": "\"",
|
|
|
- "end": "\"",
|
|
|
+ "begin-end": {
|
|
|
"patterns": [
|
|
|
{
|
|
|
- "name": "string.interpolated.qsp",
|
|
|
- "begin": "<<",
|
|
|
- "end": ">>",
|
|
|
+ "name": "constant.character.qsp",
|
|
|
+ "match": "^-{1,2}\\S.*?\\S-{1,2}$"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "constant.character.qsp",
|
|
|
+ "match": "^(#)\\s?.+$"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "constant.character.qsp",
|
|
|
+ "match": "\\b\\d+\\b"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "comments": {
|
|
|
+ "comment": "singe and multiline comments starting with !",
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "comment": "comments without possible multiline chars",
|
|
|
+ "match": "(?:^|\\s?[&])\\s*((!!?)[^{'\"]*?$\\n?)",
|
|
|
+ "captures": {
|
|
|
+ "1": {
|
|
|
+ "name": "comment.line.qsp"
|
|
|
+ },
|
|
|
+ "2": {
|
|
|
+ "name": "punctuation.definition.comment.qsp"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "comment": "comments with multiline chars",
|
|
|
+ "begin": "(?:^|\\s?[&])\\s*(!!?)",
|
|
|
+ "beginCaptures": {
|
|
|
+ "0": {
|
|
|
+ "name": "comment.block.qsp"
|
|
|
+ },
|
|
|
+ "1": {
|
|
|
+ "name": "punctuation.definition.comment.qsp"
|
|
|
+ }
|
|
|
+ },
|
|
|
"patterns": [
|
|
|
{
|
|
|
- "include": "$self"
|
|
|
+ "name": "comment.block.qsp",
|
|
|
+ "match": "\\G",
|
|
|
+ "include": "#comment-block"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "comment-block": {
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "match": "(\\s*[^{'\"]*)(?=$)",
|
|
|
+ "captures": {
|
|
|
+ "1": {
|
|
|
+ "name": "comment.block.text.qsp"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "include": "#comment-block-quote"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "include": "#comment-block-bracket-curly"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "match": "(\\s*[^{'\"]*)(?!$)",
|
|
|
+ "captures": {
|
|
|
+ "1": {
|
|
|
+ "name": "comment.block.text.qsp"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "comment": "continue parsing after the comment ends",
|
|
|
+ "begin": "($\\n?)",
|
|
|
+ "pattern": {
|
|
|
+ "match": "\\G"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "comment-block-quote": {
|
|
|
+ "name": "comment.block.quote.qsp",
|
|
|
+ "begin": "('|\")",
|
|
|
+ "end": "(\\1)"
|
|
|
+ },
|
|
|
+ "comment-block-bracket-curly": {
|
|
|
+ "name": "comment.block.bracket.curly.qsp",
|
|
|
+ "begin": "[{]",
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "include": "#comment-block-bracket-curly"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "include": "#comment-block-quote"
|
|
|
+ }
|
|
|
],
|
|
|
+ "end": "([}])"
|
|
|
+ },
|
|
|
+ "keyword-control": {
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "name": "keyword.control.qsp",
|
|
|
+ "match": "(\\$)(?=(\\b(?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b))"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "keyword.control.qsp",
|
|
|
+ "match": "\\b(?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result|nosave|disablescroll|disablesubex|debug|usehtml|(b|f|l)color|fsize))\\b"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "keyword-operators": {
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "name": "keyword.operator.qsp",
|
|
|
+ "match": "(\\$)(?=(\\b(?i:(dyneval|input|user_text|usrtxt|maintxt|stattxt|func|curloc|selobj|selact|curacts|getobj|mid|(u|l)case|trim|replace|str|loc|strfind))\\b))"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "keyword.operator.qsp",
|
|
|
+ "match": "\\b(?i:(dyneval|input|user_text|usrtxt|iif|rgb|isplay|msecscount|desc|maintxt|stattxt|qspver|func|curloc|selobj|no|and|obj|len|mod|selact|curacts|arrsize|arrpos|countobj|getobj|led|mid|(u|l)case|trim|replace|instr|isnum|val|str|loc|or|max|min|r(a)?nd|(arr|str)comp|str(find|pos)))\\b"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "marks": {
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "name": "entity.other.attribute-name.qsp",
|
|
|
+ "match": "^(:)[^'\"]*$\n?"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "entity.other.attribute-name.qsp",
|
|
|
+ "match": "^(\\s+:)[^'\"]*$\n?"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "strings": {
|
|
|
"name": "string.quoted.single.qsp",
|
|
|
- "begin": "'",
|
|
|
- "end": "'",
|
|
|
+ "begin": "(\"|')",
|
|
|
+ "end": "\\1",
|
|
|
"patterns": [
|
|
|
{
|
|
|
"name": "string.interpolated.qsp",
|
|
@@ -124,7 +198,22 @@
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
+ },
|
|
|
+ "support-objects": {
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "name": "support.function.qsp",
|
|
|
+ "match": "(\\*)(?=(\\b(?i:(pl?|clear|clr|nl))\\b))"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "support.function.qsp",
|
|
|
+ "match": "\\b(?i:(nl|pl?|clear|clr|act|exit|killvar|cla|gs|xgt|gt|goto|gosub|\\[|\\]|xgoto|if|else|elseif|end|jump|msg|wait|delact|cmdclear|cmdclr|cls|menu|settimer|dynamic|set|let|play|close|view|copyarr|addobj|delobj|killobj|unselect|unsel|killall|opengame|openqst|addqst|killqst|savegame|refint|showacts|showinput|showobjs|showstat|\\*|&))\\b"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "support.function.qsp",
|
|
|
+ "match": "(?i:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\/|!|\\*|\\+|=|-|(<|>)=?|=?(<|>)))"
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
- },
|
|
|
- "scopeName": "scope.qsp"
|
|
|
-}
|
|
|
+ }
|
|
|
+}
|