Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
changeset 61:392745b66969
The "\IS" keyword expansion
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 27 Apr 2026 19:25:45 +0200 |
| parents | 0ff291eac663 |
| children | 7153e945a3d6 |
| files | pygments_lexer_pseudocode2/algpseudocode.py |
| diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/algpseudocode.py Mon Apr 27 19:17:43 2026 +0200 +++ b/pygments_lexer_pseudocode2/algpseudocode.py Mon Apr 27 19:25:45 2026 +0200 @@ -53,6 +53,7 @@ "FUNCTION": "FUNCTION", "FN": "FUNCTION", "CLASS": "CLASS", + "IS": "IS", } END_TRANSLATIONS = { "PROG": "END OF PROGRAM", @@ -167,6 +168,11 @@ r"|(?:class)" r")((\s*)(\{))?", bygroups(op_opt_end_translate(Keyword))), + # Keywords + (r"(?i)\\(" + r"(?:is)" + r")\b", + bygroups(op_translate(Keyword))), include("expr"), (r"\s+", Text), ], @@ -208,6 +214,7 @@ "FUNCTION": "FUNKTION", "FN": "FUNKTION", "CLASS": "KLASSE", + "IS": "IST", }) END_TRANSLATIONS = AlgPseudocodeLexer.END_TRANSLATIONS.copy() END_TRANSLATIONS.update({ @@ -244,6 +251,7 @@ "FUNCTION": "FOUNCTION", "FN": "FONCTION", "CLASS": "CLASSE", + "IS": "EST", }) END_TRANSLATIONS = AlgPseudocodeLexer.END_TRANSLATIONS.copy() END_TRANSLATIONS.update({
