From 03041daf9f0a2066355cd8ea12cce0c319cd0e63 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sun, 14 Nov 2021 12:39:40 -0800 Subject: [PATCH] Backport PR #21501: Refix for pyparsing compat. --- lib/matplotlib/_mathtext.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 4fd96640e89c..ea652ba91625 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -15,7 +15,7 @@ from pyparsing import ( Combine, Empty, Forward, Group, Literal, oneOf, OneOrMore, Optional, ParseBaseException, ParseFatalException, ParserElement, - ParseResults, QuotedString, Regex, StringEnd, Suppress, ZeroOrMore) + ParseResults, QuotedString, Regex, StringEnd, Suppress, White, ZeroOrMore) import matplotlib as mpl from . import _api, cbook @@ -2058,6 +2058,7 @@ def __init__(self): p.accent <<= Group( Suppress(p.bslash) + oneOf([*self._accent_map, *self._wide_accents]) + + Suppress(Optional(White())) - p.placeable )