Show More
@@ -27,8 +27,10 b' elements = {' | |||||
27 | "~": (18, None, None, ("ancestor", 18), None), |
|
27 | "~": (18, None, None, ("ancestor", 18), None), | |
28 | "^": (18, None, None, ("parent", 18), "parentpost"), |
|
28 | "^": (18, None, None, ("parent", 18), "parentpost"), | |
29 | "-": (5, None, ("negate", 19), ("minus", 5), None), |
|
29 | "-": (5, None, ("negate", 19), ("minus", 5), None), | |
30 |
"::": (17, |
|
30 | "::": (17, "dagrangeall", ("dagrangepre", 17), ("dagrange", 17), | |
31 | "..": (17, None, ("dagrangepre", 17), ("dagrange", 17), "dagrangepost"), |
|
31 | "dagrangepost"), | |
|
32 | "..": (17, "dagrangeall", ("dagrangepre", 17), ("dagrange", 17), | |||
|
33 | "dagrangepost"), | |||
32 | ":": (15, "rangeall", ("rangepre", 15), ("range", 15), "rangepost"), |
|
34 | ":": (15, "rangeall", ("rangepre", 15), ("range", 15), "rangepost"), | |
33 | "not": (10, None, ("not", 10), None, None), |
|
35 | "not": (10, None, ("not", 10), None, None), | |
34 | "!": (10, None, ("not", 10), None, None), |
|
36 | "!": (10, None, ("not", 10), None, None), | |
@@ -288,6 +290,8 b' def _fixops(x):' | |||||
288 | post = ('parentpost', x[1]) |
|
290 | post = ('parentpost', x[1]) | |
289 | if x[2][0] == 'dagrangepre': |
|
291 | if x[2][0] == 'dagrangepre': | |
290 | return _fixops(('dagrange', post, x[2][1])) |
|
292 | return _fixops(('dagrange', post, x[2][1])) | |
|
293 | elif x[2][0] == 'dagrangeall': | |||
|
294 | return _fixops(('dagrangepost', post)) | |||
291 | elif x[2][0] == 'rangepre': |
|
295 | elif x[2][0] == 'rangepre': | |
292 | return _fixops(('range', post, x[2][1])) |
|
296 | return _fixops(('range', post, x[2][1])) | |
293 | elif x[2][0] == 'rangeall': |
|
297 | elif x[2][0] == 'rangeall': | |
@@ -313,6 +317,8 b' def _analyze(x):' | |||||
313 | return _analyze(_build('only(_, _)', *x[1:])) |
|
317 | return _analyze(_build('only(_, _)', *x[1:])) | |
314 | elif op == 'onlypost': |
|
318 | elif op == 'onlypost': | |
315 | return _analyze(_build('only(_)', x[1])) |
|
319 | return _analyze(_build('only(_)', x[1])) | |
|
320 | elif op == 'dagrangeall': | |||
|
321 | raise error.ParseError(_("can't use '::' in this context")) | |||
316 | elif op == 'dagrangepre': |
|
322 | elif op == 'dagrangepre': | |
317 | return _analyze(_build('ancestors(_)', x[1])) |
|
323 | return _analyze(_build('ancestors(_)', x[1])) | |
318 | elif op == 'dagrangepost': |
|
324 | elif op == 'dagrangepost': |
@@ -792,7 +792,7 b' may be hidden (issue5385)' | |||||
792 | * set: |
|
792 | * set: | |
793 | <baseset []> |
|
793 | <baseset []> | |
794 |
|
794 | |||
795 | infix/suffix resolution of ^ operator (issue2884): |
|
795 | infix/suffix resolution of ^ operator (issue2884, issue5764): | |
796 |
|
796 | |||
797 | x^:y means (x^):y |
|
797 | x^:y means (x^):y | |
798 |
|
798 | |||
@@ -818,6 +818,17 b' infix/suffix resolution of ^ operator (i' | |||||
818 | 1 |
|
818 | 1 | |
819 | 2 |
|
819 | 2 | |
820 |
|
820 | |||
|
821 | $ try '1^..2' | |||
|
822 | (dagrange | |||
|
823 | (parentpost | |||
|
824 | (symbol '1')) | |||
|
825 | (symbol '2')) | |||
|
826 | * set: | |||
|
827 | <baseset+ [0, 1, 2]> | |||
|
828 | 0 | |||
|
829 | 1 | |||
|
830 | 2 | |||
|
831 | ||||
821 | $ try '9^:' |
|
832 | $ try '9^:' | |
822 | (rangepost |
|
833 | (rangepost | |
823 | (parentpost |
|
834 | (parentpost | |
@@ -827,6 +838,24 b' infix/suffix resolution of ^ operator (i' | |||||
827 | 8 |
|
838 | 8 | |
828 | 9 |
|
839 | 9 | |
829 |
|
840 | |||
|
841 | $ try '9^::' | |||
|
842 | (dagrangepost | |||
|
843 | (parentpost | |||
|
844 | (symbol '9'))) | |||
|
845 | * set: | |||
|
846 | <generatorsetasc+> | |||
|
847 | 8 | |||
|
848 | 9 | |||
|
849 | ||||
|
850 | $ try '9^..' | |||
|
851 | (dagrangepost | |||
|
852 | (parentpost | |||
|
853 | (symbol '9'))) | |||
|
854 | * set: | |||
|
855 | <generatorsetasc+> | |||
|
856 | 8 | |||
|
857 | 9 | |||
|
858 | ||||
830 | x^:y should be resolved before omitting group operators |
|
859 | x^:y should be resolved before omitting group operators | |
831 |
|
860 | |||
832 | $ try '1^(:2)' |
|
861 | $ try '1^(:2)' | |
@@ -944,6 +973,14 b' infix/suffix resolution of ^ operator (i' | |||||
944 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
973 | hg: parse error: ^ expects a number 0, 1, or 2 | |
945 | [255] |
|
974 | [255] | |
946 |
|
975 | |||
|
976 | '::' itself isn't a valid expression | |||
|
977 | ||||
|
978 | $ try '::' | |||
|
979 | (dagrangeall | |||
|
980 | None) | |||
|
981 | hg: parse error: can't use '::' in this context | |||
|
982 | [255] | |||
|
983 | ||||
947 | ancestor can accept 0 or more arguments |
|
984 | ancestor can accept 0 or more arguments | |
948 |
|
985 | |||
949 | $ log 'ancestor()' |
|
986 | $ log 'ancestor()' |
General Comments 0
You need to be logged in to leave comments.
Login now