Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff pygments_lexer_pseudocode2/lexers/algpseudocode.py @ 212:18553f595b34
Allow nested \TEXT and \EXPR commands.
\TEXT within \TEXT and \EXPR within \EXPR is allowed!
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 14 May 2026 07:30:38 +0200 |
| parents | 33a722c8ae17 |
| children | f365d9d2c0ad |
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/lexers/algpseudocode.py Wed May 13 21:22:33 2026 +0200 +++ b/pygments_lexer_pseudocode2/lexers/algpseudocode.py Thu May 14 07:30:38 2026 +0200 @@ -365,6 +365,9 @@ (r"(?i)\\(call|name)[ \t]*(\{)", LexBase.op_ignore, "entity-name"), (r"(?i)\\gets\b", op_gets), (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "text-statement"), + (r"(?i)\\expr(?:ession)?[ \t]*\{", + LexBase.op_ignore, + "block-expr"), include("explicit-tokentype"), include("remark"), include("keyword-constants"), @@ -382,6 +385,9 @@ (r"(?i)\\(call|name)[ \t]*(\{)", LexBase.op_ignore, "entity-name"), (r"(?i)\\gets\b", op_gets), (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "text-statement"), + (r"(?i)\\expr(?:ession)?[ \t]*\{", + LexBase.op_ignore, + "block-expr"), include("explicit-tokentype"), include("remark"), include("keyword-constants"), @@ -408,6 +414,7 @@ (r"(?i)\\expr(?:ession)?[ \t]*\{", LexBase.op_ignore, "block-expr"), + (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "#push"), include("explicit-tokentype"), include("remark"), (r"\\\\", LexBase.op_fixed(Text, "\\")),
