Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/details-frpseudocode.rst @ 131:0455294e20c4
First and basic documentation of FrPseudocodeLeser
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 06 May 2026 21:35:06 +0200 |
| parents | 2a653897f31e |
| children | c4f6f5e771b0 |
comparison
equal
deleted
inserted
replaced
| 130:10212741b98f | 131:0455294e20c4 |
|---|---|
| 1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*- | 1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*- |
| 2 | 2 |
| 3 ************** | 3 ************** |
| 4 FrPseudocode | 4 FrPseudocode |
| 5 ************** | 5 ************** |
| 6 | 6 |
| 7 .. todo:: Docs for FrPseudocode need to be done. | 7 This is the pseudocode lexer from the original `pygments-lexer-pseudocode` |
| 8 package. | |
| 9 | |
| 10 It has been changed somewhat: | |
| 11 | |
| 12 - renamed from ``Pseudocode`` to ``FrPseudocode`` | |
| 13 - changed aliases to ``fr-pseudocode``, ``fr-pseudo``, ``fr-algorithm`` | |
| 14 and ``fr-algo`` | |
| 15 - changed file extension to ``.fr-algo`` and ``.fr-pseudocode`` | |
| 16 - changed some exististing arrows and added some more | |
| 17 - numbers parsing is more flexible by following the Python lexer | |
| 18 - also allow ``!=`` as inequality operator (in addition to ``<>``) | |
| 19 | |
| 20 It mostly just recognizes some (french) keywords and highlights them. | |
| 21 | |
| 22 Comments are supported (``//`` and ``/* ... */`` (single-line only))- | |
| 23 "Directives" in "special" comments are to be enclosed in curly braces ``{ ... }``. | |
| 24 | |
| 25 It also implements some symbol replacements/conversions like | |
| 26 ``<=`` to ``≤``, ``>=`` to ``≥`` or ``<>`` to ``≠``. | |
| 27 | |
| 28 | |
| 29 .. rubric:: Example: | |
| 30 | |
| 31 The follwing example | |
| 32 | |
| 33 .. code-block:: none | |
| 34 | |
| 35 /* foo bar */ | |
| 36 | |
| 37 fonction fonc-1({passage par valeur}param1) | |
| 38 début | |
| 39 si param1 <= 0 alors | |
| 40 b = 0 | |
| 41 sinon | |
| 42 b = 1 | |
| 43 a = param1 | |
| 44 répéter | |
| 45 a = a - 1 | |
| 46 b = b * 2 | |
| 47 tantque a <> 0 | |
| 48 fin si | |
| 49 retourner b | |
| 50 fin fonction | |
| 51 | |
| 52 will be highlighted as | |
| 53 | |
| 54 .. code-block:: fr-algorithm | |
| 55 | |
| 56 /* foo bar */ | |
| 57 | |
| 58 fonction fonc-1({passage par valeur}param1) | |
| 59 début | |
| 60 si param1 <= 0 alors | |
| 61 b = 0 | |
| 62 sinon | |
| 63 b = 1 | |
| 64 a = param1 | |
| 65 répéter | |
| 66 a = a - 1 | |
| 67 b = b * 2 | |
| 68 tantque a <> 0 | |
| 69 fin si | |
| 70 retourner b | |
| 71 fin fonction |
