Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
annotate docs/details-algpseudocode.rst @ 150:4acf578ae93f
Much more details in the documentation
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 07 May 2026 16:06:59 +0200 |
| parents | b4688f6cc7b1 |
| children | d475f5e252eb |
| rev | line source |
|---|---|
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*- |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 |
|
127
4d55475d61a3
Make the details of the AlgPseudocodeLexer part of the "Details" docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
126
diff
changeset
|
4 *************** |
|
4d55475d61a3
Make the details of the AlgPseudocodeLexer part of the "Details" docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
126
diff
changeset
|
5 AlgPseudocode |
|
4d55475d61a3
Make the details of the AlgPseudocodeLexer part of the "Details" docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
126
diff
changeset
|
6 *************** |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
7 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
8 Lexer Options |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
9 ============= |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
10 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
11 .. describe:: no_end |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
12 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
13 **Type:** `bool` |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
14 |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
15 **Default:** `False` |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
16 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
17 If ``True`` all the ``\ENDxxx`` commands will be skipped and yield |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
18 nothing. |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
19 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
20 .. describe:: gets |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
21 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
22 **Type:** `str` or `None` |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
23 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
24 **Default:** `None` (yields ``←``) |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
25 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
26 The operator symbol to be printed by the command ``\GETS``. |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
27 |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
28 An often used alternative is ``:=``. |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
29 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
30 .. describe:: remark |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
31 |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
32 **Type:** `str` or `None` |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
33 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
34 **Default:** `None` (yields ``▷``) |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
35 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
36 The symbol to be printed as when starting comments with |
|
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
37 ``\REMARK`` or ``\REM``. |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
38 |
|
144
b616f9645e37
More referencing with internal and external links
Franz Glasner <fzglas.hg@dom66.de>
parents:
142
diff
changeset
|
39 To use a lexer with non-default options in `Sphinx`_ see section |
|
b616f9645e37
More referencing with internal and external links
Franz Glasner <fzglas.hg@dom66.de>
parents:
142
diff
changeset
|
40 :ref:`customized-sphinx-lexers`. |
|
b616f9645e37
More referencing with internal and external links
Franz Glasner <fzglas.hg@dom66.de>
parents:
142
diff
changeset
|
41 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
42 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
43 Comments |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
44 ======== |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
45 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
46 - with the ``\REMARK`` or ``\REM`` keywords (this includes a leading symbol) |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
47 - multi-line comments with ``/* ... */``; they can be **nested** |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
48 - multi-line comments with ``(* ... *)``; they can be **nested** |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
49 - single-line comments with ``//`` or ``#`` (until the end of the line) |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
50 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
51 .. code-block:: algpseudocode |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
52 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
53 /* |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
54 * A single multiline comment |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
55 */ |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
56 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
57 /* |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
58 * A multiline comment |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
59 * |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
60 * /* This is a nested multi-line comment */ |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
61 * |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
62 */ |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
63 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
64 (* |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
65 * A multiline comment |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
66 * |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
67 * (* This is a nested multi-line comment *) |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
68 * |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
69 *) |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
70 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
71 // A single-line comment |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
72 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
73 # A single-line comment |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
74 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
75 \REM A remark has a leading symbol |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
76 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
77 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
78 Literals |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
79 ======== |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
80 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
81 Strings and numbers as in `Python`_. String prefixes ``r``, ``f`` and ``t`` |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
82 are not supported -- ``u`` and ``b`` are. |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
83 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
84 To yield non-string-delimiting single- and double-quotes you have to escape them |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
85 using ``\'`` or ``\"``. This must be used to typeset something as |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
86 :algpseudocode:`f\\'(x) = 0`. |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
87 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
88 .. code-block:: algpseudocode |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
89 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
90 0 0xdead 0b100001 0o720 2.7 2.7e-54 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
91 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
92 "A string with an escaped double-quote \" " |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
93 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
94 'Another string with an escaped single-quote \' ' |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
95 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
96 """A multiline |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
97 string |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
98 """ |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
99 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
100 '''Another multiline string |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
101 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
102 ''' |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
103 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
104 b"A \x20 byte string" |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
105 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
106 u'An explicit Unicode \u1234 string' |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
107 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
108 \" a non string |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
109 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
110 \' a non string also |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
111 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
112 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
113 (Mathematical) Symbols and Operators |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
114 ==================================== |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
115 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
116 Some ASCII symbol combinations are recognized and replaced by a |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
117 Unicode symbol: |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
118 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
119 .. code-block:: algpseudocode |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
120 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
121 \TEXT{<=>} <=> |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
122 \TEXT{<->} <-> |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
123 \TEXT{<-} <- |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
124 \TEXT{->} -> |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
125 \TEXT{=>} => |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
126 \TEXT{<=} <= |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
127 \TEXT{>=} >= |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
128 \TEXT{<>} <> |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
129 \TEXT{!=} != |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
130 \TEXT{:=} := |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
131 \TEXT{=:} =: |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
132 \TEXT{?=} ?= |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
133 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
134 Unicode codepoints with property ``Sm`` are recognized as mathematical symbol |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
135 and highlighted accordingly. |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
136 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
137 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
138 Keywords |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
139 ======== |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
140 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
141 Explicit Keywords |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
142 ----------------- |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
143 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
144 - Start with a backslash character ``\`` |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
145 - Case-insensitive |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
146 - Translated if a translation is found |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
147 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
148 Parameter handling is as follows: |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
149 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
150 - Parameters are enclosed in curly braces ``{`` and ``}`` |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
151 - Escaping within the braces is possible using the backslash ``\`` |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
152 - Parameters are separated from the keyword/command by a (possibly empty) run |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
153 of space or TAB characters. |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
154 This is true for required and optional parameters. |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
155 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
156 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
157 With Required Parameters |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
158 ~~~~~~~~~~~~~~~~~~~~~~~~ |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
159 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
160 .. code-block:: algpseudocode |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
161 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
162 \TEXT{\PROGRAM {A Program\} or \PROG {A Program\}} \PROGRAM {A Program} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
163 \TEXT{\ALGORITHM{An Algorithm\} or \ALGO{An Algorithm\}} \ALGORITHM{An Algorithm} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
164 \TEXT{\PROCEDURE{A Procedure\} or \PROC{A Procedure\}} \PROCEDURE{A Procedure} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
165 \TEXT{\FUNCTION{A Function\} or \FUNC{A Function\} or \FN{A Function\}} \FUNCTION{A Function} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
166 \TEXT{\CLASS{A Class\}} \CLASS{A Class} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
167 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
168 \TEXT{\STATEMENT{the expression\} \STATE{the expression\} \BLOCK{the expression\}} \STATEMENT{the expression} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
169 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
170 \TEXT{expr1: \\EXPRESSION{expression a in b\} expr2: \\EXPR{expression b in a\}} \TEXT{expr1: \EXPRESSION{expression a in b} expr2: \EXPR{expression b in a}} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
171 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
172 \TEXT{\TEXTSTATEMENT{the text\} \TEXTSTATE{the text\} \TSTATEMENT{the text\} \TSTATE{the text\} \TEXTBLOCK{the text\} \TBLOCK{the text\}} \TEXTSTATEMENT{the text} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
173 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
174 \TEXT{\INPUT{Input 1\}} \INPUT{Input 1} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
175 \TEXT{\INPUTS{Input 2\}} \INPUTS{Input 2} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
176 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
177 \TEXT{\OUTPUT{Output 1\}} \OUTPUT{Output 1} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
178 \TEXT{\OUTPUTS{Output 2\}} \OUTPUTS{Output 2} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
179 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
180 \TEXT{\ENSURE{Whatever should be ensured!\}} \ENSURE{Whatever should be ensured!} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
181 |
|
142
5df4403f9e18
Reformae the description of the lexer options
Franz Glasner <fzglas.hg@dom66.de>
parents:
127
diff
changeset
|
182 \TEXT{\REQUIRE{Whatever should be required.\}} \REQUIRE{Whatever should be required.} |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
183 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
184 \TEXT{\RETURNS{Return 2\}} \RETURNS{Return 2} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
185 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
186 \TEXT{\CALL{a function\}(p1, p2)} \CALL{a function}(p1, p2) |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
187 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
188 \TEXT{\NAME{an entity name\}} \NAME{an entity name} |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
189 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
190 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
191 With Optional Parameters |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
192 ~~~~~~~~~~~~~~~~~~~~~~~~ |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
193 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
194 Some ``END``-keywords have optional parameters: |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
195 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
196 .. code-block:: algpseudocode |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
197 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
198 \TEXT{\ENDPROGRAM \ENDPROG} \ENDPROGRAM |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
199 \TEXT{\ENDALGORITHM \ENDALGO} \ENDALGORITHM |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
200 \TEXT{\ENDPROCEDURE \ENDPROC} \ENDPROCEDURE |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
201 \TEXT{\ENDFUNCTION \ENDFUNC \ENDFN} \ENDFUNCTION |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
202 \TEXT{\ENDCLASS} \ENDCLASS |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
203 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
204 They are used like this: |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
205 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
206 .. code-block:: algpseudocode |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
207 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
208 \TEXT{\CLASS{Foo Bar Class\} ... \END CLASS {Foo Bar Class\}} \TEXT{yields} \CLASS{Foo Bar Class} ... \END CLASS {Foo Bar Class} |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
209 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
210 .. seealso:: Syntax variants: `END-Keywords`_ |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
211 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
212 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
213 Without Parameters |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
214 ~~~~~~~~~~~~~~~~~~ |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
215 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
216 "Normal" Keywords |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
217 ''''''''''''''''' |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
218 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
219 .. code-block:: algpseudocode |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
220 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
221 \TEXT{\IF} \IF |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
222 \TEXT{\THEN} \THEN |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
223 \TEXT{\ELSE} \ELSE |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
224 \TEXT{\ELSEIF or \ELSIF or \ELIF} \ELSEIF \text{or} \ELSIF \text{or} \ELIF |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
225 \TEXT{\DO} \DO |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
226 \TEXT{\WHILE} \WHILE |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
227 \TEXT{\FORALL} \FORALL |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
228 \TEXT{\FOR} \FOR |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
229 \TEXT{\FROM} \FROM |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
230 \TEXT{\TO} \TO |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
231 \TEXT{\STEP} \STEP |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
232 \TEXT{\IN} \IN |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
233 \TEXT{\LOOP} \LOOP |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
234 \TEXT{\REPEAT} \REPEAT |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
235 \TEXT{\UNTIL} \UNTIL |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
236 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
237 \TEXT{\RETURN} \RETURN |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
238 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
239 \TEXT{\BEGIN} \BEGIN |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
240 \TEXT{\END} \END |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
241 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
242 \TEXT{\IS} \IS |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
243 \TEXT{\WITH} \WITH |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
244 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
245 \TEXT{\GETS} \GETS |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
246 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
247 \TEXT{\\REMARK or \\REM} \REMARK A comment with a leading symbol |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
248 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
249 ``\REMARK`` or ``\REM`` is special: all characters to the end of the |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
250 line are taken as comment; curly braces are not needed---in fact: |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
251 they are interpreted to be part of the comment. |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
252 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
253 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
254 END-Keywords |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
255 '''''''''''' |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
256 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
257 The separator character can be empty, a run of ASCII spaces, a run of TAB characters, |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
258 a single underscore ``_`` or a single hyphen ``-`` like: |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
259 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
260 ``\ENDIF``, ``\END IF``, ``\END-IF``, ``\END_IF`` or ``\END IF`` |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
261 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
262 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
263 .. code-block:: algpseudocode |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
264 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
265 \text{\ENDIF} \ENDIF \rem empty |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
266 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
267 \text{\END IF} \END IF \rem a single space |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
268 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
269 \text{\END IF} \END IF \rem two spaces |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
270 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
271 \text{\END-IF} \END-IF \rem a single hyphen |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
272 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
273 \text{\END_IF} \END_IF \rem a single underscore |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
274 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
275 \text{\END IF} \END IF \rem a single TAB character |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
276 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
277 The list of END-keywords (here always just with ``-`` as separator): |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
278 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
279 .. code-block:: algpseudocode |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
280 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
281 \text{\END-PROGRAM \END-PROG} \END-PROGRAM |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
282 \text{\END-ALGORITHM \END-ALGO} \END-ALGORITHM |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
283 \text{\END-PROCEDURE \END-PROC} \END-PROCEDURE |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
284 \text{\END-FUNCTION \END-FUNC \END-FN} \END-FUNCTION |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
285 \text{\END-CLASS} \END-CLASS |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
286 \text{\END-IF} \END-IF |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
287 \text{\END-WHILE} \END-WHILE |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
288 \text{\END-FOR} \END-FOR |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
289 \text{\END-FORALL} \END-FORALL |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
290 \text{\END-LOOP} \END-LOOP |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
291 |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
292 |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
293 Names and Entities |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
294 ================== |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
295 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
296 In an expression context all other words are interpreted as entity |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
297 names (token type ``Token.Name.Entity``). |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
298 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
299 Allowed characters in the words follow the corresponding `Python`_ rules. |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
300 As such, many Unicode characters are allowed. |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
301 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
302 To highlight entity names with whitespace or other "special" characters in it |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
303 use the ``NAME`` command. |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
304 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
305 .. code-block:: algpseudocode |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
306 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
307 \TEXT{entity_name_1} entity_name_1 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
308 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
309 \TEXT{entity_name_2} entity_name_2 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
310 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
311 \TEXT{\NAME{entity-name 3\}} \NAME{entity-name 3} |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
312 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
313 \TEXT{München} München |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
314 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
315 \TEXT{Genève} Genève |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
316 |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
317 .. _explicit-token-types: |
|
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
318 |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
319 Explicit Token Types |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
320 ==================== |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
321 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
322 Handle keywords and operators that are not handled by default or change |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
323 the default handling of some expressions. |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
324 |
|
148
b4688f6cc7b1
Docs: emphasize "value" more when describing explicit token types
Franz Glasner <fzglas.hg@dom66.de>
parents:
145
diff
changeset
|
325 `XX` represents a `value` in the :mod:`pygments.token.STANDARD_TYPES` dict. |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
326 Its corresponding token type (the associated `key` in this `dict`) is used as |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
327 token type. |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
328 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
329 ``\\tt-XX/SINGLE-CHAR`` |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
330 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
331 no escaping needed |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
332 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
333 `SINGLE-CHAR` is a single character and can be *every* character |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
334 (including a carriage-return or line-feed) |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
335 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
336 ``\\ttx-XX{CHARACTERS}`` |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
337 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
338 ``\\ttx-XX(CHARACTERS)`` |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
339 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
340 ``\\ttx-XX[CHARACTERS]`` |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
341 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
342 ``\\ttx-XX<CHARACTERS>`` |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
343 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
344 ``\\ttx-XX<SEP>CHARACTERS<SEP>`` |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
345 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
346 No escaping possible! There are enough alternatives available! |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
347 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
348 `SEP` is one of ``/:|=*+!\$~``. |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
349 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
350 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
351 Examples: |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
352 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
353 .. code-block:: algpseudocode |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
354 |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
355 \text{• \\tt-kc/C} \tt-kc/C \rem C as Keyword.Constant |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
356 \text{• \\tt-ow/∈} \tt-ow/∈ \rem ∈ as Operator.Word |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
357 \text{• \\ttx-kc{A New Constant Keyword\}} \ttx-kc{A New Constant Keyword} \rem As a new Keyword.Constant |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
358 \text{• \\ttx-nv{A New Variable Name\}} \ttx-nv{A New Variable Name} \rem An explicit Name.Variable |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
359 \text{• \\ttx-k(∈ ∌)} \ttx-k(∈ ∌) \rem ∈ and ∌ as (ordinary) Keywords |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
360 \text{• \\ttx-o<∈ ∌>} \ttx-o<∈ ∌> \rem ∈ and ∌ as (ordinary) Operators |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
361 /* |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
362 * The line below has ∈_∌ as (peculiar) function name. |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
363 * Their params are automatic (i.e. a normal expression). |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
364 */ |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
365 \text{• \\ttx-nf<∈_∌>(p1, p2)} \ttx-nf<∈_∌>(p1, p2) |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
366 /* |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
367 * The line below has ∈_∌ as (peculiar) decorator name (as used in Python). |
|
150
4acf578ae93f
Much more details in the documentation
Franz Glasner <fzglas.hg@dom66.de>
parents:
148
diff
changeset
|
368 * Their params are automatic (i.e. a normal expression). |
|
88
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
369 */ |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
370 \text{• \\ttx-nd[∈_∌](p1, p2)} \ttx-nd[∈_∌](p1, p2) |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
371 /* |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
372 * This is a non-existing token type: you get some generic error marking |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
373 * with a Generic.Error token and no expansion. |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
374 */ |
|
03e9031b5eca
Some details and examples about \tt-XXX and \ttx-XXX in the docs
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
375 \text{• \\ttx-NON-EXISTING[∈_∌](p1, p2)} \ttx-NON_EXISTING[∈_∌](p1, p2) |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
376 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
377 .. note:: Explicit token types are **case-sensitive**. |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
378 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
379 |
|
144
b616f9645e37
More referencing with internal and external links
Franz Glasner <fzglas.hg@dom66.de>
parents:
142
diff
changeset
|
380 .. _customized-sphinx-lexers: |
|
b616f9645e37
More referencing with internal and external links
Franz Glasner <fzglas.hg@dom66.de>
parents:
142
diff
changeset
|
381 |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
382 Customized Lexers in Sphinx |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
383 =========================== |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
384 |
|
144
b616f9645e37
More referencing with internal and external links
Franz Glasner <fzglas.hg@dom66.de>
parents:
142
diff
changeset
|
385 Defining lexers with non-default options in `Sphinx`_ can be done in its |
|
125
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
386 configuration file :file:`conf.py`: |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
387 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
388 .. code-block:: python |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
389 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
390 from functools import partial |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
391 from pygments_lexer_pseudocode2.algpseudocode import AlgPseudocodeLexer |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
392 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
393 def setup(app): |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
394 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
395 # |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
396 # Add a custom lexer: AlgPseudocodeLexer with custom init |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
397 # option "no_end". |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
398 # |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
399 # In modern Sphinx versions given lexer must be callable and may |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
400 # not be a lexer instance. So use an indirection with "partial" |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
401 # here. |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
402 # |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
403 app.add_lexer("noend-algpseudocode", |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
404 partial(AlgPseudocodeLexer, no_end=True)) |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
405 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
406 Similarily it works for custom styles and filters. |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
407 |
|
3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
408 For older Sphinx versions your mileage may vary. |
