Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/bases.py @ 62:7153e945a3d6
Implement ignoring of \ENDxxx including its optional name parts
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 28 Apr 2026 10:09:17 +0200 |
| parents | 661461fb4dfc |
| children | 3f4223a79d2b |
comparison
equal
deleted
inserted
replaced
| 61:392745b66969 | 62:7153e945a3d6 |
|---|---|
| 8 __all__ = ["LexBase", "uni_name", "py_innerstring_rules", "py_name_rules"] | 8 __all__ = ["LexBase", "uni_name", "py_innerstring_rules", "py_name_rules"] |
| 9 | 9 |
| 10 | 10 |
| 11 from pygments import unistring | 11 from pygments import unistring |
| 12 from pygments.lexer import RegexLexer, combined, bygroups, include | 12 from pygments.lexer import RegexLexer, combined, bygroups, include |
| 13 from pygments.token import Error, Name, Number, String, Comment | 13 from pygments.token import Error, Name, Number, String, Comment, Other |
| 14 | 14 |
| 15 | 15 |
| 16 # | 16 # |
| 17 # SPDX-SnippetBegin | 17 # SPDX-SnippetBegin |
| 18 # SPDX-License-Identifier: BSD-2-Clause | 18 # SPDX-License-Identifier: BSD-2-Clause |
| 65 """A base that defines some common lexer states. | 65 """A base that defines some common lexer states. |
| 66 | 66 |
| 67 Default flags are not important. | 67 Default flags are not important. |
| 68 | 68 |
| 69 """ | 69 """ |
| 70 | |
| 71 def op_ignore(lexer, match, ctx=None): | |
| 72 if False: | |
| 73 yield match.start(), Other, "" | |
| 70 | 74 |
| 71 tokens = { | 75 tokens = { |
| 72 # | 76 # |
| 73 # These states are borrowed from Pygment's Python lexer. | 77 # These states are borrowed from Pygment's Python lexer. |
| 74 # Their names have been prefixed with `py-'. | 78 # Their names have been prefixed with `py-'. |
