Patchwork [1,of,5,V2] templater: sort token table by binding strength

login
register
mail settings
Submitter Yuya Nishihara
Date April 8, 2017, 1:06 p.m.
Message ID <17d1ef430add6c1d1936.1491656796@mimosa>
Download mbox | patch
Permalink /patch/20021/
State Accepted
Headers show

Comments

Yuya Nishihara - April 8, 2017, 1:06 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1491219445 -32400
#      Mon Apr 03 20:37:25 2017 +0900
# Node ID 17d1ef430add6c1d1936ec33ce4be97f156a0efe
# Parent  1064a296a2a74a0621b253392639ef6ca0be3e87
templater: sort token table by binding strength

Just for readability.

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -33,14 +33,14 @@  from . import (
 elements = {
     # token-type: binding-strength, primary, prefix, infix, suffix
     "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None),
-    ",": (2, None, None, ("list", 2), None),
+    "%": (6, None, None, ("%", 6), None),
     "|": (5, None, None, ("|", 5), None),
-    "%": (6, None, None, ("%", 6), None),
-    ")": (0, None, None, None, None),
+    "*": (4, None, None, ("*", 4), None),
+    "/": (4, None, None, ("/", 4), None),
     "+": (3, None, None, ("+", 3), None),
     "-": (3, None, ("negate", 10), ("-", 3), None),
-    "*": (4, None, None, ("*", 4), None),
-    "/": (4, None, None, ("/", 4), None),
+    ",": (2, None, None, ("list", 2), None),
+    ")": (0, None, None, None, None),
     "integer": (0, "integer", None, None, None),
     "symbol": (0, "symbol", None, None, None),
     "string": (0, "string", None, None, None),