Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff 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 |
line wrap: on
line diff
--- a/docs/details-frpseudocode.rst Wed May 06 18:23:48 2026 +0200 +++ b/docs/details-frpseudocode.rst Wed May 06 21:35:06 2026 +0200 @@ -2,6 +2,70 @@ ************** FrPseudocode -************** +************** + +This is the pseudocode lexer from the original `pygments-lexer-pseudocode` +package. + +It has been changed somewhat: + +- renamed from ``Pseudocode`` to ``FrPseudocode`` +- changed aliases to ``fr-pseudocode``, ``fr-pseudo``, ``fr-algorithm`` + and ``fr-algo`` +- changed file extension to ``.fr-algo`` and ``.fr-pseudocode`` +- changed some exististing arrows and added some more +- numbers parsing is more flexible by following the Python lexer +- also allow ``!=`` as inequality operator (in addition to ``<>``) + +It mostly just recognizes some (french) keywords and highlights them. + +Comments are supported (``//`` and ``/* ... */`` (single-line only))- +"Directives" in "special" comments are to be enclosed in curly braces ``{ ... }``. + +It also implements some symbol replacements/conversions like +``<=`` to ``≤``, ``>=`` to ``≥`` or ``<>`` to ``≠``. + + +.. rubric:: Example: + +The follwing example + +.. code-block:: none + + /* foo bar */ -.. todo:: Docs for FrPseudocode need to be done. + fonction fonc-1({passage par valeur}param1) + début + si param1 <= 0 alors + b = 0 + sinon + b = 1 + a = param1 + répéter + a = a - 1 + b = b * 2 + tantque a <> 0 + fin si + retourner b + fin fonction + +will be highlighted as + +.. code-block:: fr-algorithm + + /* foo bar */ + + fonction fonc-1({passage par valeur}param1) + début + si param1 <= 0 alors + b = 0 + sinon + b = 1 + a = param1 + répéter + a = a - 1 + b = b * 2 + tantque a <> 0 + fin si + retourner b + fin fonction
