comparison mercurial/parser.py @ 29778:e5b794063fd4

parser: remove unused binding parameter from suffix action Because a suffix action never takes subsequent tokens, it should have no binding strength nor closing character. I've tried if this value could be used to resolve infix/suffix ambiguity of x^:y, but it appears not. So I decided to resend this patch.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 05 Jul 2015 21:11:19 +0900
parents 8eba4cdcfd81
children 318a24b52eeb
comparison
equal deleted inserted replaced
29777:19578bb84731 29778:e5b794063fd4
63 while bind < self._elements[self.current[0]][0]: 63 while bind < self._elements[self.current[0]][0]:
64 token, value, pos = self._advance() 64 token, value, pos = self._advance()
65 # handle infix rules, take as suffix if unambiguous 65 # handle infix rules, take as suffix if unambiguous
66 infix, suffix = self._elements[token][3:] 66 infix, suffix = self._elements[token][3:]
67 if suffix and not (infix and self._hasnewterm()): 67 if suffix and not (infix and self._hasnewterm()):
68 expr = (suffix[0], expr) 68 expr = (suffix, expr)
69 elif infix: 69 elif infix:
70 expr = (infix[0], expr, self._parseoperand(*infix[1:])) 70 expr = (infix[0], expr, self._parseoperand(*infix[1:]))
71 else: 71 else:
72 raise error.ParseError(_("not an infix: %s") % token, pos) 72 raise error.ParseError(_("not an infix: %s") % token, pos)
73 return expr 73 return expr