Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
changeset 99:857df2064831
\INPUT, \INPUTS, \OUTPUT, \OUTPUTS, \RETURN and \RETURNS as new commands (keywords)
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 04 May 2026 12:34:48 +0200 |
| parents | c1f93e109798 |
| children | 7cfad325d3bb |
| files | pygments_lexer_pseudocode2/algpseudocode.py |
| diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/algpseudocode.py Sun May 03 16:56:23 2026 +0200 +++ b/pygments_lexer_pseudocode2/algpseudocode.py Mon May 04 12:34:48 2026 +0200 @@ -62,6 +62,12 @@ "FUNCTION": "FUNCTION", "FN": "FUNCTION", "CLASS": "CLASS", + "INPUT": "Input:", + "INPUTS": "Inputs:", + "OUTPUT": "Output:", + "OUTPUTS": "Outputs:", + "RETURN": "Return:", + "RETURNS": "Returns:", "IS": "IS", "WITH": "WITH", "IF": "IF", @@ -214,6 +220,14 @@ bygroups(op_symbol(Text), LexBase.op_fixed(Whitespace, " ")), "text-statement"), (r"(?i)\\(" + r"(?:input(?:s)?)" + r"|(?:output(?:s)?)" + r"|(?:return(?:s)?)" + r")[ \t]*(\{)", + bygroups(op_translate(Keyword), + LexBase.op_fixed(Whitespace, " ")), + "text-statement"), + (r"(?i)\\(" r"(?:if)" r"|(?:then)" r"|(?:else)"
