Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff docs/lexer-algpseudocode.rst @ 289:6fc7f9c1d89d
Remove the old implementation of explicit token types completely
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 22 May 2026 12:41:08 +0200 |
| parents | 298841bc4dee |
| children | 3e2f7ca64894 |
line wrap: on
line diff
--- a/docs/lexer-algpseudocode.rst Fri May 22 12:32:38 2026 +0200 +++ b/docs/lexer-algpseudocode.rst Fri May 22 12:41:08 2026 +0200 @@ -468,19 +468,10 @@ ==================== They allow to handle keywords and operators that are not recognized by default. -And they allow the user to explicitely highlight some input text at low-level. - -.. note:: Explicit token types are **case-sensitive**. - -.. note:: Explicit token types work in all `expression` and `text` contexts. +And they allow the user to explicitely highlight some input text with +a low-level command. -.. note:: Nested explicit token types are *not supported*. - - -Current and Recommended Syntax ------------------------------- - -The current and recommended use is the ``\ttX{ARG1}{ARG2}`` command. +They are implemented with the ``\ttX{ARG1}{ARG2}`` command. This command has two required parameters: @@ -517,6 +508,8 @@ Standard `Escaping Rules`_ apply to this argument! +.. note:: The command for explicit token types is **case-sensitive**. + .. rubric:: Examples: .. code-block:: algpseudocode @@ -574,77 +567,9 @@ \text{• \\ttX{Generic.Not.Yet.Existing\}{∈_∌\}(p1, p2)} \ttX{Generic.Not.Yet.Existing}{∈_∌}(p1, p2) - -Old Syntax (Deprecated) ------------------------ - -.. deprecated:: 3.0 - Use `Current and Recommended Syntax`_ instead. - -.. note:: The lower-case ``x`` in ``\ttx-``! - -`XX` represents a `value` in the :py:data:`pygments.token.STANDARD_TYPES` -dict. -Its corresponding token type (the associated `key` in this `dict`) is -used as token type. - -``\tt-XX/SINGLE-CHAR`` - - no escaping needed - - `SINGLE-CHAR` is a single character and can be *every* character - (including a carriage-return or line-feed) - -``\ttx-XX{CHARACTERS}`` - -``\ttx-XX(CHARACTERS)`` - -``\ttx-XX[CHARACTERS]`` - -``\ttx-XX<CHARACTERS>`` - -``\ttx-XX<SEP>CHARACTERS<SEP>`` - - No escaping possible! There are enough alternatives available! - - `SEP` is exactly one character of ``/?.,:;%|=*+!\$~"'_-#@``. - +.. note:: Explicit token types work in all `expression` and `text` contexts. -Examples: - -.. code-block:: algpseudocode - - \text{• \\tt-kc/C} \tt-kc/C \rem C as Keyword.Constant - \text{• \\tt-ow/∈} \tt-ow/∈ \rem ∈ as Operator.Word - \text{• \\ttx-kc{A Constant Keyword\}} \ttx-kc{A Constant Keyword} \rem An explicit Keyword.Constant - \text{• \\ttx-nv{A Variable Name\}} \ttx-nv{A Variable Name} \rem An explicit Name.Variable - \text{• \\ttx-ni{An Entity*Name\}} \ttx-ni{An Entity*Name} \rem An explicit Name.Entity - \text{• \\ttx-k(∈ ∌)} \ttx-k(∈ ∌) \rem ∈ and ∌ as (ordinary) Keywords - \text{• \\ttx-o<∈ ∌>} \ttx-o<∈ ∌> \rem ∈ and ∌ as (ordinary) Operators - /* - * The line below has ∈_∌ as (peculiar) function name. - * Their params are automatic (i.e. a normal expression). - */ - \text{• \\ttx-nf<∈_∌>(p1, p2)} \ttx-nf<∈_∌>(p1, p2) - /* - * The line below has ∈_∌ as (peculiar) decorator name (as used in Python). - * Their params are automatic (i.e. a normal expression). - */ - \text{• \\ttx-nd[∈_∌](p1, p2)} \ttx-nd[∈_∌](p1, p2) - /* - * Normal emphasis ("strong") - */ - \text{• \\ttx-gs$this is strong$} \ttx-gs$this is strong$ - /* - * A strong emphasis. - * Note that the backslash is a valid delimiter! - */ - \text{• \\ttx-ges\\strong emphasis!\\} \ttx-ges\strong emphasis!\ - /* - * This is a non-existing token type: you get some generic error markup - * with a Generic.Error token and no expansion. - */ - \text{• \\ttx-NON-EXISTING?∈_∌?(p1, p2)} \ttx-NON_EXISTING?∈_∌?(p1, p2) +.. note:: Nested explicit token types are *not supported*. .. _escaping-rules:
