Mercurial > hg-stable
changeset 25818:455190fb4e51
parser: take suffix action if no infix action is defined
If no infix action is defined, a suffix action isn't ambiguous, so it should
be taken no matter if the next token can be an operand. This is exactly the
same flow as prefix/primary handling.
This change has no effect now because all suffix tokens have infix actions.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 06 Jul 2015 22:01:41 +0900 |
parents | 42ac9d1d1572 |
children | be29d26e2949 |
files | mercurial/parser.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/parser.py Mon Jul 06 21:55:55 2015 +0900 +++ b/mercurial/parser.py Mon Jul 06 22:01:41 2015 +0900 @@ -62,7 +62,7 @@ token, value, pos = self._advance() # handle infix rules, take as suffix if unambiguous infix, suffix = self._elements[token][3:] - if suffix and not self._hasnewterm(): + if suffix and not (infix and self._hasnewterm()): expr = (suffix[0], expr) elif infix: expr = (infix[0], expr, self._parseoperand(*infix[1:]))