From 0462a7a8d142019b3679b220a1285c9055da96b5 Mon Sep 17 00:00:00 2001 From: sumneko Date: Sun, 5 May 2019 17:06:21 +0800 Subject: =?UTF-8?q?=E5=85=88=E8=BF=98=E5=8E=9F=E7=9D=80=E8=89=B2=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- syntaxes/lua.tmLanguage.json | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/syntaxes/lua.tmLanguage.json b/syntaxes/lua.tmLanguage.json index d8353c1c..d5ac4a98 100644 --- a/syntaxes/lua.tmLanguage.json +++ b/syntaxes/lua.tmLanguage.json @@ -12,36 +12,19 @@ "name": "keyword.control.lua" } }, - "end": "(?=\\)|\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in|local|function)\\b)", + "end": "(?=(\\()(?:[^\\)]*)(\\)))", + "endCaptures": { + "1": { + "name": "punctuation.definition.parameters.begin.lua" + }, + "2": { + "name": "punctuation.definition.parameters.finish.lua" + } + }, "name": "meta.function.lua", "patterns": [ { - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.definition.parameters.begin.lua" - } - }, - "end": "\\)", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.finish.lua" - } - }, - "name": "meta.parameter.lua", - "patterns": [ - { - "match": "[a-zA-Z_][a-zA-Z0-9_]*", - "name": "variable.parameter.function.lua" - }, - { - "match": ",", - "name": "punctuation.separator.arguments.lua" - } - ] - }, - { - "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s*(?=:)", + "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*:)", "name": "entity.name.class.lua" }, { @@ -233,7 +216,7 @@ "name": "keyword.control.lua" }, { - "match": "(?