123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- {
- "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
- "name": "QSP",
- "scopeName": "text.qsp.qsrc",
- "patterns": [
- {
- "include": "#begin-end"
- },
- {
- "include": "#comments"
- },
- {
- "include": "#keyword-control"
- },
- {
- "include": "#keyword-operators"
- },
- {
- "include": "#marks"
- },
- {
- "include": "#strings"
- },
- {
- "include": "#support-objects"
- },
- {
- "folds": [
- {
- "type": "comment"
- },
- {
- "type": "if_statement",
- "start": {
- "type": [
- "elif_clause",
- "else_clause"
- ]
- },
- "end": "end"
- }
- ]
- }
- ],
- "repository": {
- "begin-end": {
- "patterns": [
- {
- "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": [
- {
- "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": "\\1",
- "patterns": [
- {
- "name": "string.interpolated.qsp",
- "begin": "<<",
- "end": ">>",
- "patterns": [
- {
- "include": "$self"
- }
- ]
- }
- ]
- },
- "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:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\/|!|\\*|\\+|=|-|(<|>)=?|=?(<|>)))"
- }
- ]
- }
- }
- }
|