diff pygments_lexer_pseudocode2/algpseudocode.py @ 104:ffe6ea2cf69b

Allow "\RETURN" and "\RETURNS" commands. \RETURN: the return statement \RETURNS: like \INPUTS or \OUTPUTS
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 04 May 2026 16:23:18 +0200
parents af97692501ea
children cec52d83869a
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/algpseudocode.py	Mon May 04 16:20:44 2026 +0200
+++ b/pygments_lexer_pseudocode2/algpseudocode.py	Mon May 04 16:23:18 2026 +0200
@@ -66,7 +66,6 @@
         "INPUTS": "Inputs:",
         "OUTPUT": "Output:",
         "OUTPUTS": "Outputs:",
-        "RETURN": "Return:",
         "RETURNS": "Returns:",
         "IS": "IS",
         "WITH": "WITH",
@@ -84,6 +83,7 @@
         "LOOP": "LOOP",
         "REPEAT": "REPEAT",
         "UNTIL": "UNTIL",
+        "RETURN": "RETURN",
         "BEGIN": "BEGIN",
         "END": "END",         # not in END_TRANSLATIONS
     }
@@ -222,7 +222,7 @@
             (r"(?i)\\("
              r"(?:input(?:s)?)"
              r"|(?:output(?:s)?)"
-             r"|(?:return(?:s)?)"
+             r"|(?:returns)"
              r")[ \t]*(\{)",
              bygroups(op_translate(Keyword),
                       LexBase.op_fixed(Whitespace, " ")),
@@ -240,6 +240,7 @@
              r"|(?:loop)"
              r"|(?:repeat)"
              r"|(?:until)"
+             r"|(?:return)"
              r")\b",
              bygroups(op_translate(Keyword))),
             (r"\\\n", Text),