-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Monotrea
committed
Apr 20, 2019
1 parent
7e9f1ef
commit 37a0e8c
Showing
1 changed file
with
135 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,237 +1,199 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "HSP", | ||
"patterns": [ | ||
{ | ||
"include": "#preprocessors" | ||
}, | ||
{ | ||
"include": "#keywords" | ||
}, | ||
{ | ||
"include": "#types" | ||
}, | ||
{ | ||
"include": "#statements" | ||
}, | ||
{ | ||
"include": "#parameters" | ||
}, | ||
{ | ||
"include": "#labels" | ||
}, | ||
{ | ||
"include": "#comments" | ||
} | ||
], | ||
"repository": { | ||
"preprocessors": { | ||
"name": "HSP", | ||
"patterns": [ | ||
{ "include": "#comments"}, | ||
{ "include": "#code" } | ||
], | ||
"repository": { | ||
"colons": { | ||
"patterns": [ | ||
{ "include": "#comments" }, | ||
{ | ||
"name": "meta.preprocessor", | ||
"match": "\\#(include|define|const|ifdef|if|else|endif)" | ||
"match": "(+):(.+)", | ||
"captures": { | ||
"1": {"patterns": [{"include": "#comments"}, {"include": "#code"}]}, | ||
"2": {"patterns": [{"include": "#comments"}, {"include": "#code"}]} | ||
} | ||
} | ||
] | ||
}, | ||
"keywords": { | ||
"patterns": [{ | ||
"name": "keyword.control.hsp", | ||
"match": "\\b(if|else|while|for|return|repeat|loop|goto|gosub)\\b" | ||
}] | ||
}, | ||
"types": { | ||
"comments":{ | ||
"patterns": [ | ||
{ | ||
"name": "support.type.hsp", | ||
"match": "\\b(int|str)\\b" | ||
"include": "#semicoloncomment" | ||
}, | ||
{ | ||
"include": "#doubleslashcomment" | ||
}, | ||
{ | ||
"include": "#blockcomment" | ||
} | ||
] | ||
}, | ||
"statements": { | ||
"patterns": [ | ||
{"include": "#screencontrols"}, | ||
{"include": "#drawfunctions"}, | ||
{"include": "#objectcontrols"}, | ||
{"include": "#fileoperations"}, | ||
{"include": "#stringoperations"}, | ||
{"include": "#programcontrols"}, | ||
{"include": "#memoryhandling"}, | ||
{"include": "#multimediacontrols"}, | ||
{"include": "#stdiocontrols"}, | ||
{"include": "#stdio"}, | ||
{"include": "#system"} | ||
], | ||
"repository": { | ||
"screencontrols": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(bmpsave|color|dialog|font|mes|print|picload|screen|sysfont|text|title|width|winobj|pos)\\b" | ||
} | ||
] | ||
}, | ||
"drawfunctions": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(buffer|gsel|gmode|gsquare|gcopy|circle|boxf|redraw|gzoom)\\b" | ||
} | ||
] | ||
}, | ||
"objectcontrols": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(button|chkbox|clrobj|combox|input|listbox|mesbox|objenable|objimage|objmode|objprm|objsel|objskip|objsize)\\b" | ||
} | ||
] | ||
}, | ||
"fileoperations": { | ||
"semicoloncomment": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(chdir|dirlist|exist|memfile|mkdir)\\b" | ||
"name": "comment.line", | ||
"match": ";.*" | ||
} | ||
] | ||
}, | ||
"stringoperations": { | ||
"doubleslashcomment": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(getstr|split|notesel|notesave|noteload|noteget|noteadd|notedel|getpath|instr|strf|strmid|strtrim)\\b" | ||
"name": "comment.line.double-slash", | ||
"match": "//.*" | ||
} | ||
] | ||
}, | ||
"programcontrols": { | ||
"blockcomment": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(exec|onclick|oncmd|onexit|onkey)\\b" | ||
"name": "comment.block", | ||
"begin": "/\\*", | ||
"end": "\\*/" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"code": { | ||
"patterns": [ | ||
{ | ||
"include": "#comments" | ||
}, | ||
"memoryhandling": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(dim|memexpand|memset|sdim|memcopy)\\b" | ||
} | ||
] | ||
{ | ||
"include": "#preprocessors" | ||
}, | ||
"multimediacontrols": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(mci)\\b" | ||
} | ||
] | ||
{ | ||
"include": "#keywords" | ||
}, | ||
"stdiocontrols": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(mouse)\\b" | ||
} | ||
] | ||
{ | ||
"include": "#types" | ||
}, | ||
"stdio": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(dirinfo|gettime|ginfo|int|objinfo|rnd|str|strlen|sysinfo)\\b" | ||
} | ||
] | ||
{ | ||
"include": "#statement" | ||
}, | ||
"system": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b(mousew)\\b" | ||
} | ||
] | ||
} | ||
} | ||
|
||
}, | ||
"parameters": { | ||
"patterns": [ | ||
{ | ||
"include": "#numeric" | ||
"include": "#parameters" | ||
}, | ||
{ | ||
"include": "#strings" | ||
"include": "#labels" | ||
} | ||
], | ||
"repository": { | ||
"numeric": { | ||
"preprocessors": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.numeric", | ||
"match": "\\b-?[0-9]+\\b" | ||
"name": "meta.preprocessor", | ||
"match": "\\#[\\w]+" | ||
} | ||
] | ||
}, | ||
"strings": { | ||
"name": "string.quoted.double.hsp", | ||
"begin": "\"", | ||
"end": "\"", | ||
"keywords": { | ||
"patterns": [{ | ||
"name": "keyword.control.hsp", | ||
"match": "\\b(if|else|while|for|return|repeat|loop|goto|gosub)\\b" | ||
}] | ||
}, | ||
"types": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.hsp", | ||
"match": "\\\\." | ||
"name": "support.type.hsp", | ||
"match": "\\b(int|str)\\b" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"labels": { | ||
"patterns": [ | ||
{ | ||
"name": "entity.name.class", | ||
"match": "\\*\\w+\\b" | ||
} | ||
] | ||
}, | ||
"comments":{ | ||
"patterns": [ | ||
{ | ||
"include": "#semicoloncomment" | ||
}, | ||
{ | ||
"include": "#doubleslashcomment" | ||
}, | ||
{ | ||
"include": "#blockcomment" | ||
} | ||
], | ||
"repository": { | ||
"semicoloncomment": { | ||
"statement": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.line", | ||
"match": ";.*" | ||
"include": "#comments" | ||
}, | ||
{ | ||
"include": "#multistatement" | ||
}, | ||
{ | ||
"include": "#singlestatement" | ||
}, | ||
{ | ||
"include": "#colons" | ||
} | ||
] | ||
], | ||
"repository": { | ||
"singlestatement": { | ||
"patterns": [ | ||
{ | ||
"name": "support.function", | ||
"match": "\\b\\w+\\b" | ||
} | ||
] | ||
}, | ||
"multistatement": { | ||
"patterns": [ | ||
{ | ||
"match": "(\\w+)\\s+(.+)", | ||
"captures": { | ||
"1": { "patterns": [{"name": "support.function"}] }, | ||
"2": { "patterns": [{"include": "#parameters"}, {"include": "#comments"}] } | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"doubleslashcomment": { | ||
"parameters": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.line.double-slash", | ||
"match": "//.*" | ||
"include": "#numeric" | ||
}, | ||
{ | ||
"include": "#strings" | ||
}, | ||
{ | ||
"include": "#variables" | ||
} | ||
] | ||
], | ||
"repository": { | ||
"numeric": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.numeric", | ||
"match": "\\b-?[0-9]+\\b" | ||
} | ||
] | ||
}, | ||
"strings": { | ||
"name": "string.quoted.double.hsp", | ||
"begin": "\"", | ||
"end": "\"", | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.hsp", | ||
"match": "\\\\." | ||
} | ||
] | ||
}, | ||
"variables": { | ||
"patterns": [ | ||
{ | ||
"name": "variable.parameter", | ||
"match": "\\b[a-zA-z\u3040-\u31ff\u3400-\u9fff\uf900-\ufaff][0-9a-zA-z\u3040-\u31ff\u3400-\u9fff\uf900-\ufaff]*" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"blockcomment": { | ||
"labels": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.block", | ||
"begin": "/\\*", | ||
"end": "\\*/" | ||
"name": "entity.name.class", | ||
"match": "\\*\\w+\\b" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
}, | ||
"scopeName": "source.hsp" | ||
} |