Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/__init__.py @ 22:b42168cc9884
Use numbers from the Python lexer.
This snippet has a BSD-2-Clause license; include a license file in LICENSES.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 20 Apr 2026 17:42:32 +0200 |
| parents | 5705ac8a4fd5 |
| children | bb2fd6d4ad69 |
comparison
equal
deleted
inserted
replaced
| 21:5705ac8a4fd5 | 22:b42168cc9884 |
|---|---|
| 73 (r'\|', Comment), | 73 (r'\|', Comment), |
| 74 (r'\{(.*)\}', scomment), | 74 (r'\{(.*)\}', scomment), |
| 75 include('strings'), | 75 include('strings'), |
| 76 include('core'), | 76 include('core'), |
| 77 (r'[a-zéàùçèÉÀÙÇÈ][a-z0-9éàùçèÉÀÙÇÈ_]*', Name.Variable), | 77 (r'[a-zéàùçèÉÀÙÇÈ][a-z0-9éàùçèÉÀÙÇÈ_]*', Name.Variable), |
| 78 include('nums'), | 78 include('numbers'), |
| 79 (r'[\s]+', Text) | 79 (r'[\s]+', Text) |
| 80 ], | 80 ], |
| 81 'core':[ # Statements | 81 'core':[ # Statements |
| 82 (r'\b(debut|début|fin|si|alors|sinon|fin[_ ]si|tant[ _]que|tantque|fin[ _]tantque|faire|répéter' | 82 (r'\b(debut|début|fin|si|alors|sinon|fin[_ ]si|tant[ _]que|tantque|fin[ _]tantque|faire|répéter' |
| 83 r'repeter|type|structure|fin[ _]structure|fonction|procédure|procedure|retourner|renvoyer|' | 83 r'repeter|type|structure|fin[ _]structure|fonction|procédure|procedure|retourner|renvoyer|' |
| 111 | 111 |
| 112 'strings': [ | 112 'strings': [ |
| 113 (r'"([^"])*"', String.Double), | 113 (r'"([^"])*"', String.Double), |
| 114 (r"'([^'])*'", String.Single), | 114 (r"'([^'])*'", String.Single), |
| 115 ], | 115 ], |
| 116 | 116 # |
| 117 'nums': [ | 117 # This is stolen from the Pygment's Python lexer. |
| 118 (r'\d+(?![.Ee])', Number.Integer), | 118 # |
| 119 (r'[+-]?\d*\.\d+([eE][-+]?\d+)?', Number.Float), | 119 # SPDX-SnippetBegin |
| 120 (r'[+-]?\d+\.\d*([eE][-+]?\d+)?', Number.Float) | 120 # SPDX-License-Identifier: BSD-2-Clause |
| 121 ], | 121 # SPDX-SnippetCopyrightText: Copyright 2006-2023 by the Pygments team |
| 122 'numbers': [ | |
| 123 (r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)' | |
| 124 r'([eE][+-]?\d(?:_?\d)*)?', Number.Float), | |
| 125 (r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float), | |
| 126 (r'0[oO](?:_?[0-7])+', Number.Oct), | |
| 127 (r'0[bB](?:_?[01])+', Number.Bin), | |
| 128 (r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex), | |
| 129 (r'\d(?:_?\d)*', Number.Integer), | |
| 130 ], | |
| 131 # SPDX-SnippetEnd | |
| 122 } | 132 } |
