1515 nums ,
1616 Optional ,
1717 Combine ,
18- oneOf ,
18+ one_of ,
1919 Group ,
20- infixNotation ,
20+ infix_notation ,
2121 opAssoc ,
2222)
2323from functools import reduce
@@ -606,23 +606,23 @@ def _makeGrammar():
606606 )
607607
608608 # direction definition
609- simple_dir = oneOf (["X" , "Y" , "Z" , "XY" , "XZ" , "YZ" ])
609+ simple_dir = one_of (["X" , "Y" , "Z" , "XY" , "XZ" , "YZ" ])
610610 direction = simple_dir ("simple_dir" ) | vector ("vector_dir" )
611611
612612 # CQ type definition
613- cqtype = oneOf (
613+ cqtype = one_of (
614614 set (geom_LUT_EDGE .values ()) | set (geom_LUT_FACE .values ()), caseless = True ,
615615 )
616- cqtype = cqtype .setParseAction (pyparsing_common .upcaseTokens )
616+ cqtype = cqtype .set_parse_action (pyparsing_common .upcase_tokens )
617617
618618 # type operator
619619 type_op = Literal ("%" )
620620
621621 # direction operator
622- direction_op = oneOf ([">" , "<" ])
622+ direction_op = one_of ([">" , "<" ])
623623
624624 # center Nth operator
625- center_nth_op = oneOf ([">>" , "<<" ])
625+ center_nth_op = one_of ([">>" , "<<" ])
626626
627627 # index definition
628628 ix_number = Group (Optional ("-" ) + Word (nums ))
@@ -632,10 +632,10 @@ def _makeGrammar():
632632 index = lsqbracket + ix_number ("index" ) + rsqbracket
633633
634634 # other operators
635- other_op = oneOf (["|" , "#" , "+" , "-" ])
635+ other_op = one_of (["|" , "#" , "+" , "-" ])
636636
637637 # named view
638- named_view = oneOf (["front" , "back" , "left" , "right" , "top" , "bottom" ])
638+ named_view = one_of (["front" , "back" , "left" , "right" , "top" , "bottom" ])
639639
640640 return (
641641 direction ("only_dir" )
@@ -760,14 +760,14 @@ def _makeExpressionGrammar(atom):
760760 # define operators
761761 and_op = Literal ("and" )
762762 or_op = Literal ("or" )
763- delta_op = oneOf (["exc" , "except" ])
763+ delta_op = one_of (["exc" , "except" ])
764764 not_op = Literal ("not" )
765765
766766 def atom_callback (res ):
767767 return _SimpleStringSyntaxSelector (res )
768768
769769 # construct a simple selector from every matched
770- atom .setParseAction (atom_callback )
770+ atom .set_parse_action (atom_callback )
771771
772772 # define callback functions for all operations
773773 def and_callback (res ):
@@ -790,7 +790,7 @@ def not_callback(res):
790790 return InverseSelector (right )
791791
792792 # construct the final grammar and set all the callbacks
793- expr = infixNotation (
793+ expr = infix_notation (
794794 atom ,
795795 [
796796 (and_op , 2 , opAssoc .LEFT , and_callback ),
@@ -862,7 +862,7 @@ def __init__(self, selectorString):
862862 Feed the input string through the parser and construct an relevant complex selector object
863863 """
864864 self .selectorString = selectorString
865- parse_result = _expression_grammar .parseString (selectorString , parseAll = True )
865+ parse_result = _expression_grammar .parse_string (selectorString , parse_all = True )
866866 self .mySelector = parse_result .asList ()[0 ]
867867
868868 def filter (self , objectList : Sequence [Shape ]):
0 commit comments