|
13 | 13 | import re |
14 | 14 |
|
15 | 15 | from pyparsing import ( |
16 | | - Group, Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore) |
17 | | - |
18 | | -from matplotlib import _api |
| 16 | + Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore, oneOf) |
19 | 17 |
|
20 | 18 |
|
21 | 19 | _family_punc = r'\\\-:,' |
@@ -63,8 +61,7 @@ def comma_separated(elem): |
63 | 61 | size = Regex(r"([0-9]+\.?[0-9]*|\.[0-9]+)") |
64 | 62 | name = Regex(r"[a-z]+") |
65 | 63 | value = Regex(fr"([^{_value_punc}]|(\\[{_value_punc}]))*") |
66 | | - # replace trailing `| name` by oneOf(_CONSTANTS) in mpl 3.9. |
67 | | - prop = Group((name + Suppress("=") + comma_separated(value)) | name) |
| 64 | + prop = (name + Suppress("=") + comma_separated(value)) | oneOf(_CONSTANTS) |
68 | 65 | return ( |
69 | 66 | Optional(comma_separated(family)("families")) |
70 | 67 | + Optional("-" + comma_separated(size)("sizes")) |
@@ -97,12 +94,6 @@ def parse_fontconfig_pattern(pattern): |
97 | 94 | props["size"] = [*parse["sizes"]] |
98 | 95 | for prop in parse.get("properties", []): |
99 | 96 | if len(prop) == 1: |
100 | | - if prop[0] not in _CONSTANTS: |
101 | | - _api.warn_deprecated( |
102 | | - "3.7", message=f"Support for unknown constants " |
103 | | - f"({prop[0]!r}) is deprecated since %(since)s and " |
104 | | - f"will be removed %(removal)s.") |
105 | | - continue |
106 | 97 | prop = _CONSTANTS[prop[0]] |
107 | 98 | k, *v = prop |
108 | 99 | props.setdefault(k, []).extend(map(_value_unescape, v)) |
|
0 commit comments