Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/lexer-algpseudocode.rst @ 276:397ed930a5ba
Allow more separator characters for explicit token types.
Extensive tests including a special test when using the backslash.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 20 May 2026 12:10:01 +0200 |
| parents | 77cfab93a60e |
| children | a5c96fdd1cb3 |
comparison
equal
deleted
inserted
replaced
| 275:f365d9d2c0ad | 276:397ed930a5ba |
|---|---|
| 475 | 475 |
| 476 ``\ttx-XX<SEP>CHARACTERS<SEP>`` | 476 ``\ttx-XX<SEP>CHARACTERS<SEP>`` |
| 477 | 477 |
| 478 No escaping possible! There are enough alternatives available! | 478 No escaping possible! There are enough alternatives available! |
| 479 | 479 |
| 480 `SEP` is one of ``/:|=*+!\$~``. | 480 `SEP` is exactly one character of ``/?.,:;%|=*+!\$~"'_-#@``. |
| 481 | 481 |
| 482 | 482 |
| 483 Examples: | 483 Examples: |
| 484 | 484 |
| 485 .. code-block:: algpseudocode | 485 .. code-block:: algpseudocode |
| 500 * The line below has ∈_∌ as (peculiar) decorator name (as used in Python). | 500 * The line below has ∈_∌ as (peculiar) decorator name (as used in Python). |
| 501 * Their params are automatic (i.e. a normal expression). | 501 * Their params are automatic (i.e. a normal expression). |
| 502 */ | 502 */ |
| 503 \text{• \\ttx-nd[∈_∌](p1, p2)} \ttx-nd[∈_∌](p1, p2) | 503 \text{• \\ttx-nd[∈_∌](p1, p2)} \ttx-nd[∈_∌](p1, p2) |
| 504 /* | 504 /* |
| 505 * This is a non-existing token type: you get some generic error marking | 505 * Normal emphasis ("strong") |
| 506 */ | |
| 507 \text{• \\ttx-gs$this is strong$} \ttx-gs$this is strong$ | |
| 508 /* | |
| 509 * A strong emphasis. | |
| 510 * Note that the backslash is a valid delimiter! | |
| 511 */ | |
| 512 \text{• \\ttx-ges\\strong emphasis!\\} \ttx-ges\strong emphasis!\ | |
| 513 /* | |
| 514 * This is a non-existing token type: you get some generic error markup | |
| 506 * with a Generic.Error token and no expansion. | 515 * with a Generic.Error token and no expansion. |
| 507 */ | 516 */ |
| 508 \text{• \\ttx-NON-EXISTING[∈_∌](p1, p2)} \ttx-NON_EXISTING[∈_∌](p1, p2) | 517 \text{• \\ttx-NON-EXISTING?∈_∌?(p1, p2)} \ttx-NON_EXISTING?∈_∌?(p1, p2) |
| 509 | 518 |
| 510 .. note:: Explicit token types are **case-sensitive**. | 519 .. note:: Explicit token types are **case-sensitive**. |
| 511 | 520 |
| 512 .. note:: Explicit token types work in all `expression` and `text` contexts. | 521 .. note:: Explicit token types work in all `expression` and `text` contexts. |
| 513 | 522 |
