replace deprecated pyparsing method

pyparsing renamed a method used to define the operator
precedence hierarchy [1]. The method's behavior was preserved
although opt-in override enhancements to the paranthesis were
introduced.

Needed-by: https://review.opendev.org/818614/
[1] ab2f220dd2

Change-Id: I77ea03284c1db6b4eb171ef6e2e88ac506304502
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
Goutham Pacha Ravi 2021-11-22 13:08:20 -08:00
parent 70b0f6427e
commit 0dbe028009

View File

@ -235,7 +235,7 @@ def _def_parser():
nums = pyparsing.nums
oneOf = pyparsing.oneOf
opAssoc = pyparsing.opAssoc
operatorPrecedence = pyparsing.operatorPrecedence
infixNotation = pyparsing.infixNotation
Word = pyparsing.Word
integer = Word(nums)
@ -256,7 +256,7 @@ def _def_parser():
negateop = oneOf('NOT not !')
operand.setParseAction(EvalConstant)
expr = operatorPrecedence(operand, [
expr = infixNotation(operand, [
(fn, 1, opAssoc.RIGHT, EvalFunction),
("^", 2, opAssoc.RIGHT, EvalPowerOp),
(signop, 1, opAssoc.RIGHT, EvalSignOp),