diff --git a/syntaxes/vbs.tmLanguage.json b/syntaxes/vbs.tmLanguage.json index a44befd..ed4bf5d 100644 --- a/syntaxes/vbs.tmLanguage.json +++ b/syntaxes/vbs.tmLanguage.json @@ -7,7 +7,7 @@ "version": "https://github.com/textmate/asp.vb.net.tmbundle/commit/72d44550b3286d0382d7be0624140cf97857ff69", "name": "VBScript", "scopeName": "source.vbs", - "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com", + "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com, afterwards editted by mi_thom (github)", "patterns": [ { "match": "\\n", @@ -58,8 +58,8 @@ "match": "(?i:'|Rem\\b).*$" }, { - "comment": "function definition", - "captures": { + "comment": "function definition with args", + "beginCaptures": { "1": { "name": "storage.modifier.vbs" }, @@ -71,29 +71,46 @@ }, "4": { "name": "punctuation.definition.parameters.begin.vbs" + } + }, + "endCaptures":{ + "0":{ + "name":"punctuation.definition.parameters.end.vbs" + } + }, + "contentName": "variable.parameter.function.vbs", + "patterns":[ + { + "match": "(?<=\\b)(?i:ByRef|ByVal)(?=\\b)", + "name": "storage.modifier.vbs" + } + ], + "begin": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*(\\()", + "end": "\\)" + }, + { + "comment": "function definition without args", + "captures": { + "1": { + "name": "storage.modifier.vbs" }, - "5": { - "name": "variable.parameter.function.vbs" + "2": { + "name": "storage.type.function.vbs" }, - "6": { - "name": "punctuation.definition.parameters.end.vbs" + "3": { + "name": "entity.name.function.vbs" } }, - "match": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*(?:(\\()([^)]*)(\\)))?" + "match": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*" }, { "match": "(?i:End[\\t ]+(Sub|Function|Class|Property))", "name": "storage.type.end.vbs" }, { - "match": "(?i:\\s*\\b(Redim|Redim Preserve|With|End With|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo|Stop)\\b\\s*)", + "match": "(?i:\\s*\\b(With|End With|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo|Stop)\\b\\s*)", "name": "keyword.control.vbs" }, - { - "comment": "not working (in only valid place), overwirtten by variable.parameter.function.vbs", - "match": "(?i:\\b(ByRef|ByVal)\\b)", - "name": "storage.modifier.vbs" - }, { "match": "(?i:\\b(Call|If|Then|Else|ElseIf|End If|Set|While|Wend|For|Step|To|Each|In|Case|Select|End Select|Continue|Do|Until|Loop|Next|Exit (Do|For|Function|Property|Sub))\\b)", "name": "keyword.control.vbs" @@ -111,7 +128,7 @@ "name": "variable.other.dim.vbs" } }, - "match": "\\b(?i:((?:public|private)\\s+const|public|private|dim|const)\\s+\\b(\\[?[a-zA-Z]\\w*\\]?\\b(?:\\s*,\\s*\\b\\[?[a-zA-Z]\\w*\\]?\\b)*))" + "match": "\\b(?i:((?:public|private)\\s+const|public|private|dim|const|redim(?: preserve)?)\\s+(\\[?[a-zA-Z]\\w*\\]?(?:\\s*\\(\\s*\\d*\\s*\\))?(?:\\s*,\\s*\\[?[a-zA-Z]\\w*\\]?(?:\\s*\\(\\s*\\d*\\s*\\))?)*))" }, { "match": "(?i:\\s*\\b(Empty|False|Nothing|Null|True)\\b)", @@ -175,4 +192,4 @@ "name": "variable.other.member.vbs" } ] -} \ No newline at end of file +}