[PATCH 1 of 5] parser: add comment about structure of elements to each table

Yuya Nishihara yuya at tcha.org
Tue Jul 14 09:44:25 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1436062018 -32400
#      Sun Jul 05 11:06:58 2015 +0900
# Node ID 72b91af07b4a9e52d88fce6f856a5c9f6739677f
# Parent  35fa7c77c754aa4d156c42abfdb61ca178468872
parser: add comment about structure of elements to each table

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -10,6 +10,7 @@ import parser, error, util, merge
 from i18n import _
 
 elements = {
+    # token-type: binding-strength, prefix, infix, suffix
     "(": (20, ("group", 1, ")"), ("func", 1, ")")),
     "-": (5, ("negate", 19), ("minus", 5)),
     "not": (10, ("not", 10)),
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -115,6 +115,7 @@ def _revsbetween(repo, roots, heads):
     return baseset(sorted(reachable))
 
 elements = {
+    # token-type: binding-strength, prefix, infix, suffix
     "(": (21, ("group", 1, ")"), ("func", 1, ")")),
     "##": (20, None, ("_concat", 20)),
     "~": (18, None, ("ancestor", 18)),
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -15,6 +15,7 @@ import minirst
 # template parsing
 
 elements = {
+    # token-type: binding-strength, prefix, infix, suffix
     "(": (20, ("group", 1, ")"), ("func", 1, ")")),
     ",": (2, None, ("list", 2)),
     "|": (5, None, ("|", 5)),


More information about the Mercurial-devel mailing list