Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff pygments_lexer_pseudocode2/algpseudocode.py @ 81:6d8b813fb296
Keyword constants like "True", "False", "Nil", "None", "Null" and "Empty"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 30 Apr 2026 11:41:21 +0200 |
| parents | f487f0d322a5 |
| children | 36a0ef76a6d7 |
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/algpseudocode.py Thu Apr 30 09:51:30 2026 +0200 +++ b/pygments_lexer_pseudocode2/algpseudocode.py Thu Apr 30 11:41:21 2026 +0200 @@ -223,6 +223,7 @@ include("py-numbers"), (r"(?i)\\text\s*\{", LexBase.op_ignore, "text-in-expr"), include("remark"), + include("keyword-constants"), include("text-operators"), include("math-builtins"), include("py-name"), @@ -233,6 +234,7 @@ include("py-numbers"), (r"(?i)\\text\s*\{", LexBase.op_ignore, "text-in-expr"), include("remark"), + include("keyword-constants"), include("text-operators"), include("math-builtins"), include("py-name"), @@ -281,6 +283,15 @@ suffix=r"\b"), Operator.Word), ], + "keyword-constants": [ + (words(("True", "TRUE", "true", "False", "FALSE", "false", + "None", "NONE", "non", "Nil", "NIL", "nil", + "Null", "NULL", "null", + "Empty", "EMPTY", "empty"), + prefix=r"(?<!\.)", + suffix=r"\b"), + Keyword.Constant), + ], "punctuation": [ (r"[{}:(),;[\]]", Punctuation), ],
