DelimitedList is new in pyparsing 3.1.0 and will deprecate delimited_list in a future release

This commit is contained in:
Robert Schmidtke 2023-06-20 14:00:28 +02:00
parent 5e2dd80d84
commit 114d3807d7

View File

@ -15,13 +15,19 @@ from pyparsing import (
Suppress, Suppress,
Word, Word,
alphanums, alphanums,
delimited_list,
exceptions, exceptions,
infix_notation, infix_notation,
one_of, one_of,
pyparsing_common, pyparsing_common,
) )
try:
# TODO import directly when depending on pyparsing>=3.1.0
from pyparsing import DelimitedList
except ImportError:
# delimited_list is deprecated in favor of DelimitedList in pyparsing 3.1.0
from pyparsing import delimited_list as DelimitedList
from .exceptions import ( from .exceptions import (
InvalidInputException, InvalidInputException,
InvalidStateException, InvalidStateException,
@ -279,7 +285,7 @@ class _PartitionFilterExpressionCache:
string <<= QuotedString(quote_char="'", esc_quote="''") | lpar + string + rpar # type: ignore string <<= QuotedString(quote_char="'", esc_quote="''") | lpar + string + rpar # type: ignore
literal = (number | string).set_name("literal") literal = (number | string).set_name("literal")
literal_list = delimited_list(literal, min=1).set_name("list") literal_list = DelimitedList(literal, min=1).set_name("list")
bin_op = one_of("<> >= <= > < =").set_name("binary op") bin_op = one_of("<> >= <= > < =").set_name("binary op")