From af3e2c971c2c276f8154ef10c85338a66488aeb7 Mon Sep 17 00:00:00 2001 From: Cyriaque Skrapits Date: Wed, 13 Jul 2022 17:06:42 +0200 Subject: [PATCH] `language_python`: Add new patterns (#1074) * `language_python`: Add new patterns This commit provides: - multiline comments support; - unicode string symbol highlighting; - class names as keyword2. --- data/plugins/language_python.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/plugins/language_python.lua b/data/plugins/language_python.lua index b96b56b9..6952a965 100644 --- a/data/plugins/language_python.lua +++ b/data/plugins/language_python.lua @@ -6,8 +6,12 @@ syntax.add { files = { "%.py$", "%.pyw$", "%.rpy$" }, headers = "^#!.*[ /]python", comment = "#", + block_comment = { '"""', '"""' }, patterns = { { pattern = "#.*", type = "comment" }, + { pattern = { '^%s*"""', '"""' }, type = "comment" }, + { pattern = '[uUrR]%f["]', type = "keyword" }, + { pattern = "class%s+()[%a_][%w_]*", type = {"keyword", "keyword2"} }, { pattern = { '[ruU]?"""', '"""'; '\\' }, type = "string" }, { pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" }, { pattern = { '[ruU]?"', '"', '\\' }, type = "string" },