Improve number highlighting for python syntax highlighting (#1704)
* Improve number highlighting for python syntax highlighting Adds support for octal and binary representation, as well uppercase characters (X, B and O) * add underscore and negative hex/oct/bin value support * Removed | from pattern
This commit is contained in:
parent
3897e59e6b
commit
3e91d07097
|
@ -16,8 +16,8 @@ syntax.add {
|
||||||
{ pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" },
|
{ pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" },
|
||||||
{ pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
|
{ pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
|
||||||
{ pattern = { "[ruU]?'", "'", '\\' }, type = "string" },
|
{ pattern = { "[ruU]?'", "'", '\\' }, type = "string" },
|
||||||
{ pattern = "0x[%da-fA-F]+", type = "number" },
|
{ pattern = "-?0[xboXBO][%da-fA-F_]+",type = "number" },
|
||||||
{ pattern = "-?%d+[%d%.eE]*", type = "number" },
|
{ pattern = "-?%d+[%d%.eE_]*", type = "number" },
|
||||||
{ pattern = "-?%.?%d+", type = "number" },
|
{ pattern = "-?%.?%d+", type = "number" },
|
||||||
{ pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
|
{ pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
|
||||||
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
|
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
|
||||||
|
|
Loading…
Reference in New Issue