Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
changeset 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 |
| files | pygments_lexer_pseudocode2/algpseudocode.py |
| diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
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),
