diff mercurial/fileset.py @ 25815:e71e5629e006

parser: separate actions for primary expression and prefix operator This will allow us to define both a primary expression, ":", and a prefix operator, ":y". The ambiguity will be resolved by the next patch. Prefix actions in elements table are adjusted as follows: original prefix primary prefix ----------------- -------- ----------------- ("group", 1, ")") -> n/a ("group", 1, ")") ("negate", 19) -> n/a ("negate", 19) ("symbol",) -> "symbol" n/a
author Yuya Nishihara <yuya@tcha.org>
date Sun, 05 Jul 2015 12:02:13 +0900
parents 272ff3680bf3
children 23c4589fc678 e194ada8d45f
line wrap: on
line diff
--- a/mercurial/fileset.py	Fri Jul 17 15:53:56 2015 +0200
+++ b/mercurial/fileset.py	Sun Jul 05 12:02:13 2015 +0900
@@ -10,21 +10,21 @@
 from i18n import _
 
 elements = {
-    # token-type: binding-strength, prefix, infix, suffix
-    "(": (20, ("group", 1, ")"), ("func", 1, ")"), None),
-    "-": (5, ("negate", 19), ("minus", 5), None),
-    "not": (10, ("not", 10), None, None),
-    "!": (10, ("not", 10), None, None),
-    "and": (5, None, ("and", 5), None),
-    "&": (5, None, ("and", 5), None),
-    "or": (4, None, ("or", 4), None),
-    "|": (4, None, ("or", 4), None),
-    "+": (4, None, ("or", 4), None),
-    ",": (2, None, ("list", 2), None),
-    ")": (0, None, None, None),
-    "symbol": (0, ("symbol",), None, None),
-    "string": (0, ("string",), None, None),
-    "end": (0, None, None, None),
+    # token-type: binding-strength, primary, prefix, infix, suffix
+    "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None),
+    "-": (5, None, ("negate", 19), ("minus", 5), None),
+    "not": (10, None, ("not", 10), None, None),
+    "!": (10, None, ("not", 10), None, None),
+    "and": (5, None, None, ("and", 5), None),
+    "&": (5, None, None, ("and", 5), None),
+    "or": (4, None, None, ("or", 4), None),
+    "|": (4, None, None, ("or", 4), None),
+    "+": (4, None, None, ("or", 4), None),
+    ",": (2, None, None, ("list", 2), None),
+    ")": (0, None, None, None, None),
+    "symbol": (0, "symbol", None, None, None),
+    "string": (0, "string", None, None, None),
+    "end": (0, None, None, None, None),
 }
 
 keywords = set(['and', 'or', 'not'])