Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/__init__.py @ 27:bf13850f21fb
Use the more correct "Token.Text.Whitespace" for whitespace instead of "Token.Text"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 21 Apr 2026 01:22:43 +0200 |
| parents | 92576c1b05d9 |
| children |
comparison
equal
deleted
inserted
replaced
| 26:92576c1b05d9 | 27:bf13850f21fb |
|---|---|
| 21 | 21 |
| 22 | 22 |
| 23 import re | 23 import re |
| 24 | 24 |
| 25 from pygments.lexer import RegexLexer, include | 25 from pygments.lexer import RegexLexer, include |
| 26 from pygments.token import Punctuation, Text, Comment, Operator, Keyword, Name, String, Number | 26 from pygments.token import Punctuation, Whitespace, Comment, Operator, Keyword, Name, String, Number |
| 27 | 27 |
| 28 | 28 |
| 29 class PseudocodeLexer2(RegexLexer): | 29 class PseudocodeLexer2(RegexLexer): |
| 30 ''' | 30 ''' |
| 31 A Pseudo code (fr) lexer | 31 A Pseudo code (fr) lexer |
| 76 (r'\{(.*)\}', scomment), | 76 (r'\{(.*)\}', scomment), |
| 77 include('strings'), | 77 include('strings'), |
| 78 include('core'), | 78 include('core'), |
| 79 (r'(?i)[a-zéàùçèÉÀÙÇÈ][a-z0-9éàùçèÉÀÙÇÈ_]*', Name.Variable), | 79 (r'(?i)[a-zéàùçèÉÀÙÇÈ][a-z0-9éàùçèÉÀÙÇÈ_]*', Name.Variable), |
| 80 include('numbers'), | 80 include('numbers'), |
| 81 (r'[\s]+', Text) | 81 (r'[\s]+', Whitespace) |
| 82 ], | 82 ], |
| 83 'core': [ # Statements | 83 'core': [ # Statements |
| 84 (r'(?i)\b(debut|début|fin|si|alors|sinon|fin[_ ]si|tant[ _]que|tantque|fin[ _]tantque|faire|répéter' | 84 (r'(?i)\b(debut|début|fin|si|alors|sinon|fin[_ ]si|tant[ _]que|tantque|fin[ _]tantque|faire|répéter' |
| 85 r'repeter|type|structure|fin[ _]structure|fonction|procédure|procedure|retourner|renvoyer|' | 85 r'repeter|type|structure|fin[ _]structure|fonction|procédure|procedure|retourner|renvoyer|' |
| 86 r'pour|fin[ _]pour|à|déclarations?|juqsque|spécialise|specialise|comporte|super|public|privé|protégé|' | 86 r'pour|fin[ _]pour|à|déclarations?|juqsque|spécialise|specialise|comporte|super|public|privé|protégé|' |
