{
	"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
	"name": "QSP",
	"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"
		},
		{
			"name": "support.function.qsp",
			"match": "(?i:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\+|=|-|(<|>)=?|=?(<|>)))"
		},
		{
			"name": "comment.block.doubleexclamation.qsp",
			"begin": "!!{",
			"end": "}$"
		},
		{
			"name": "comment.block.exclamation.qsp",
			"begin": "!{",
			"end": "}$"
		},
		{
			"name": "comment.line.doubleexclamation.qsp",
			"begin": "!!",
			"end": "$"
		},
		{
			"name": "comment.line.exclamation.qsp",
			"begin": "^!",
			"end": "$"
		},
		{
			"name": "comment.line.exclamation.qsp",
			"begin": "^\\s+!.*",
			"end": "$"
		},
		{
			"folds": [
				{
					"type": "comment"
				},
				{
					"type": "if_statement",
					"start": {
						"type": [
							"elif_clause",
							"else_clause"
						]
					},
					"end": "end"
				}
			]
		}
	],
	"repository": {
		"strings": {
			"name": "string.quoted.double.qsp",
			"begin": "\"",
			"end": "\"",
			"patterns": [
				{
					"name": "string.interpolated.qsp",
					"begin": "<<",
					"end": ">>",
					"patterns": [
						{
							"include": "$self"
						}
					]
				}
			],
			"name": "string.quoted.single.qsp",
			"begin": "'",
			"end": "'",
			"patterns": [
				{
					"name": "string.interpolated.qsp",
					"begin": "<<",
					"end": ">>",
					"patterns": [
						{
							"include": "$self"
						}
					]
				}
			]
		}
	},
	"scopeName": "scope.qsp"
}
