Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff pygments_lexer_pseudocode2/__init__.py @ 21:5705ac8a4fd5
Arrow "=>" -> "⇒"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 20 Apr 2026 15:59:32 +0200 |
| parents | 3db60b64abf6 |
| children | b42168cc9884 |
line wrap: on
line diff
--- a/pygments_lexer_pseudocode2/__init__.py Mon Apr 20 15:28:19 2026 +0200 +++ b/pygments_lexer_pseudocode2/__init__.py Mon Apr 20 15:59:32 2026 +0200 @@ -40,8 +40,10 @@ '<=': '≤', '>=': '≥', '<>': '≠', - '!=': '≠', + '!=': '≠', '<-': '←', + '->': '→', + '=>': '⇒', '^': '↑', } @@ -61,9 +63,9 @@ if s in directives: c = Comment.Special - + yield match.start(), c, match.group(0) - + tokens = { 'root': [ (r'\/\*.*\*\/', Comment), @@ -85,19 +87,19 @@ # Data Types (r'\b(entiers?|chaines?|chaînes?|réels?|reels?|caractères?|caracteres?|booléens?|' - r'booleens?|tableaux?|rien)\s*\b', + r'booleens?|tableaux?|rien)\s*\b', Keyword.Type), (r'\b(vrai|faux|nil)\s*\b', Name.Constant), - + # Operators - (r'(<=|>=|<>|!=|<-|\^|\*|\+|-|\/|<|>|=|\\\\|mod|←|↑|≤|≥|≠|÷|×|\.\.|\[|\]|\.|non|xou|et|ou)', + (r'(<=|>=|<>|!=|<-|->|=>|\^|\*|\+|-|\/|<|>|=|\\\\|mod|←|↑|≤|≥|≠|÷|×|\.\.|\[|\]|\.|non|xou|et|ou)', op_replace), - + (r'(\(|\)|\,|\;|:)', Punctuation), - + #(r'\b(\[(VE|VS|VE/S)\])\s*\b', # Keyword.Declaration), @@ -118,4 +120,3 @@ (r'[+-]?\d+\.\d*([eE][-+]?\d+)?', Number.Float) ], } -
