From 6b51ff7faf0cb32170b415341725ddfc8d7b10c7 Mon Sep 17 00:00:00 2001 From: ptmcg Date: Wed, 8 Sep 2021 17:35:16 -0500 Subject: The blackening --- pyparsing/helpers.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pyparsing/helpers.py') diff --git a/pyparsing/helpers.py b/pyparsing/helpers.py index 5988f3e..f203111 100644 --- a/pyparsing/helpers.py +++ b/pyparsing/helpers.py @@ -763,6 +763,7 @@ def infix_notation( def parseImpl(self, instring, loc, doActions=True): self.expr.try_parse(instring, loc) return loc, [] + _FB.__name__ = "FollowedBy>" ret = Forward() @@ -792,18 +793,14 @@ def infix_notation( thisExpr = Forward().set_name(term_name) if rightLeftAssoc is OpAssoc.LEFT: if arity == 1: - matchExpr = _FB(lastExpr + opExpr) + Group( - lastExpr + opExpr[1, ...] - ) + matchExpr = _FB(lastExpr + opExpr) + Group(lastExpr + opExpr[1, ...]) elif arity == 2: if opExpr is not None: matchExpr = _FB(lastExpr + opExpr + lastExpr) + Group( lastExpr + (opExpr + lastExpr)[1, ...] ) else: - matchExpr = _FB(lastExpr + lastExpr) + Group( - lastExpr[2, ...] - ) + matchExpr = _FB(lastExpr + lastExpr) + Group(lastExpr[2, ...]) elif arity == 3: matchExpr = _FB( lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr -- cgit v1.2.1