# HG changeset patch # User Franz Glasner # Date 1776767597 -7200 # Node ID db1bc740a2014ea221174b424207dc8f1aedc4eb # Parent eaa99d5c719a0c119c1bbb962e49c0ceb976007e FIX: ADD: Forgotten bases.py. When renaming PseudocodeLexer2 there accidentally "LexBase" was introduced also. This was too early. diff -r eaa99d5c719a -r db1bc740a201 pygments_lexer_pseudocode2/bases.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pygments_lexer_pseudocode2/bases.py Tue Apr 21 12:33:17 2026 +0200 @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# :- +# SPDX-FileCopyrightText: © 2026 Franz Glasner +# SPDX-License-Identifier: MIT +# :- +r"""Some common bases for the lexers.""" + + +__all__ = [] + + +from pygments.lexer import RegexLexer +from pygments.token import Number + + +class LexBase(RegexLexer): + + """A base that defines some common lexer states. + + Default flags are not important. + + """ + + tokens = { +# +# This state is borrowed from Pygment's Python lexer. +# +# SPDX-SnippetBegin +# SPDX-License-Identifier: BSD-2-Clause +# SPDX-SnippetCopyrightText: Copyright 2006-2023 by the Pygments team + 'py-numbers': [ + (r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)' + r'([eE][+-]?\d(?:_?\d)*)?', Number.Float), + (r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float), + (r'0[oO](?:_?[0-7])+', Number.Oct), + (r'0[bB](?:_?[01])+', Number.Bin), + (r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex), + (r'\d(?:_?\d)*', Number.Integer), + ], +# SPDX-SnippetEnd + } diff -r eaa99d5c719a -r db1bc740a201 tox.ini --- a/tox.ini Tue Apr 21 12:15:22 2026 +0200 +++ b/tox.ini Tue Apr 21 12:33:17 2026 +0200 @@ -3,6 +3,8 @@ [flake8] per-file-ignores = # E122: continuation line missing indentation or outdented + pygments_lexer_pseudocode2/bases.py: E122 + # E122: continuation line missing indentation or outdented # E131: continuation line unaligned for hanging indent # E261: at least two spaces before inline comment # E265: block comment should start with '# '