- update to 2.12.0:

- Added lexers:
    * Cplint (#2045)
    * Macaulay2 (#1791)
    * Minecraft (#2107)
    * Qlik (#1925)
    * ``UnixConfigLexer`` for "colon-separated" config files, like ``/etc/passwd`` (#2112)
  - Updated lexers:
    * Agda: Update keyword list (#2017)
    * C family: Fix identifiers after ``case`` statements (#2084)
    * Clojure: Highlight ratios (#2042)
    * Csound: Update to 6.17 (#2064)
    * CSS: Update the list of properties (#2113)
    * Elpi:
      - Fix catastrophic backtracking (#2053, #2061)
      - Fix handling of ``->`` (#2028)
    * Futhark: Add missing tokens (#2118)
    * Gherkin: Add ``But`` (#2046)
    * Inform6: Update to 6.36 (#2050)
    * LilyPond:
      - Fix incorrect lexing of names containing a built-in (#2071)
      - Fix properties containing dashes (#2099)
    * PHP: Update builtin function and keyword list (#2054, #2056)
    * Scheme: Various improvements (#2060)
    * Spice: Update the keyword list, add new types (#2063, #2067)
    * Terraform:
      - Support non-idiomatic comments (#2065, #2066)
      - Fix class name lexing (#2097)
  - Add ``plugins`` argument to ``get_all_lexers()``.
  - Bump minimal Python version to 3.6 (#2059)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=81
This commit is contained in:
Dirk Mueller 2022-05-15 19:01:44 +00:00 committed by Git OBS Bridge
parent 7c515cfc09
commit 4e507cda01
5 changed files with 50 additions and 45 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a
size 4206258

3
Pygments-2.12.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb
size 4282017

View File

@ -1,39 +0,0 @@
From dbd7931f9d60966fbb80745db368ad773a8b7569 Mon Sep 17 00:00:00 2001
From: Jean Abou-Samra <jean@abou-samra.fr>
Date: Thu, 3 Feb 2022 22:27:01 +0100
Subject: [PATCH] Elpi: fix catastrophic backtracking (#2061)
---
pygments/lexers/elpi.py | 4 ++--
tests/snippets/elpi/test_catastrophic_backtracking.txt | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
create mode 100644 tests/snippets/elpi/test_catastrophic_backtracking.txt
diff --git a/pygments/lexers/elpi.py b/pygments/lexers/elpi.py
index 691182a86..3ce6ed6a2 100644
--- a/pygments/lexers/elpi.py
+++ b/pygments/lexers/elpi.py
@@ -32,9 +32,9 @@ class ElpiLexer(RegexLexer):
schar2_re = r"([+*^?/<>`'@#~=&!])"
schar_re = r"({}|-|\$|_)".format(schar2_re)
idchar_re = r"({}|{}|{}|{})".format(lcase_re,ucase_re,digit_re,schar_re)
- idcharstarns_re = r"({}+|(?=\.[a-z])\.{}+)".format(idchar_re,idchar_re)
+ idcharstarns_re = r"({}*(\.({}|{}){}*)*)".format(idchar_re, lcase_re, ucase_re, idchar_re)
symbchar_re = r"({}|{}|{}|{}|:)".format(lcase_re, ucase_re, digit_re, schar_re)
- constant_re = r"({}{}*|{}{}*|{}{}*|_{}+)".format(ucase_re, idchar_re, lcase_re, idcharstarns_re,schar2_re, symbchar_re,idchar_re)
+ constant_re = r"({}{}*|{}{}|{}{}*|_{}+)".format(ucase_re, idchar_re, lcase_re, idcharstarns_re,schar2_re, symbchar_re,idchar_re)
symbol_re=r"(,|<=>|->|:-|;|\?-|->|&|=>|\bas\b|\buvar\b|<|=<|=|==|>=|>|\bi<|\bi=<|\bi>=|\bi>|\bis\b|\br<|\br=<|\br>=|\br>|\bs<|\bs=<|\bs>=|\bs>|@|::|\[\]|`->|`:|`:=|\^|-|\+|\bi-|\bi\+|r-|r\+|/|\*|\bdiv\b|\bi\*|\bmod\b|\br\*|~|\bi~|\br~)"
escape_re=r"\(({}|{})\)".format(constant_re,symbol_re)
const_sym_re = r"({}|{}|{})".format(constant_re,symbol_re,escape_re)
diff --git a/tests/snippets/elpi/test_catastrophic_backtracking.txt b/tests/snippets/elpi/test_catastrophic_backtracking.txt
new file mode 100644
index 000000000..a14a0549c
--- /dev/null
+++ b/tests/snippets/elpi/test_catastrophic_backtracking.txt
@@ -0,0 +1,6 @@
+---input---
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+---tokens---
+'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' Text
+'\n' Text.Whitespace

View File

@ -1,3 +1,49 @@
-------------------------------------------------------------------
Sun May 15 18:58:34 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 2.12.0:
- Added lexers:
* Cplint (#2045)
* Macaulay2 (#1791)
* Minecraft (#2107)
* Qlik (#1925)
* ``UnixConfigLexer`` for "colon-separated" config files, like ``/etc/passwd`` (#2112)
- Updated lexers:
* Agda: Update keyword list (#2017)
* C family: Fix identifiers after ``case`` statements (#2084)
* Clojure: Highlight ratios (#2042)
* Csound: Update to 6.17 (#2064)
* CSS: Update the list of properties (#2113)
* Elpi:
- Fix catastrophic backtracking (#2053, #2061)
- Fix handling of ``->`` (#2028)
* Futhark: Add missing tokens (#2118)
* Gherkin: Add ``But`` (#2046)
* Inform6: Update to 6.36 (#2050)
* LilyPond:
- Fix incorrect lexing of names containing a built-in (#2071)
- Fix properties containing dashes (#2099)
* PHP: Update builtin function and keyword list (#2054, #2056)
* Scheme: Various improvements (#2060)
* Spice: Update the keyword list, add new types (#2063, #2067)
* Terraform:
- Support non-idiomatic comments (#2065, #2066)
- Fix class name lexing (#2097)
- Add ``plugins`` argument to ``get_all_lexers()``.
- Bump minimal Python version to 3.6 (#2059)
- Fix multiple lexers marking whitespace as ``Text`` (#2025)
- Remove various redundant uses of ``re.UNICODE`` (#2058)
- Associate ``.resource`` with the Robot framework (#2047)
- Associate ``.cljc`` with Clojure (#2043)
- Associate ``.tpp`` with C++ (#2031)
- Remove traces of Python 2 from the documentation (#2039)
- The ``native`` style was updated to meet the WCAG AAA contrast guidelines (#2038)
- Fix various typos (#2030)
- Fix ``Groff`` formatter not inheriting token styles correctly (#2024)
- Various improvements to the CI (#2036)
- The Ada lexer has been moved to a separate file (#2117)
- drop elpi_fix_catastrophic_backtracking.patch: upstream
-------------------------------------------------------------------
Sun Feb 6 21:20:22 UTC 2022 - Benoît Monin <benoit.monin@gmx.fr>

View File

@ -26,15 +26,13 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Pygments
Version: 2.11.2
Version: 2.12.0
Release: 0
Summary: A syntax highlighting package written in Python
License: BSD-2-Clause
Group: Development/Languages/Python
URL: http://pygments.org
Source: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
# PATCH-FIX-UPSTREAM -- backported from dbd7931f9d60
Patch1: elpi_fix_catastrophic_backtracking.patch
BuildRequires: %{python_module base >= 3.5}
# We need pytest just because of its test runner, it seems even
# python3 stdlib unittest runner doesn't work