Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
annotate docs/lexer-frpseudocode.rst @ 231:8f3a000c3be5
Allow the use of Garamond: EB Garamond, Libre Franklin and Inconsolata (with Garamond Math)
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 15 May 2026 21:49:27 +0200 |
| parents | 8705fd60feea |
| children | 2e78e255b54e |
| rev | line source |
|---|---|
|
128
2a653897f31e
Prepare a file for docs of FrPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*- |
|
2a653897f31e
Prepare a file for docs of FrPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 |
|
2a653897f31e
Prepare a file for docs of FrPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 ************** |
|
2a653897f31e
Prepare a file for docs of FrPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
4 FrPseudocode |
|
131
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
5 ************** |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
6 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
7 This is the pseudocode lexer from the original `pygments-lexer-pseudocode` |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
8 package. |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
9 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
10 It has been changed somewhat: |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
11 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
12 - renamed from ``Pseudocode`` to ``FrPseudocode`` |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
13 - changed aliases to ``fr-pseudocode``, ``fr-pseudo``, ``fr-algorithm`` |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
14 and ``fr-algo`` |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
15 - changed file extension to ``.fr-algo`` and ``.fr-pseudocode`` |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
16 - changed some exististing arrows and added some more |
| 146 | 17 - numbers parsing is more flexible by following the rules of the `Pygments`_ |
| 18 lexer for `Python`_ | |
|
131
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
19 - also allow ``!=`` as inequality operator (in addition to ``<>``) |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
20 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
21 It mostly just recognizes some (french) keywords and highlights them. |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
22 |
| 174 | 23 Comments are supported (``//`` and ``/* ... */`` (single-line only)). |
| 24 "Directives" in "special" comments are to be enclosed in curly braces | |
| 25 ``{ ... }``. | |
|
131
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
26 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
27 It also implements some symbol replacements/conversions like |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
28 ``<=`` to ``≤``, ``>=`` to ``≥`` or ``<>`` to ``≠``. |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
29 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
30 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
31 .. rubric:: Example: |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
32 |
| 202 | 33 The following example |
|
131
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
34 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
35 .. code-block:: none |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
36 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
37 /* foo bar */ |
|
128
2a653897f31e
Prepare a file for docs of FrPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
38 |
|
131
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
39 fonction fonc-1({passage par valeur}param1) |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
40 début |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
41 si param1 <= 0 alors |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
42 b = 0 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
43 sinon |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
44 b = 1 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
45 a = param1 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
46 répéter |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
47 a = a - 1 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
48 b = b * 2 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
49 tantque a <> 0 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
50 fin si |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
51 retourner b |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
52 fin fonction |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
53 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
54 will be highlighted as |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
55 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
56 .. code-block:: fr-algorithm |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
57 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
58 /* foo bar */ |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
59 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
60 fonction fonc-1({passage par valeur}param1) |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
61 début |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
62 si param1 <= 0 alors |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
63 b = 0 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
64 sinon |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
65 b = 1 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
66 a = param1 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
67 répéter |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
68 a = a - 1 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
69 b = b * 2 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
70 tantque a <> 0 |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
71 fin si |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
72 retourner b |
|
0455294e20c4
First and basic documentation of FrPseudocodeLeser
Franz Glasner <fzglas.hg@dom66.de>
parents:
128
diff
changeset
|
73 fin fonction |
|
168
bff8b900713a
REFACTOR: All documentation pages refactored: merge intro and details for lexers and filters
Franz Glasner <fzglas.hg@dom66.de>
parents:
150
diff
changeset
|
74 |
|
bff8b900713a
REFACTOR: All documentation pages refactored: merge intro and details for lexers and filters
Franz Glasner <fzglas.hg@dom66.de>
parents:
150
diff
changeset
|
75 |
|
bff8b900713a
REFACTOR: All documentation pages refactored: merge intro and details for lexers and filters
Franz Glasner <fzglas.hg@dom66.de>
parents:
150
diff
changeset
|
76 Lexer Options |
|
bff8b900713a
REFACTOR: All documentation pages refactored: merge intro and details for lexers and filters
Franz Glasner <fzglas.hg@dom66.de>
parents:
150
diff
changeset
|
77 ============= |
|
bff8b900713a
REFACTOR: All documentation pages refactored: merge intro and details for lexers and filters
Franz Glasner <fzglas.hg@dom66.de>
parents:
150
diff
changeset
|
78 |
|
bff8b900713a
REFACTOR: All documentation pages refactored: merge intro and details for lexers and filters
Franz Glasner <fzglas.hg@dom66.de>
parents:
150
diff
changeset
|
79 There are no lexer options besides the `Pygments`_ standard lexer options. |
