[PATCH 2 of 5 V2] templater: adjust binding strengths to make room for key-value operator

Augie Fackler raf at durin42.com
Tue Apr 11 11:02:55 EDT 2017


On Mon, Apr 10, 2017 at 07:25:41PM +0100, Ryan McElroy wrote:
> On 4/10/17 1:22 PM, Yuya Nishihara wrote:
> >On Mon, 10 Apr 2017 10:45:02 +0100, Ryan McElroy wrote:
> >>On 4/8/17 2:06 PM, Yuya Nishihara wrote:
> >>># HG changeset patch
> >>># User Yuya Nishihara <yuya at tcha.org>
> >>># Date 1491219845 -32400
> >>>#      Mon Apr 03 20:44:05 2017 +0900
> >>># Node ID 50cbe5f6c63fb73cdb06f80c9ea5a7e263e0cc84
> >>># Parent  17d1ef430add6c1d1936ec33ce4be97f156a0efe
> >>>templater: adjust binding strengths to make room for key-value operator
> >>>
> >>>Changed as follows:
> >>>
> >>>   - template ops (%, |): +10
> >>>   - arithmetic ops: +1 (but "negate" should be greater than "%")
> >>I don't understand your parenthetical clause: (but "negate" should be
> >>greater than "%")
> >>
> >>Why isn't it? "-" is 4 (was 3), but "5" is 16 (was 6). Why is this
> >>comment in here? Can you explain more, or remove it?
> >I meant "but the prefix 'negate' expression (not '-' token) should have higher
> >binding value than the '%' token. That's why 'negate' was changed to 19."
>
> Ah, that makes sense! I didn't notice that the 3 became 19 on that line.
>
> I have marked these are pre-reviewed on patchwork.

Queued per your very helpful review.

>
> >
> >>>       # token-type: binding-strength, primary, prefix, infix, suffix
> >>>-    "-": (3, None, ("negate", 10), ("-", 3), None),
> >>>+    "-": (4, None, ("negate", 19), ("-", 4), None),
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list