# HG changeset patch # User Franz Glasner # Date 1776699752 -7200 # Node ID b42168cc9884c3a6e465f6725079790bc682c71e # Parent 5705ac8a4fd50ab97eda1c498da0e3f6f3da8adb Use numbers from the Python lexer. This snippet has a BSD-2-Clause license; include a license file in LICENSES. diff -r 5705ac8a4fd5 -r b42168cc9884 LICENSES/BSD-2-Clause.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSES/BSD-2-Clause.txt Mon Apr 20 17:42:32 2026 +0200 @@ -0,0 +1,11 @@ +BSD 2-Clause "Simplified" License + +Copyright + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r 5705ac8a4fd5 -r b42168cc9884 MANIFEST.in --- a/MANIFEST.in Mon Apr 20 15:59:32 2026 +0200 +++ b/MANIFEST.in Mon Apr 20 17:42:32 2026 +0200 @@ -1,3 +1,4 @@ include .hg* *.txt +graft LICENSES graft tests global-exclude *.pyc *.pyo diff -r 5705ac8a4fd5 -r b42168cc9884 pygments_lexer_pseudocode2/__init__.py --- a/pygments_lexer_pseudocode2/__init__.py Mon Apr 20 15:59:32 2026 +0200 +++ b/pygments_lexer_pseudocode2/__init__.py Mon Apr 20 17:42:32 2026 +0200 @@ -75,7 +75,7 @@ include('strings'), include('core'), (r'[a-zéàùçèÉÀÙÇÈ][a-z0-9éàùçèÉÀÙÇÈ_]*', Name.Variable), - include('nums'), + include('numbers'), (r'[\s]+', Text) ], 'core':[ # Statements @@ -113,10 +113,20 @@ (r'"([^"])*"', String.Double), (r"'([^'])*'", String.Single), ], - - 'nums': [ - (r'\d+(?![.Ee])', Number.Integer), - (r'[+-]?\d*\.\d+([eE][-+]?\d+)?', Number.Float), - (r'[+-]?\d+\.\d*([eE][-+]?\d+)?', Number.Float) - ], +# +# This is stolen from the Pygment's Python lexer. +# +# SPDX-SnippetBegin +# SPDX-License-Identifier: BSD-2-Clause +# SPDX-SnippetCopyrightText: Copyright 2006-2023 by the Pygments team + '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 }