Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/conf.py @ 166:6a7dace0141e
Also implement filters to replace tokens in a token stream: TokenReplaceFilter and ErrorToGenericErrorTokenFilter
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 08 May 2026 23:54:06 +0200 |
| parents | a4317957148b |
| children | ddefcc20367c |
comparison
equal
deleted
inserted
replaced
| 165:88f872c50aae | 166:6a7dace0141e |
|---|---|
| 94 functools.partial(AlgPseudocodeLexer, no_end=True)) | 94 functools.partial(AlgPseudocodeLexer, no_end=True)) |
| 95 # For developing a lexer with smoother error handling | 95 # For developing a lexer with smoother error handling |
| 96 app.add_lexer("no-raiseonerror-algpseudocode", | 96 app.add_lexer("no-raiseonerror-algpseudocode", |
| 97 functools.partial(AlgPseudocodeLexer, | 97 functools.partial(AlgPseudocodeLexer, |
| 98 prohibit_raiseonerror_filter=True)) | 98 prohibit_raiseonerror_filter=True)) |
| 99 # | |
| 100 # To test with the custom filter that maps | |
| 101 # Token.Error to Token.Generic.Error | |
| 102 # | |
| 103 app.add_lexer("genericerror-algpseudocode", | |
| 104 functools.partial(AlgPseudocodeLexer, | |
| 105 filters=["errortogenericerror"])) |
