diff pygments_lexer_pseudocode2/lexers/algpseudocode.py @ 281:ee512932d603

Make "\T" and "\E" aliases for "\TEXT" and "\EXPRESSION"
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 20 May 2026 17:23:41 +0200
parents 397ed930a5ba
children 90946f87d77d
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/lexers/algpseudocode.py	Wed May 20 12:54:06 2026 +0200
+++ b/pygments_lexer_pseudocode2/lexers/algpseudocode.py	Wed May 20 17:23:41 2026 +0200
@@ -364,11 +364,11 @@
             include("py-numbers"),
             (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]*\{",
+            (r"(?i)\\e(?:xpr(?:ession)?)?[ \t]*\{",
              LexBase.op_ignore,
              "block-expr"),
             include("explicit-tokentype"),
+            (r"(?i)\\t(?:ext)?[ \t]*\{", LexBase.op_ignore, "text-statement"),
             include("remark"),
             include("keyword-constants"),
             include("word-operators"),
@@ -384,11 +384,11 @@
             include("py-numbers"),
             (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]*\{",
+            (r"(?i)\\e(?:xpr(?:ession)?)?[ \t]*\{",
              LexBase.op_ignore,
              "block-expr"),
             include("explicit-tokentype"),
+            (r"(?i)\\t(?:ext)?[ \t]*\{", LexBase.op_ignore, "text-statement"),
             include("remark"),
             include("keyword-constants"),
             include("word-operators"),
@@ -411,11 +411,11 @@
             (r"\}", LexBase.op_ignore, "#pop"),
             (r"\n", Whitespace),
             (r"\\\}", LexBase.op_fixed(Text, "}")),
-            (r"(?i)\\expr(?:ession)?[ \t]*\{",
+            (r"(?i)\\e(?:xpr(?:ession)?)?[ \t]*\{",
              LexBase.op_ignore,
              "block-expr"),
-            (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "#push"),
             include("explicit-tokentype"),
+            (r"(?i)\\t(?:ext)?[ \t]*\{", LexBase.op_ignore, "#push"),
             include("remark"),
             (r"\\\\", LexBase.op_fixed(Text, "\\")),
             (r"\\", LexBase.op_fixed(Text, "\\")),  # in text-mode: leave Text