`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.
This commit is contained in:
parent
2dac3667cb
commit
af3e2c971c
|
@ -6,8 +6,12 @@ syntax.add {
|
||||||
files = { "%.py$", "%.pyw$", "%.rpy$" },
|
files = { "%.py$", "%.pyw$", "%.rpy$" },
|
||||||
headers = "^#!.*[ /]python",
|
headers = "^#!.*[ /]python",
|
||||||
comment = "#",
|
comment = "#",
|
||||||
|
block_comment = { '"""', '"""' },
|
||||||
patterns = {
|
patterns = {
|
||||||
{ pattern = "#.*", type = "comment" },
|
{ 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" },
|
{ pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" },
|
||||||
{ pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
|
{ pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
|
||||||
|
|
Loading…
Reference in New Issue