Mercurial > public > mercurial-scm > hg
comparison mercurial/templater.py @ 31884:0926ca37a990
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 "%")
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 03 Apr 2017 20:44:05 +0900 |
parents | 25be03a33f50 |
children | d18b624c1c06 |
comparison
equal
deleted
inserted
replaced
31883:25be03a33f50 | 31884:0926ca37a990 |
---|---|
31 # template parsing | 31 # template parsing |
32 | 32 |
33 elements = { | 33 elements = { |
34 # token-type: binding-strength, primary, prefix, infix, suffix | 34 # token-type: binding-strength, primary, prefix, infix, suffix |
35 "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), | 35 "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), |
36 "%": (6, None, None, ("%", 6), None), | 36 "%": (16, None, None, ("%", 16), None), |
37 "|": (5, None, None, ("|", 5), None), | 37 "|": (15, None, None, ("|", 15), None), |
38 "*": (4, None, None, ("*", 4), None), | 38 "*": (5, None, None, ("*", 5), None), |
39 "/": (4, None, None, ("/", 4), None), | 39 "/": (5, None, None, ("/", 5), None), |
40 "+": (3, None, None, ("+", 3), None), | 40 "+": (4, None, None, ("+", 4), None), |
41 "-": (3, None, ("negate", 10), ("-", 3), None), | 41 "-": (4, None, ("negate", 19), ("-", 4), None), |
42 ",": (2, None, None, ("list", 2), None), | 42 ",": (2, None, None, ("list", 2), None), |
43 ")": (0, None, None, None, None), | 43 ")": (0, None, None, None, None), |
44 "integer": (0, "integer", None, None, None), | 44 "integer": (0, "integer", None, None, None), |
45 "symbol": (0, "symbol", None, None, None), | 45 "symbol": (0, "symbol", None, None, None), |
46 "string": (0, "string", None, None, None), | 46 "string": (0, "string", None, None, None), |