Show More
@@ -397,15 +397,18 b' def andset(repo, subset, x, y):' | |||
|
397 | 397 | def differenceset(repo, subset, x, y): |
|
398 | 398 | return getset(repo, subset, x) - getset(repo, subset, y) |
|
399 | 399 | |
|
400 |
def orset(repo, subset, |
|
|
400 | def _orsetlist(repo, subset, xs): | |
|
401 | 401 | assert xs |
|
402 | 402 | if len(xs) == 1: |
|
403 | 403 | return getset(repo, subset, xs[0]) |
|
404 | 404 | p = len(xs) // 2 |
|
405 |
a = orset(repo, subset, |
|
|
406 |
b = orset(repo, subset, |
|
|
405 | a = _orsetlist(repo, subset, xs[:p]) | |
|
406 | b = _orsetlist(repo, subset, xs[p:]) | |
|
407 | 407 | return a + b |
|
408 | 408 | |
|
409 | def orset(repo, subset, x): | |
|
410 | return _orsetlist(repo, subset, getlist(x)) | |
|
411 | ||
|
409 | 412 | def notset(repo, subset, x): |
|
410 | 413 | return subset - getset(repo, subset, x) |
|
411 | 414 | |
@@ -2339,6 +2342,10 b' def _fixops(x):' | |||
|
2339 | 2342 | return _fixops(('range', post, x[2][1])) |
|
2340 | 2343 | elif x[2][0] == 'rangeall': |
|
2341 | 2344 | return _fixops(('rangepost', post)) |
|
2345 | elif op == 'or': | |
|
2346 | # make number of arguments deterministic: | |
|
2347 | # x + y + z -> (or x y z) -> (or (list x y z)) | |
|
2348 | return (op, _fixops(('list',) + x[1:])) | |
|
2342 | 2349 | |
|
2343 | 2350 | return (op,) + tuple(_fixops(y) for y in x[1:]) |
|
2344 | 2351 | |
@@ -2374,7 +2381,7 b' def _analyze(x):' | |||
|
2374 | 2381 | tb = _analyze(x[2]) |
|
2375 | 2382 | return (op, ta, tb) |
|
2376 | 2383 | elif op == 'or': |
|
2377 |
return (op, |
|
|
2384 | return (op, _analyze(x[1])) | |
|
2378 | 2385 | elif op == 'not': |
|
2379 | 2386 | return (op, _analyze(x[1])) |
|
2380 | 2387 | elif op == 'parentpost': |
@@ -2445,7 +2452,7 b' def _optimize(x, small):' | |||
|
2445 | 2452 | ws.append(w) |
|
2446 | 2453 | ts.append(t) |
|
2447 | 2454 | del ss[:] |
|
2448 |
for y in x[1 |
|
|
2455 | for y in getlist(x[1]): | |
|
2449 | 2456 | w, t = _optimize(y, False) |
|
2450 | 2457 | if t is not None and (t[0] == 'string' or t[0] == 'symbol'): |
|
2451 | 2458 | ss.append((w, t)) |
@@ -2459,7 +2466,7 b' def _optimize(x, small):' | |||
|
2459 | 2466 | # we can't reorder trees by weight because it would change the order. |
|
2460 | 2467 | # ("sort(a + b)" == "sort(b + a)", but "a + b" != "b + a") |
|
2461 | 2468 | # ts = tuple(t for w, t in sorted(zip(ws, ts), key=lambda wt: wt[0])) |
|
2462 | return max(ws), (op,) + tuple(ts) | |
|
2469 | return max(ws), (op, ('list',) + tuple(ts)) | |
|
2463 | 2470 | elif op == 'not': |
|
2464 | 2471 | # Optimize not public() to _notpublic() because we have a fast version |
|
2465 | 2472 | if x[1] == ('func', ('symbol', 'public'), None): |
@@ -2613,7 +2620,7 b' def matchany(ui, specs, repo=None):' | |||
|
2613 | 2620 | if len(specs) == 1: |
|
2614 | 2621 | tree = parse(specs[0], lookup) |
|
2615 | 2622 | else: |
|
2616 | tree = ('or',) + tuple(parse(s, lookup) for s in specs) | |
|
2623 | tree = ('or', ('list',) + tuple(parse(s, lookup) for s in specs)) | |
|
2617 | 2624 | |
|
2618 | 2625 | if ui: |
|
2619 | 2626 | tree = expandaliases(ui, tree) |
@@ -1455,12 +1455,13 b' glog always reorders nodes which explain' | |||
|
1455 | 1455 | (group |
|
1456 | 1456 | (group |
|
1457 | 1457 | (or |
|
1458 |
( |
|
|
1459 | ('symbol', 'user') | |
|
1460 |
('s |
|
|
1461 | (func | |
|
1462 | ('symbol', 'user') | |
|
1463 |
('s |
|
|
1458 | (list | |
|
1459 | (func | |
|
1460 | ('symbol', 'user') | |
|
1461 | ('string', 'test')) | |
|
1462 | (func | |
|
1463 | ('symbol', 'user') | |
|
1464 | ('string', 'not-a-user')))))) | |
|
1464 | 1465 | $ testlog -b not-a-branch |
|
1465 | 1466 | abort: unknown revision 'not-a-branch'! |
|
1466 | 1467 | abort: unknown revision 'not-a-branch'! |
@@ -1470,26 +1471,28 b' glog always reorders nodes which explain' | |||
|
1470 | 1471 | (group |
|
1471 | 1472 | (group |
|
1472 | 1473 | (or |
|
1473 |
( |
|
|
1474 | ('symbol', 'branch') | |
|
1475 |
('s |
|
|
1476 | (func | |
|
1477 | ('symbol', 'branch') | |
|
1478 |
('s |
|
|
1479 | (func | |
|
1480 | ('symbol', 'branch') | |
|
1481 |
('s |
|
|
1474 | (list | |
|
1475 | (func | |
|
1476 | ('symbol', 'branch') | |
|
1477 | ('string', 'default')) | |
|
1478 | (func | |
|
1479 | ('symbol', 'branch') | |
|
1480 | ('string', 'branch')) | |
|
1481 | (func | |
|
1482 | ('symbol', 'branch') | |
|
1483 | ('string', 'branch')))))) | |
|
1482 | 1484 | $ testlog -k expand -k merge |
|
1483 | 1485 | [] |
|
1484 | 1486 | (group |
|
1485 | 1487 | (group |
|
1486 | 1488 | (or |
|
1487 |
( |
|
|
1488 | ('symbol', 'keyword') | |
|
1489 |
('s |
|
|
1490 | (func | |
|
1491 | ('symbol', 'keyword') | |
|
1492 |
('s |
|
|
1489 | (list | |
|
1490 | (func | |
|
1491 | ('symbol', 'keyword') | |
|
1492 | ('string', 'expand')) | |
|
1493 | (func | |
|
1494 | ('symbol', 'keyword') | |
|
1495 | ('string', 'merge')))))) | |
|
1493 | 1496 | $ testlog --only-merges |
|
1494 | 1497 | [] |
|
1495 | 1498 | (group |
@@ -1520,17 +1523,19 b' glog always reorders nodes which explain' | |||
|
1520 | 1523 | (not |
|
1521 | 1524 | (group |
|
1522 | 1525 | (or |
|
1523 |
( |
|
|
1524 |
( |
|
|
1525 |
( |
|
|
1526 |
('s |
|
|
1526 | (list | |
|
1527 | ('string', '31') | |
|
1528 | (func | |
|
1529 | ('symbol', 'ancestors') | |
|
1530 | ('string', '31')))))) | |
|
1527 | 1531 | (not |
|
1528 | 1532 | (group |
|
1529 | 1533 | (or |
|
1530 |
( |
|
|
1531 |
( |
|
|
1532 |
( |
|
|
1533 |
('s |
|
|
1534 | (list | |
|
1535 | ('string', '32') | |
|
1536 | (func | |
|
1537 | ('symbol', 'ancestors') | |
|
1538 | ('string', '32'))))))))) | |
|
1534 | 1539 | |
|
1535 | 1540 | Dedicated repo for --follow and paths filtering. The g is crafted to |
|
1536 | 1541 | have 2 filelog topological heads in a linear changeset graph. |
@@ -1587,12 +1592,13 b' have 2 filelog topological heads in a li' | |||
|
1587 | 1592 | (group |
|
1588 | 1593 | (group |
|
1589 | 1594 | (or |
|
1590 |
( |
|
|
1591 | ('symbol', 'filelog') | |
|
1592 |
('s |
|
|
1593 | (func | |
|
1594 | ('symbol', 'filelog') | |
|
1595 |
('s |
|
|
1595 | (list | |
|
1596 | (func | |
|
1597 | ('symbol', 'filelog') | |
|
1598 | ('string', 'a')) | |
|
1599 | (func | |
|
1600 | ('symbol', 'filelog') | |
|
1601 | ('string', 'b')))))) | |
|
1596 | 1602 | |
|
1597 | 1603 | Test falling back to slow path for non-existing files |
|
1598 | 1604 | |
@@ -1744,12 +1750,13 b' Test --follow and multiple files' | |||
|
1744 | 1750 | (group |
|
1745 | 1751 | (group |
|
1746 | 1752 | (or |
|
1747 |
( |
|
|
1748 | ('symbol', 'follow') | |
|
1749 |
('s |
|
|
1750 | (func | |
|
1751 | ('symbol', 'follow') | |
|
1752 |
('s |
|
|
1753 | (list | |
|
1754 | (func | |
|
1755 | ('symbol', 'follow') | |
|
1756 | ('string', 'g')) | |
|
1757 | (func | |
|
1758 | ('symbol', 'follow') | |
|
1759 | ('string', 'e')))))) | |
|
1753 | 1760 | $ cat log.nodes |
|
1754 | 1761 | nodetag 4 |
|
1755 | 1762 | nodetag 3 |
@@ -187,9 +187,10 b' trivial' | |||
|
187 | 187 | 6 |
|
188 | 188 | $ try '0|1|2' |
|
189 | 189 | (or |
|
190 | ('symbol', '0') | |
|
191 |
('symbol', ' |
|
|
192 |
('symbol', ' |
|
|
190 | (list | |
|
191 | ('symbol', '0') | |
|
192 | ('symbol', '1') | |
|
193 | ('symbol', '2'))) | |
|
193 | 194 | * set: |
|
194 | 195 | <baseset [0, 1, 2]> |
|
195 | 196 | 0 |
@@ -339,10 +340,11 b' quoting needed' | |||
|
339 | 340 | $ log '1&2' |
|
340 | 341 | $ try '1&2|3' # precedence - and is higher |
|
341 | 342 | (or |
|
342 | (and | |
|
343 | ('symbol', '1') | |
|
344 |
('symbol', ' |
|
|
345 |
('symbol', ' |
|
|
343 | (list | |
|
344 | (and | |
|
345 | ('symbol', '1') | |
|
346 | ('symbol', '2')) | |
|
347 | ('symbol', '3'))) | |
|
346 | 348 | * set: |
|
347 | 349 | <addset |
|
348 | 350 | <baseset []>, |
@@ -350,10 +352,11 b' quoting needed' | |||
|
350 | 352 | 3 |
|
351 | 353 | $ try '1|2&3' |
|
352 | 354 | (or |
|
353 | ('symbol', '1') | |
|
354 | (and | |
|
355 | ('symbol', '2') | |
|
356 |
('symbol', ' |
|
|
355 | (list | |
|
356 | ('symbol', '1') | |
|
357 | (and | |
|
358 | ('symbol', '2') | |
|
359 | ('symbol', '3')))) | |
|
357 | 360 | * set: |
|
358 | 361 | <addset |
|
359 | 362 | <baseset [1]>, |
@@ -369,11 +372,13 b' quoting needed' | |||
|
369 | 372 | <baseset []> |
|
370 | 373 | $ try '1|(2|3)' |
|
371 | 374 | (or |
|
372 | ('symbol', '1') | |
|
373 | (group | |
|
374 |
( |
|
|
375 | ('symbol', '2') | |
|
376 | ('symbol', '3')))) | |
|
375 | (list | |
|
376 | ('symbol', '1') | |
|
377 | (group | |
|
378 | (or | |
|
379 | (list | |
|
380 | ('symbol', '2') | |
|
381 | ('symbol', '3')))))) | |
|
377 | 382 | * set: |
|
378 | 383 | <addset |
|
379 | 384 | <baseset [1]>, |
@@ -465,8 +470,9 b' keyword arguments' | |||
|
465 | 470 | (keyvalue |
|
466 | 471 | ('symbol', 'foo') |
|
467 | 472 | (or |
|
468 | ('symbol', 'bar') | |
|
469 |
('symbol', 'ba |
|
|
473 | (list | |
|
474 | ('symbol', 'bar') | |
|
475 | ('symbol', 'baz')))) | |
|
470 | 476 | hg: parse error: can't use a key-value pair in this context |
|
471 | 477 | [255] |
|
472 | 478 | |
@@ -528,14 +534,16 b' parsed tree at stages:' | |||
|
528 | 534 | (minus |
|
529 | 535 | (group |
|
530 | 536 | (or |
|
531 | ('symbol', '0') | |
|
532 |
('symbol', ' |
|
|
537 | (list | |
|
538 | ('symbol', '0') | |
|
539 | ('symbol', '1')))) | |
|
533 | 540 | ('symbol', '1')) |
|
534 | 541 | * analyzed: |
|
535 | 542 | (and |
|
536 | 543 | (or |
|
537 | ('symbol', '0') | |
|
538 |
('symbol', ' |
|
|
544 | (list | |
|
545 | ('symbol', '0') | |
|
546 | ('symbol', '1'))) | |
|
539 | 547 | (not |
|
540 | 548 | ('symbol', '1'))) |
|
541 | 549 | * optimized: |
@@ -1242,9 +1250,10 b' ordering defined by it.' | |||
|
1242 | 1250 | ('symbol', '0')) |
|
1243 | 1251 | (group |
|
1244 | 1252 | (or |
|
1245 | ('symbol', '0') | |
|
1246 |
('symbol', ' |
|
|
1247 |
('symbol', ' |
|
|
1253 | (list | |
|
1254 | ('symbol', '0') | |
|
1255 | ('symbol', '1') | |
|
1256 | ('symbol', '2'))))) | |
|
1248 | 1257 | * optimized: |
|
1249 | 1258 | (and |
|
1250 | 1259 | (range |
@@ -1269,20 +1278,22 b' ordering defined by it.' | |||
|
1269 | 1278 | ('symbol', '0')) |
|
1270 | 1279 | (group |
|
1271 | 1280 | (or |
|
1272 |
( |
|
|
1273 | ('symbol', '0') | |
|
1274 |
('symbol', ' |
|
|
1275 |
('symbol', ' |
|
|
1281 | (list | |
|
1282 | (range | |
|
1283 | ('symbol', '0') | |
|
1284 | ('symbol', '1')) | |
|
1285 | ('symbol', '2'))))) | |
|
1276 | 1286 | * optimized: |
|
1277 | 1287 | (and |
|
1278 | 1288 | (range |
|
1279 | 1289 | ('symbol', '2') |
|
1280 | 1290 | ('symbol', '0')) |
|
1281 | 1291 | (or |
|
1282 |
( |
|
|
1283 | ('symbol', '0') | |
|
1284 |
('symbol', ' |
|
|
1285 |
('symbol', ' |
|
|
1292 | (list | |
|
1293 | (range | |
|
1294 | ('symbol', '0') | |
|
1295 | ('symbol', '1')) | |
|
1296 | ('symbol', '2')))) | |
|
1286 | 1297 | * set: |
|
1287 | 1298 | <addset |
|
1288 | 1299 | <filteredset |
@@ -1402,9 +1413,10 b' ordering defined by it.' | |||
|
1402 | 1413 | (func |
|
1403 | 1414 | ('symbol', 'present') |
|
1404 | 1415 | (or |
|
1405 | ('symbol', '0') | |
|
1406 |
('symbol', ' |
|
|
1407 |
('symbol', ' |
|
|
1416 | (list | |
|
1417 | ('symbol', '0') | |
|
1418 | ('symbol', '1') | |
|
1419 | ('symbol', '2'))))) | |
|
1408 | 1420 | * optimized: |
|
1409 | 1421 | (and |
|
1410 | 1422 | (range |
@@ -1499,9 +1511,10 b' ordering defined by it.' | |||
|
1499 | 1511 | (func |
|
1500 | 1512 | ('symbol', 'first') |
|
1501 | 1513 | (or |
|
1502 | ('symbol', '1') | |
|
1503 |
('symbol', ' |
|
|
1504 |
('symbol', ' |
|
|
1514 | (list | |
|
1515 | ('symbol', '1') | |
|
1516 | ('symbol', '0') | |
|
1517 | ('symbol', '2'))))) | |
|
1505 | 1518 | * optimized: |
|
1506 | 1519 | (and |
|
1507 | 1520 | (range |
@@ -1528,9 +1541,10 b' ordering defined by it.' | |||
|
1528 | 1541 | (func |
|
1529 | 1542 | ('symbol', 'last') |
|
1530 | 1543 | (or |
|
1531 |
( |
|
|
1532 |
('symbol', ' |
|
|
1533 |
('symbol', ' |
|
|
1544 | (list | |
|
1545 | ('symbol', '0') | |
|
1546 | ('symbol', '2') | |
|
1547 | ('symbol', '1')))))) | |
|
1534 | 1548 | * optimized: |
|
1535 | 1549 | (difference |
|
1536 | 1550 | (range |
@@ -1562,14 +1576,16 b' ordering defined by it.' | |||
|
1562 | 1576 | (range |
|
1563 | 1577 | (group |
|
1564 | 1578 | (or |
|
1565 |
( |
|
|
1566 |
('symbol', ' |
|
|
1567 |
('symbol', ' |
|
|
1579 | (list | |
|
1580 | ('symbol', '1') | |
|
1581 | ('symbol', '0') | |
|
1582 | ('symbol', '2')))) | |
|
1568 | 1583 | (group |
|
1569 | 1584 | (or |
|
1570 |
( |
|
|
1571 |
('symbol', ' |
|
|
1572 |
('symbol', ' |
|
|
1585 | (list | |
|
1586 | ('symbol', '0') | |
|
1587 | ('symbol', '2') | |
|
1588 | ('symbol', '1')))))) | |
|
1573 | 1589 | * optimized: |
|
1574 | 1590 | (and |
|
1575 | 1591 | (range |
@@ -1599,9 +1615,10 b' ordering defined by it.' | |||
|
1599 | 1615 | ('string', 'glob:*')) |
|
1600 | 1616 | (group |
|
1601 | 1617 | (or |
|
1602 | ('symbol', '2') | |
|
1603 |
('symbol', ' |
|
|
1604 |
('symbol', ' |
|
|
1618 | (list | |
|
1619 | ('symbol', '2') | |
|
1620 | ('symbol', '0') | |
|
1621 | ('symbol', '1'))))) | |
|
1605 | 1622 | * optimized: |
|
1606 | 1623 | (and |
|
1607 | 1624 | (func |
@@ -1628,9 +1645,10 b' ordering defined by it.' | |||
|
1628 | 1645 | ('string', 'glob:*'))) |
|
1629 | 1646 | (group |
|
1630 | 1647 | (or |
|
1631 | ('symbol', '0') | |
|
1632 |
('symbol', ' |
|
|
1633 |
('symbol', ' |
|
|
1648 | (list | |
|
1649 | ('symbol', '0') | |
|
1650 | ('symbol', '2') | |
|
1651 | ('symbol', '1'))))) | |
|
1634 | 1652 | * optimized: |
|
1635 | 1653 | (and |
|
1636 | 1654 | (func |
@@ -1975,14 +1993,15 b' test that `or` operation skips duplicate' | |||
|
1975 | 1993 | |
|
1976 | 1994 | $ try 'reverse(1::5) or ancestors(4)' |
|
1977 | 1995 | (or |
|
1978 | (func | |
|
1979 | ('symbol', 'reverse') | |
|
1980 | (dagrange | |
|
1981 | ('symbol', '1') | |
|
1982 |
('symbol', ' |
|
|
1983 | (func | |
|
1984 | ('symbol', 'ancestors') | |
|
1985 |
('symbol', ' |
|
|
1996 | (list | |
|
1997 | (func | |
|
1998 | ('symbol', 'reverse') | |
|
1999 | (dagrange | |
|
2000 | ('symbol', '1') | |
|
2001 | ('symbol', '5'))) | |
|
2002 | (func | |
|
2003 | ('symbol', 'ancestors') | |
|
2004 | ('symbol', '4')))) | |
|
1986 | 2005 | * set: |
|
1987 | 2006 | <addset |
|
1988 | 2007 | <baseset- [1, 3, 5]>, |
@@ -1997,14 +2016,15 b' test that `or` operation skips duplicate' | |||
|
1997 | 2016 | (func |
|
1998 | 2017 | ('symbol', 'sort') |
|
1999 | 2018 | (or |
|
2000 |
( |
|
|
2001 | ('symbol', 'ancestors') | |
|
2002 |
('symbol', ' |
|
|
2003 | (func | |
|
2004 | ('symbol', 'reverse') | |
|
2005 | (dagrange | |
|
2006 | ('symbol', '1') | |
|
2007 |
('symbol', ' |
|
|
2019 | (list | |
|
2020 | (func | |
|
2021 | ('symbol', 'ancestors') | |
|
2022 | ('symbol', '4')) | |
|
2023 | (func | |
|
2024 | ('symbol', 'reverse') | |
|
2025 | (dagrange | |
|
2026 | ('symbol', '1') | |
|
2027 | ('symbol', '5')))))) | |
|
2008 | 2028 | * set: |
|
2009 | 2029 | <addset+ |
|
2010 | 2030 | <generatorset+>, |
@@ -2020,14 +2040,15 b' test optimization of trivial `or` operat' | |||
|
2020 | 2040 | |
|
2021 | 2041 | $ try --optimize '0|(1)|"2"|-2|tip|null' |
|
2022 | 2042 | (or |
|
2023 | ('symbol', '0') | |
|
2024 | (group | |
|
2025 | ('symbol', '1')) | |
|
2026 |
('s |
|
|
2027 | (negate | |
|
2028 | ('symbol', '2')) | |
|
2029 |
('symbol', ' |
|
|
2030 |
('symbol', ' |
|
|
2043 | (list | |
|
2044 | ('symbol', '0') | |
|
2045 | (group | |
|
2046 | ('symbol', '1')) | |
|
2047 | ('string', '2') | |
|
2048 | (negate | |
|
2049 | ('symbol', '2')) | |
|
2050 | ('symbol', 'tip') | |
|
2051 | ('symbol', 'null'))) | |
|
2031 | 2052 | * optimized: |
|
2032 | 2053 | (func |
|
2033 | 2054 | ('symbol', '_list') |
@@ -2043,19 +2064,21 b' test optimization of trivial `or` operat' | |||
|
2043 | 2064 | |
|
2044 | 2065 | $ try --optimize '0|1|2:3' |
|
2045 | 2066 | (or |
|
2046 | ('symbol', '0') | |
|
2047 |
('symbol', ' |
|
|
2048 | (range | |
|
2049 | ('symbol', '2') | |
|
2050 |
('symbol', ' |
|
|
2067 | (list | |
|
2068 | ('symbol', '0') | |
|
2069 | ('symbol', '1') | |
|
2070 | (range | |
|
2071 | ('symbol', '2') | |
|
2072 | ('symbol', '3')))) | |
|
2051 | 2073 | * optimized: |
|
2052 | 2074 | (or |
|
2053 | (func | |
|
2054 | ('symbol', '_list') | |
|
2055 | ('string', '0\x001')) | |
|
2056 | (range | |
|
2057 | ('symbol', '2') | |
|
2058 |
('symbol', ' |
|
|
2075 | (list | |
|
2076 | (func | |
|
2077 | ('symbol', '_list') | |
|
2078 | ('string', '0\x001')) | |
|
2079 | (range | |
|
2080 | ('symbol', '2') | |
|
2081 | ('symbol', '3')))) | |
|
2059 | 2082 | * set: |
|
2060 | 2083 | <addset |
|
2061 | 2084 | <baseset [0, 1]>, |
@@ -2067,27 +2090,29 b' test optimization of trivial `or` operat' | |||
|
2067 | 2090 | |
|
2068 | 2091 | $ try --optimize '0:1|2|3:4|5|6' |
|
2069 | 2092 | (or |
|
2070 | (range | |
|
2071 | ('symbol', '0') | |
|
2072 |
('symbol', ' |
|
|
2073 |
('symbol', ' |
|
|
2074 | (range | |
|
2075 | ('symbol', '3') | |
|
2076 |
('symbol', ' |
|
|
2077 |
('symbol', ' |
|
|
2078 |
('symbol', ' |
|
|
2093 | (list | |
|
2094 | (range | |
|
2095 | ('symbol', '0') | |
|
2096 | ('symbol', '1')) | |
|
2097 | ('symbol', '2') | |
|
2098 | (range | |
|
2099 | ('symbol', '3') | |
|
2100 | ('symbol', '4')) | |
|
2101 | ('symbol', '5') | |
|
2102 | ('symbol', '6'))) | |
|
2079 | 2103 | * optimized: |
|
2080 | 2104 | (or |
|
2081 | (range | |
|
2082 | ('symbol', '0') | |
|
2083 |
('symbol', ' |
|
|
2084 |
('symbol', ' |
|
|
2085 | (range | |
|
2086 | ('symbol', '3') | |
|
2087 |
('symbol', ' |
|
|
2088 | (func | |
|
2089 | ('symbol', '_list') | |
|
2090 | ('string', '5\x006'))) | |
|
2105 | (list | |
|
2106 | (range | |
|
2107 | ('symbol', '0') | |
|
2108 | ('symbol', '1')) | |
|
2109 | ('symbol', '2') | |
|
2110 | (range | |
|
2111 | ('symbol', '3') | |
|
2112 | ('symbol', '4')) | |
|
2113 | (func | |
|
2114 | ('symbol', '_list') | |
|
2115 | ('string', '5\x006')))) | |
|
2091 | 2116 | * set: |
|
2092 | 2117 | <addset |
|
2093 | 2118 | <addset |
@@ -2109,11 +2134,12 b' unoptimized `or` looks like this' | |||
|
2109 | 2134 | $ try --no-optimized -p analyzed '0|1|2|3|4' |
|
2110 | 2135 | * analyzed: |
|
2111 | 2136 | (or |
|
2112 | ('symbol', '0') | |
|
2113 |
('symbol', ' |
|
|
2114 |
('symbol', ' |
|
|
2115 |
('symbol', ' |
|
|
2116 |
('symbol', ' |
|
|
2137 | (list | |
|
2138 | ('symbol', '0') | |
|
2139 | ('symbol', '1') | |
|
2140 | ('symbol', '2') | |
|
2141 | ('symbol', '3') | |
|
2142 | ('symbol', '4'))) | |
|
2117 | 2143 | * set: |
|
2118 | 2144 | <addset |
|
2119 | 2145 | <addset |
@@ -2188,21 +2214,22 b' test that chained `or` operations make b' | |||
|
2188 | 2214 | |
|
2189 | 2215 | $ try '0:1|1:2|2:3|3:4|4:5' |
|
2190 | 2216 | (or |
|
2191 | (range | |
|
2192 | ('symbol', '0') | |
|
2193 |
('symbol', ' |
|
|
2194 | (range | |
|
2195 | ('symbol', '1') | |
|
2196 |
('symbol', ' |
|
|
2197 | (range | |
|
2198 | ('symbol', '2') | |
|
2199 |
('symbol', ' |
|
|
2200 | (range | |
|
2201 | ('symbol', '3') | |
|
2202 |
('symbol', ' |
|
|
2203 | (range | |
|
2204 | ('symbol', '4') | |
|
2205 |
('symbol', ' |
|
|
2217 | (list | |
|
2218 | (range | |
|
2219 | ('symbol', '0') | |
|
2220 | ('symbol', '1')) | |
|
2221 | (range | |
|
2222 | ('symbol', '1') | |
|
2223 | ('symbol', '2')) | |
|
2224 | (range | |
|
2225 | ('symbol', '2') | |
|
2226 | ('symbol', '3')) | |
|
2227 | (range | |
|
2228 | ('symbol', '3') | |
|
2229 | ('symbol', '4')) | |
|
2230 | (range | |
|
2231 | ('symbol', '4') | |
|
2232 | ('symbol', '5')))) | |
|
2206 | 2233 | * set: |
|
2207 | 2234 | <addset |
|
2208 | 2235 | <addset |
@@ -2224,13 +2251,15 b' no crash by empty group "()" while optim' | |||
|
2224 | 2251 | |
|
2225 | 2252 | $ try --optimize '0|()' |
|
2226 | 2253 | (or |
|
2227 | ('symbol', '0') | |
|
2228 | (group | |
|
2229 | None)) | |
|
2254 | (list | |
|
2255 | ('symbol', '0') | |
|
2256 | (group | |
|
2257 | None))) | |
|
2230 | 2258 | * optimized: |
|
2231 | 2259 | (or |
|
2232 | ('symbol', '0') | |
|
2233 | None) | |
|
2260 | (list | |
|
2261 | ('symbol', '0') | |
|
2262 | None)) | |
|
2234 | 2263 | hg: parse error: missing argument |
|
2235 | 2264 | [255] |
|
2236 | 2265 | |
@@ -2715,10 +2744,12 b' test infinite recursion' | |||
|
2715 | 2744 | ('symbol', '3'))) |
|
2716 | 2745 | * expanded: |
|
2717 | 2746 | (or |
|
2718 | ('symbol', '3') | |
|
2719 | (or | |
|
2720 | ('symbol', '1') | |
|
2721 | ('symbol', '2'))) | |
|
2747 | (list | |
|
2748 | ('symbol', '3') | |
|
2749 | (or | |
|
2750 | (list | |
|
2751 | ('symbol', '1') | |
|
2752 | ('symbol', '2'))))) | |
|
2722 | 2753 | * set: |
|
2723 | 2754 | <addset |
|
2724 | 2755 | <baseset [3]>, |
@@ -2769,15 +2800,16 b' test chained `or` operations are flatten' | |||
|
2769 | 2800 | ('symbol', '3')))) |
|
2770 | 2801 | * expanded: |
|
2771 | 2802 | (or |
|
2772 | (range | |
|
2773 | ('symbol', '0') | |
|
2774 |
('symbol', ' |
|
|
2775 | (range | |
|
2776 | ('symbol', '1') | |
|
2777 |
('symbol', ' |
|
|
2778 | (range | |
|
2779 | ('symbol', '2') | |
|
2780 |
('symbol', ' |
|
|
2803 | (list | |
|
2804 | (range | |
|
2805 | ('symbol', '0') | |
|
2806 | ('symbol', '1')) | |
|
2807 | (range | |
|
2808 | ('symbol', '1') | |
|
2809 | ('symbol', '2')) | |
|
2810 | (range | |
|
2811 | ('symbol', '2') | |
|
2812 | ('symbol', '3')))) | |
|
2781 | 2813 | * set: |
|
2782 | 2814 | <addset |
|
2783 | 2815 | <spanset+ 0:1>, |
@@ -2868,10 +2900,11 b' test unknown reference:' | |||
|
2868 | 2900 | ('symbol', 'tip'))) |
|
2869 | 2901 | * expanded: |
|
2870 | 2902 | (or |
|
2871 | ('symbol', 'tip') | |
|
2872 | (func | |
|
2873 | ('symbol', 'desc') | |
|
2874 |
('s |
|
|
2903 | (list | |
|
2904 | ('symbol', 'tip') | |
|
2905 | (func | |
|
2906 | ('symbol', 'desc') | |
|
2907 | ('string', '$1')))) | |
|
2875 | 2908 | * set: |
|
2876 | 2909 | <addset |
|
2877 | 2910 | <baseset [9]>, |
@@ -2907,8 +2940,9 b' test unknown reference:' | |||
|
2907 | 2940 | ('symbol', 'rs') |
|
2908 | 2941 | (list |
|
2909 | 2942 | (or |
|
2910 | ('symbol', '2') | |
|
2911 |
('symbol', ' |
|
|
2943 | (list | |
|
2944 | ('symbol', '2') | |
|
2945 | ('symbol', '3'))) | |
|
2912 | 2946 | ('symbol', 'date'))) |
|
2913 | 2947 | * expanded: |
|
2914 | 2948 | (func |
@@ -2917,8 +2951,9 b' test unknown reference:' | |||
|
2917 | 2951 | ('symbol', 'sort') |
|
2918 | 2952 | (list |
|
2919 | 2953 | (or |
|
2920 |
( |
|
|
2921 |
('symbol', ' |
|
|
2954 | (list | |
|
2955 | ('symbol', '2') | |
|
2956 | ('symbol', '3'))) | |
|
2922 | 2957 | ('symbol', 'date')))) |
|
2923 | 2958 | * set: |
|
2924 | 2959 | <baseset [3, 2]> |
@@ -2950,8 +2985,9 b' test unknown reference:' | |||
|
2950 | 2985 | ('symbol', 'rs4') |
|
2951 | 2986 | (list |
|
2952 | 2987 | (or |
|
2953 | ('symbol', '2') | |
|
2954 |
('symbol', ' |
|
|
2988 | (list | |
|
2989 | ('symbol', '2') | |
|
2990 | ('symbol', '3'))) | |
|
2955 | 2991 | ('symbol', 'x') |
|
2956 | 2992 | ('symbol', 'x') |
|
2957 | 2993 | ('symbol', 'date'))) |
@@ -2962,8 +2998,9 b' test unknown reference:' | |||
|
2962 | 2998 | ('symbol', 'sort') |
|
2963 | 2999 | (list |
|
2964 | 3000 | (or |
|
2965 |
( |
|
|
2966 |
('symbol', ' |
|
|
3001 | (list | |
|
3002 | ('symbol', '2') | |
|
3003 | ('symbol', '3'))) | |
|
2967 | 3004 | ('symbol', 'date')))) |
|
2968 | 3005 | * set: |
|
2969 | 3006 | <baseset [3, 2]> |
@@ -3034,9 +3071,10 b' issue2549 - correct optimizations' | |||
|
3034 | 3071 | ('symbol', 'limit') |
|
3035 | 3072 | (list |
|
3036 | 3073 | (or |
|
3037 |
( |
|
|
3038 |
('symbol', ' |
|
|
3039 |
('symbol', ' |
|
|
3074 | (list | |
|
3075 | ('symbol', '1') | |
|
3076 | ('symbol', '2') | |
|
3077 | ('symbol', '3'))) | |
|
3040 | 3078 | ('symbol', '2'))) |
|
3041 | 3079 | (not |
|
3042 | 3080 | ('symbol', '2'))) |
@@ -3054,8 +3092,9 b' issue2549 - correct optimizations' | |||
|
3054 | 3092 | (func |
|
3055 | 3093 | ('symbol', 'max') |
|
3056 | 3094 | (or |
|
3057 | ('symbol', '1') | |
|
3058 |
('symbol', ' |
|
|
3095 | (list | |
|
3096 | ('symbol', '1') | |
|
3097 | ('symbol', '2')))) | |
|
3059 | 3098 | (not |
|
3060 | 3099 | ('symbol', '2'))) |
|
3061 | 3100 | * set: |
@@ -3071,8 +3110,9 b' issue2549 - correct optimizations' | |||
|
3071 | 3110 | (func |
|
3072 | 3111 | ('symbol', 'min') |
|
3073 | 3112 | (or |
|
3074 | ('symbol', '1') | |
|
3075 |
('symbol', ' |
|
|
3113 | (list | |
|
3114 | ('symbol', '1') | |
|
3115 | ('symbol', '2')))) | |
|
3076 | 3116 | (not |
|
3077 | 3117 | ('symbol', '1'))) |
|
3078 | 3118 | * set: |
@@ -3089,8 +3129,9 b' issue2549 - correct optimizations' | |||
|
3089 | 3129 | ('symbol', 'last') |
|
3090 | 3130 | (list |
|
3091 | 3131 | (or |
|
3092 |
( |
|
|
3093 |
('symbol', ' |
|
|
3132 | (list | |
|
3133 | ('symbol', '1') | |
|
3134 | ('symbol', '2'))) | |
|
3094 | 3135 | ('symbol', '1'))) |
|
3095 | 3136 | (not |
|
3096 | 3137 | ('symbol', '2'))) |
General Comments 0
You need to be logged in to leave comments.
Login now