diff options
| author | Fiji <156847941+FijiHasGithub@users.noreply.github.com> | 2024-01-20 00:04:49 +0000 |
|---|---|---|
| committer | jgmdev <jgmdev@gmail.com> | 2024-01-22 16:55:14 -0400 |
| commit | 7d5ac0265cdaa5a85a8fb23b482de1d24dc322f3 (patch) | |
| tree | d0d5e94207c710e2d146e430e5f91b55f4dfdddd /data/plugins/language_python.lua | |
| parent | 119e41f2a8a56db1583629b305be821ff2cd6122 (diff) | |
| download | pragtical-7d5ac0265cdaa5a85a8fb23b482de1d24dc322f3.tar.gz pragtical-7d5ac0265cdaa5a85a8fb23b482de1d24dc322f3.zip | |
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
Diffstat (limited to 'data/plugins/language_python.lua')
| -rw-r--r-- | data/plugins/language_python.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/data/plugins/language_python.lua b/data/plugins/language_python.lua index 743e990a..220ddd54 100644 --- a/data/plugins/language_python.lua +++ b/data/plugins/language_python.lua @@ -16,8 +16,8 @@ syntax.add { { pattern = { "[ruU]?'''", "'''", '\\' }, type = "string" }, { pattern = { '[ruU]?"', '"', '\\' }, type = "string" }, { pattern = { "[ruU]?'", "'", '\\' }, type = "string" }, - { pattern = "0x[%da-fA-F]+", type = "number" }, - { pattern = "-?%d+[%d%.eE]*", type = "number" }, + { pattern = "-?0[xboXBO][%da-fA-F_]+",type = "number" }, + { pattern = "-?%d+[%d%.eE_]*", type = "number" }, { pattern = "-?%.?%d+", type = "number" }, { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, |
