1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 17522 17523 17524 17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 17614 17615 17616 17617 17618 17619 17620 17621 17622 17623 17624 17625 17626 17627 17628 17629 17630 17631 17632 17633 17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 17690 17691 17692 17693 17694 17695 17696 17697 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 17709 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 17759 17760 17761 17762 17763 17764 17765 17766 17767 17768 17769 17770 17771 17772 17773 17774 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 17819 17820 17821 17822 17823 17824 17825 17826 17827 17828 17829 17830 17831 17832 17833 17834 17835 17836 17837 17838 17839 17840 17841 17842 17843 17844 17845 17846 17847 17848 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 17920 17921 17922 17923 17924 17925 17926 17927 17928 17929 17930 17931 17932 17933 17934 17935 17936 17937 17938 17939 17940 17941 17942 17943 17944 17945 17946 17947 17948 17949 17950 17951 17952 17953 17954 17955 17956 17957 17958 17959 17960 17961 17962 17963 17964 17965 17966 17967 17968 17969 17970 17971 17972 17973 17974 17975 17976 17977 17978 17979 17980 17981 17982 17983 17984 17985 17986 17987 17988 17989 17990 17991 17992 17993 17994 17995 17996 17997 17998 17999 18000 18001 18002 18003 18004 18005 18006 18007 18008 18009 18010 18011 18012 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 18101 18102 18103 18104 18105 18106 18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 18130 18131 18132 18133 18134 18135 18136 18137 18138 18139 18140 18141 18142 18143 18144 18145 18146 18147 18148 18149 18150 18151 18152 18153 18154 18155 18156 18157 18158 18159 18160 18161 18162 18163 18164 18165 18166 18167 18168 18169 18170 18171 18172 18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 18214 18215 18216 18217 18218 18219 18220 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 18245 18246 18247 18248 18249 18250 18251 18252 18253 18254 18255 18256 18257 18258 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268 18269 18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 18284 18285 18286 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 18315 18316 18317 18318 18319 18320 18321 18322 18323 18324 18325 18326 18327 18328 18329 18330 18331 18332 18333 18334 18335 18336 18337 18338 18339 18340 18341 18342 18343 18344 18345 18346 18347 18348 18349 18350 18351 18352 18353 18354 18355 18356 18357 18358 18359 18360 18361 18362 18363 18364 18365 18366 18367 18368 18369 18370 18371 18372 18373 18374 18375 18376 18377 18378 18379 18380 18381 18382 18383 18384 18385 18386 18387 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 18403 18404 18405 18406 18407 18408 18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 18454 18455 18456 18457 18458 18459 18460 18461 18462 18463 18464 18465 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 18480 18481 18482 18483 18484 18485 18486 18487 18488 18489 18490 18491 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602 18603 18604 18605 18606 18607 18608 18609 18610 18611 18612 18613 18614 18615 18616 18617 18618 18619 18620 18621 18622 18623 18624 18625 18626 18627 18628 18629 18630 18631 18632 18633 18634 18635 18636 18637 18638 18639 18640 18641 18642 18643 18644 18645 18646 18647 18648 18649 18650 18651 18652 18653 18654 18655 18656 18657 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 18719 18720 18721 18722 18723 18724 18725 18726 18727 18728 18729 18730 18731 18732 18733 18734 18735 18736 18737 18738 18739 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 18912 18913 18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 20005 20006 20007 20008 20009 20010 20011 20012 20013 20014 20015 20016 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 20032 20033 20034 20035 20036 20037 20038 20039 20040 20041 20042 20043 20044 20045 20046 20047 20048 20049 20050 20051 20052 20053 20054 20055 20056 20057 20058 20059 20060 20061 20062 20063 20064 20065 20066 20067 20068 20069 20070 20071 20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 20086 20087 20088 20089 20090 20091 20092 20093 20094 20095 20096 20097 20098 20099 20100 20101 20102 20103 20104 20105 20106 20107 20108 20109 20110 20111 20112 20113 20114 20115 20116 20117 20118 20119 20120 20121 20122 20123 20124 20125 20126 20127 20128 20129 20130 20131 20132 20133 20134 20135 20136 20137 20138 20139 20140 20141 20142 20143 20144 20145 20146 20147 20148 20149 20150 20151 20152 20153 20154 20155 20156 20157 20158 20159 20160 20161 20162 20163 20164 20165 20166 20167 20168 20169 20170 20171 20172 20173 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 20189 20190 20191 20192 20193 20194 20195 20196 20197 20198 20199 20200 20201 20202 20203 20204 20205 20206 20207 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 20223 20224 20225 20226 20227 20228 20229 20230 20231 20232 20233 20234 20235 20236 20237 20238 20239 20240 20241 20242 20243 20244 20245 20246 20247 20248 20249 20250 20251 20252 20253 20254 20255 20256 20257 20258 20259 20260 20261 20262 20263 20264 20265 20266 20267 20268 20269 20270 20271 20272 20273 20274 20275 20276 20277 20278 20279 20280 20281 20282 20283 20284 20285 20286 20287 20288 20289 20290 20291 20292 20293 20294 20295 20296 20297 20298 20299 20300 20301 20302 20303 20304 20305 20306 20307 20308 20309 20310 20311 20312 20313 20314 20315 20316 20317 20318 20319 20320 20321 20322 20323 20324 20325 20326 20327 20328 20329 20330 20331 20332 20333 20334 20335 20336 20337 20338 20339 20340 20341 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 20373 20374 20375 20376 20377 20378 20379 20380 20381 20382 20383 20384 20385 20386 20387 20388 20389 20390 20391 20392 20393 20394 20395 20396 20397 20398 20399 20400 20401 20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 20414 20415 20416 20417 20418 20419 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 20516 20517 20518 20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 20546 20547 20548 20549 20550 20551 20552 20553 20554 20555 20556 20557 20558 20559 20560 20561 20562 20563 20564 20565 20566 20567 20568 20569 20570 20571 20572 20573 20574 20575 20576 20577 20578 20579 20580 20581 20582 20583 20584 20585 20586 20587 20588 20589 20590 20591 20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 20602 20603 20604 20605 20606 20607 20608 20609 20610 20611 20612 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644 20645 20646 20647 20648 20649 20650 20651 20652 20653 20654 20655 20656 20657 20658 20659 20660 20661 20662 20663 20664 20665 20666 20667 20668 20669 20670 20671 20672 20673 20674 20675 20676 20677 20678 20679 20680 20681 20682 20683 20684 20685 20686 20687 20688 20689 20690 20691 20692 20693 20694 20695 20696 20697 20698 20699 20700 20701 20702 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 20718 20719 20720 20721 20722 20723 20724 20725 20726 20727 20728 20729 20730 20731 20732 20733 20734 20735 20736 20737 20738 20739 20740 20741 20742 20743 20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 20755 20756 20757 20758 20759 20760 20761 20762 20763 20764 20765 20766 20767 20768 20769 20770 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 20791 20792 20793 20794 20795 20796 20797 20798 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 20814 20815 20816 20817 20818 20819 20820 20821 20822 20823 20824 20825 20826 20827 20828 20829 20830 20831 20832 20833 20834 20835 20836 20837 20838 20839 20840 20841 20842 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 20864 20865 20866 20867 20868 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 20943 20944 20945 20946 20947 20948 20949 20950 20951 20952 20953 20954 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 20981 20982 20983 20984 20985 20986 20987 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 21003 21004 21005 21006 21007 21008 21009 21010 21011 21012 21013 21014 21015 21016 21017 21018 21019 21020 21021 21022 21023 21024 21025 21026 21027 21028 21029 21030 21031 21032 21033 21034 21035 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 21048 21049 21050 21051 21052 21053 21054 21055 21056 21057 21058 21059 21060 21061 21062 21063 21064 21065 21066 21067 21068 21069 21070 21071 21072 21073 21074 21075 21076 21077 21078 21079 21080 21081 21082 21083 21084 21085 21086 21087 21088 21089 21090 21091 21092 21093 21094 21095 21096 21097 21098 21099 21100 21101 21102 21103 21104 21105 21106 21107 21108 21109 21110 21111 21112 21113 21114 21115 21116 21117 21118 21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 21139 21140 21141 21142 21143 21144 21145 21146 21147 21148 21149 21150 21151 21152 21153 21154 21155 21156 21157 21158 21159 21160 21161 21162 21163 21164 21165 21166 21167 21168 21169 21170 21171 21172 21173 21174 21175 21176 21177 21178 21179 21180 21181 21182 21183 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 21215 21216 21217 21218 21219 21220 21221 21222 21223 21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 21246 21247 21248 21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 21262 21263 21264 21265 21266 21267 21268 21269 21270 21271 21272 21273 21274 21275 21276 21277 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21294 21295 21296 21297 21298 21299 21300 21301 21302 21303 21304 21305 21306 21307 21308 21309 21310 21311 21312 21313 21314 21315 21316 21317 21318 21319 21320 21321 21322 21323 21324 21325 21326 21327 21328 21329 21330 21331 21332 21333 21334 21335 21336 21337 21338 21339 21340 21341 21342 21343 21344 21345 21346 21347 21348 21349 21350 21351 21352 21353 21354 21355 21356 21357 21358 21359 21360 21361 21362 21363 21364 21365 21366 21367 21368 21369 21370 21371 21372 21373 21374 21375 21376 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 21403 21404 21405 21406 21407 21408 21409 21410 21411 21412 21413 21414 21415 21416 21417 21418 21419 21420 21421 21422 21423 21424 21425 21426 21427 21428 21429 21430 21431 21432 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 21540 21541 21542 21543 21544 21545 21546 21547 21548 21549 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 21565 21566 21567 21568 21569 21570 21571 21572 21573 21574 21575 21576 21577 21578 21579 21580 21581 21582 21583 21584 21585 21586 21587 21588 21589 21590 21591 21592 21593 21594 21595 21596 21597 21598 21599 21600 21601 21602 21603 21604 21605 21606 21607 21608 21609 21610 21611 21612 21613 21614 21615 21616 21617 21618 21619 21620 21621 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 21657 21658 21659 21660 21661 21662 21663 21664 21665 21666 21667 21668 21669 21670 21671 21672 21673 21674 21675 21676 21677 21678 21679 21680 21681 21682 21683 21684 21685 21686 21687 21688 21689 21690 21691 21692 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 21705 21706 21707 21708 21709 21710 21711 21712 21713 21714 21715 21716 21717 21718 21719 21720 21721 21722 21723 21724 21725 21726 21727 21728 21729 21730 21731 21732 21733 21734 21735 21736 21737 21738 21739 21740 21741 21742 21743 21744 21745 21746 21747 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 21771 21772 21773 21774 21775 21776 21777 21778 21779 21780 21781 21782 21783 21784 21785 21786 21787 21788 21789 21790 21791 21792 21793 21794 21795 21796 21797 21798 21799 21800 21801 21802 21803 21804 21805 21806 21807 21808 21809 21810 21811 21812 21813 21814 21815 21816 21817 21818 21819 21820 21821 21822 21823 21824 21825 21826 21827 21828 21829 21830 21831 21832 21833 21834 21835 21836 21837 21838 21839 21840 21841 21842 21843 21844 21845 21846 21847 21848 21849 21850 21851 21852 21853 21854 21855 21856 21857 21858 21859 21860 21861 21862 21863 21864 21865 21866 21867 21868 21869 21870 21871 21872 21873 21874 21875 21876 21877 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 21907 21908 21909 21910 21911 21912 21913 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 21935 21936 21937 21938 21939 21940 21941 21942 21943 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 21959 21960 21961 21962 21963 21964 21965 21966 21967 21968 21969 21970 21971 21972 21973 21974 21975 21976 21977 21978 21979 21980 21981 21982 21983 21984 21985 21986 21987 21988 21989 21990 21991 21992 21993 21994 21995 21996 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 22022 22023 22024 22025 22026 22027 22028 22029 22030 22031 22032 22033 22034 22035 22036 22037 22038 22039 22040 22041 22042 22043 22044 22045 22046 22047 22048 22049 22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 22060 22061 22062 22063 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 22090 22091 22092 22093 22094 22095 22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 22115 22116 22117 22118 22119 22120 22121 22122 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 22133 22134 22135 22136 22137 22138 22139 22140 22141 22142 22143 22144 22145 22146 22147 22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 22179 22180 22181 22182 22183 22184 22185 22186 22187 22188 22189 22190 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301 22302 22303 22304 22305 22306 22307 22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 22350 22351 22352 22353 22354 22355 22356 22357 22358 22359 22360 22361 22362 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 22380 22381 22382 22383 22384 22385 22386 22387 22388 22389 22390 22391 22392 22393 22394 22395 22396 22397 22398 22399 22400 22401 22402 22403 22404 22405 22406 22407 22408 22409 22410 22411 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 22425 22426 22427 22428 22429 22430 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 22450 22451 22452 22453 22454 22455 22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 22487 22488 22489 22490 22491 22492 22493 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 22509 22510 22511 22512 22513 22514 22515 22516 22517 22518 22519 22520 22521 22522 22523 22524 22525 22526 22527 22528 22529 22530 22531 22532 22533 22534 22535 22536 22537 22538 22539 22540 22541 22542 22543 22544 22545 22546 22547 22548 22549 22550 22551 22552 22553 22554 22555 22556 22557 22558 22559 22560 22561 22562 22563 22564 22565 22566 22567 22568 22569 22570 22571 22572 22573 22574 22575 22576 22577 22578 22579 22580 22581 22582 22583 22584 22585 22586 22587 22588 22589 22590 22591 22592 22593 22594 22595 22596 22597 22598 22599 22600 22601 22602 22603 22604 22605 22606 22607 22608 22609 22610 22611 22612 22613 22614 22615 22616 22617 22618 22619 22620 22621 22622 22623 22624 22625 22626 22627 22628 22629 22630 22631 22632 22633 22634 22635 22636 22637 22638 22639 22640 22641 22642 22643 22644 22645 22646 22647 22648 22649 22650 22651 22652 22653 22654 22655 22656 22657 22658 22659 22660 22661 22662 22663 22664 22665 22666 22667 22668 22669 22670 22671 22672 22673 22674 22675 22676 22677 22678 22679 22680 22681 22682 22683 22684 22685 22686 22687 22688 22689 22690 22691 22692 22693 22694 22695 22696 22697 22698 22699 22700 22701 22702 22703 22704 22705 22706 22707 22708 22709 22710 22711 22712 22713 22714 22715 22716 22717 22718 22719 22720 22721 22722 22723 22724 22725 22726 22727 22728 22729 22730 22731 22732 22733 22734 22735 22736 22737 22738 22739 22740 22741 22742 22743 22744 22745 22746 22747 22748 22749 22750 22751 22752 22753 22754 22755 22756 22757 22758 22759 22760 22761 22762 22763 22764 22765 22766 22767 22768 22769 22770 22771 22772 22773 22774 22775 22776 22777 22778 22779 22780 22781 22782 22783 22784 22785 22786 22787 22788 22789 22790 22791 22792 22793 22794 22795 22796 22797 22798 22799 22800 22801 22802 22803 22804 22805 22806 22807 22808 22809 22810 22811 22812 22813 22814 22815 22816 22817 22818 22819 22820 22821 22822 22823 22824 22825 22826 22827 22828 22829 22830 22831 22832 22833 22834 22835 22836 22837 22838 22839 22840 22841 22842 22843 22844 22845 22846 22847 22848 22849 22850 22851 22852 22853 22854 22855 22856 22857 22858 22859 22860 22861 22862 22863 22864 22865 22866 22867 22868 22869 22870 22871 22872 22873 22874 22875 22876 22877 22878 22879 22880 22881 22882 22883 22884 22885 22886 22887 22888 22889 22890 22891 22892 22893 22894 22895 22896 22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989 22990 22991 22992 22993 22994 22995 22996 22997 22998 22999 23000 23001 23002 23003 23004 23005 23006 23007 23008 23009 23010 23011 23012 23013 23014 23015 23016 23017 23018 23019 23020 23021 23022 23023 23024 23025 23026 23027 23028 23029 23030 23031 23032 23033 23034 23035 23036 23037 23038 23039 23040 23041 23042 23043 23044 23045 23046 23047 23048 23049 23050 23051 23052 23053 23054 23055 23056 23057 23058 23059 23060 23061 23062 23063 23064 23065 23066 23067 23068 23069 23070 23071 23072 23073 23074 23075 23076 23077 23078 23079 23080 23081 23082 23083 23084 23085 23086 23087 23088 23089 23090 23091 23092 23093 23094 23095 23096 23097 23098 23099 23100 23101 23102 23103 23104 23105 23106 23107 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 23130 23131 23132 23133 23134 23135 23136 23137 23138 23139 23140 23141 23142 23143 23144 23145 23146 23147 23148 23149 23150 23151 23152 23153 23154 23155 23156 23157 23158 23159 23160 23161 23162 23163 23164 23165 23166 23167 23168 23169 23170 23171 23172 23173 23174 23175 23176 23177 23178 23179 23180 23181 23182 23183 23184 23185 23186 23187 23188 23189 23190 23191 23192 23193 23194 23195 23196 23197 23198 23199 23200 23201 23202 23203 23204 23205 23206 23207 23208 23209 23210 23211 23212 23213 23214 23215 23216 23217 23218 23219 23220 23221 23222 23223 23224 23225 23226 23227 23228 23229 23230 23231 23232 23233 23234 23235 23236 23237 23238 23239 23240 23241 23242 23243 23244 23245 23246 23247 23248 23249 23250 23251 23252 23253 23254 23255 23256 23257 23258 23259 23260 23261 23262 23263 23264 23265 23266 23267 23268 23269 23270 23271 23272 23273 23274 23275 23276 23277 23278 23279 23280 23281 23282 23283 23284 23285 23286 23287 23288 23289 23290 23291 23292 23293 23294 23295 23296 23297 23298 23299 23300 23301 23302 23303 23304 23305 23306 23307 23308 23309 23310 23311 23312 23313 23314 23315 23316 23317 23318 23319 23320 23321 23322 23323 23324 23325 23326 23327 23328 23329 23330 23331 23332 23333 23334 23335 23336 23337 23338 23339 23340 23341 23342 23343 23344 23345 23346 23347 23348 23349 23350 23351 23352 23353 23354 23355 23356 23357 23358 23359 23360 23361 23362 23363 23364 23365 23366 23367 23368 23369 23370 23371 23372 23373 23374 23375 23376 23377 23378 23379 23380 23381 23382 23383 23384 23385 23386 23387 23388 23389 23390 23391 23392 23393 23394 23395 23396 23397 23398 23399 23400 23401 23402 23403 23404 23405 23406 23407 23408 23409 23410 23411 23412 23413 23414 23415 23416 23417 23418 23419 23420 23421 23422 23423 23424 23425 23426 23427 23428 23429 23430 23431 23432 23433 23434 23435 23436 23437 23438 23439 23440 23441 23442 23443 23444 23445 23446 23447 23448 23449 23450 23451 23452 23453 23454 23455 23456 23457 23458 23459 23460 23461 23462 23463 23464 23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 23476 23477 23478 23479 23480 23481 23482 23483 23484 23485 23486 23487 23488 23489 23490 23491 23492 23493 23494 23495 23496 23497 23498 23499 23500 23501 23502 23503 23504 23505 23506 23507 23508 23509 23510 23511 23512 23513 23514 23515 23516 23517 23518 23519 23520 23521 23522 23523 23524 23525 23526 23527 23528 23529 23530 23531 23532 23533 23534 23535 23536 23537 23538 23539 23540 23541 23542 23543 23544 23545 23546 23547 23548 23549 23550 23551 23552 23553 23554 23555 23556 23557 23558 23559 23560 23561 23562 23563 23564 23565 23566 23567 23568 23569 23570 23571 23572 23573 23574 23575 23576 23577 23578 23579 23580 23581 23582 23583 23584 23585 23586 23587 23588 23589 23590 23591 23592 23593 23594 23595 23596 23597 23598 23599 23600 23601 23602 23603 23604 23605 23606 23607 23608 23609 23610 23611 23612 23613 23614 23615 23616 23617 23618 23619 23620 23621 23622 23623 23624 23625 23626 23627 23628 23629 23630 23631 23632 23633 23634 23635 23636 23637 23638 23639 23640 23641 23642 23643 23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23664 23665 23666 23667 23668 23669 23670 23671 23672 23673 23674 23675 23676 23677 23678 23679 23680 23681 23682 23683 23684 23685 23686 23687 23688 23689 23690 23691 23692 23693 23694 23695 23696 23697 23698 23699 23700 23701 23702 23703 23704 23705 23706 23707 23708 23709 23710 23711 23712 23713 23714 23715 23716 23717 23718 23719 23720 23721 23722 23723 23724 23725 23726 23727 23728 23729 23730 23731 23732 23733 23734 23735 23736 23737 23738 23739 23740 23741 23742 23743 23744 23745 23746 23747 23748 23749 23750 23751 23752 23753 23754 23755 23756 23757 23758 23759 23760 23761 23762 23763 23764 23765 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 23805 23806 23807 23808 23809 23810 23811 23812 23813 23814 23815 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23831 23832 23833 23834 23835 23836 23837 23838 23839 23840 23841 23842 23843 23844 23845 23846 23847 23848 23849 23850 23851 23852 23853 23854 23855 23856 23857 23858 23859 23860 23861 23862 23863 23864 23865 23866 23867 23868 23869 23870 23871 23872 23873 23874 23875 23876 23877 23878 23879 23880 23881 23882 23883 23884 23885 23886 23887 23888 23889 23890 23891 23892 23893 23894 23895 23896 23897 23898 23899 23900 23901 23902 23903 23904 23905 23906 23907 23908 23909 23910 23911 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 23929 23930 23931 23932 23933 23934 23935 23936 23937 23938 23939 23940 23941 23942 23943 23944 23945 23946 23947 23948 23949 23950 23951 23952 23953 23954 23955 23956 23957 23958 23959 23960 23961 23962 23963 23964 23965 23966 23967 23968 23969 23970 23971 23972 23973 23974 23975 23976 23977 23978 23979 23980 23981 23982 23983 23984 23985 23986 23987 23988 23989 23990 23991 23992 23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 24008 24009 24010 24011 24012 24013 24014 24015 24016 24017 24018 24019 24020 24021 24022 24023 24024 24025 24026 24027 24028 24029 24030 24031 24032 24033 24034 24035 24036 24037 24038 24039 24040 24041 24042 24043 24044 24045 24046 24047 24048 24049 24050 24051 24052 24053 24054 24055 24056 24057 24058 24059 24060 24061 24062 24063 24064 24065 24066 24067 24068 24069 24070 24071 24072 24073 24074 24075 24076 24077 24078 24079 24080 24081 24082 24083 24084 24085 24086 24087 24088 24089 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112 24113 24114 24115 24116 24117 24118 24119 24120 24121 24122 24123 24124 24125 24126 24127 24128 24129 24130 24131 24132 24133 24134 24135 24136 24137 24138 24139 24140 24141 24142 24143 24144 24145 24146 24147 24148 24149 24150 24151 24152 24153 24154 24155 24156 24157 24158 24159 24160 24161 24162 24163 24164 24165 24166 24167 24168 24169 24170 24171 24172 24173 24174 24175 24176 24177 24178 24179 24180 24181 24182 24183 24184 24185 24186 24187 24188 24189 24190 24191 24192 24193 24194 24195 24196 24197 24198 24199 24200 24201 24202 24203 24204 24205 24206 24207 24208 24209 24210 24211 24212 24213 24214 24215 24216 24217 24218 24219 24220 24221 24222 24223 24224 24225 24226 24227 24228 24229 24230 24231 24232 24233 24234 24235 24236 24237 24238 24239 24240 24241 24242 24243 24244 24245 24246 24247 24248 24249 24250 24251 24252 24253 24254 24255 24256 24257 24258 24259 24260 24261 24262 24263 24264 24265 24266 24267 24268 24269 24270 24271 24272 24273 24274 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284 24285 24286 24287 24288 24289 24290 24291 24292 24293 24294 24295 24296 24297 24298 24299 24300 24301 24302 24303 24304 24305 24306 24307 24308 24309 24310 24311 24312 24313 24314 24315 24316 24317 24318 24319 24320 24321 24322 24323 24324 24325 24326 24327 24328 24329 24330 24331 24332 24333 24334 24335 24336 24337 24338 24339 24340 24341 24342 24343 24344 24345 24346 24347 24348 24349 24350 24351 24352 24353 24354 24355 24356 24357 24358 24359 24360 24361 24362 24363 24364 24365 24366 24367 24368 24369 24370 24371 24372 24373 24374 24375 24376 24377 24378 24379 24380 24381 24382 24383 24384 24385 24386 24387 24388 24389 24390 24391 24392 24393 24394 24395 24396 24397 24398 24399 24400 24401 24402 24403 24404 24405 24406 24407 24408 24409 24410 24411 24412 24413 24414 24415 24416 24417 24418 24419 24420 24421 24422 24423 24424 24425 24426 24427 24428 24429 24430 24431 24432 24433 24434 24435 24436 24437 24438 24439 24440 24441 24442 24443 24444 24445 24446 24447 24448 24449 24450 24451 24452 24453 24454 24455 24456 24457 24458 24459 24460 24461 24462 24463 24464 24465 24466 24467 24468 24469 24470 24471 24472 24473 24474 24475 24476 24477 24478 24479 24480 24481 24482 24483 24484 24485 24486 24487 24488 24489 24490 24491 24492 24493 24494 24495 24496 24497 24498 24499 24500 24501 24502 24503 24504 24505 24506 24507 24508 24509 24510 24511 24512 24513 24514 24515 24516 24517 24518 24519 24520 24521 24522 24523 24524 24525 24526 24527 24528 24529 24530 24531 24532 24533 24534 24535 24536 24537 24538 24539 24540 24541 24542 24543 24544 24545 24546 24547 24548 24549 24550 24551 24552 24553 24554 24555 24556 24557 24558 24559 24560 24561 24562 24563 24564 24565 24566 24567 24568 24569 24570 24571 24572 24573 24574 24575 24576 24577 24578 24579 24580 24581 24582 24583 24584 24585 24586 24587 24588 24589 24590 24591 24592 24593 24594 24595 24596 24597 24598 24599 24600 24601 24602 24603 24604 24605 24606 24607 24608 24609 24610 24611 24612 24613 24614 24615 24616 24617 24618 24619 24620 24621 24622 24623 24624 24625 24626 24627 24628 24629 24630 24631 24632 24633 24634 24635 24636 24637 24638 24639 24640 24641 24642 24643 24644 24645 24646 24647 24648 24649 24650 24651 24652 24653 24654 24655 24656 24657 24658 24659 24660 24661 24662 24663 24664 24665 24666 24667 24668 24669 24670 24671 24672 24673 24674 24675 24676 24677 24678 24679 24680 24681 24682 24683 24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 24698 24699 24700 24701 24702 24703 24704 24705 24706 24707 24708 24709 24710 24711 24712 24713 24714 24715 24716 24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 24730 24731 24732 24733 24734 24735 24736 24737 24738 24739 24740 24741 24742 24743 24744 24745 24746 24747 24748 24749 24750 24751 24752 24753 24754 24755 24756 24757 24758 24759 24760 24761 24762 24763 24764 24765 24766 24767 24768 24769 24770 24771 24772 24773 24774 24775 24776 24777 24778 24779 24780 24781 24782 24783 24784 24785 24786 24787 24788 24789 24790 24791 24792 24793 24794 24795 24796 24797 24798 24799 24800 24801 24802 24803 24804 24805 24806 24807 24808 24809 24810 24811 24812 24813 24814 24815 24816 24817 24818 24819 24820 24821 24822 24823 24824 24825 24826 24827 24828 24829 24830 24831 24832 24833 24834 24835 24836 24837 24838 24839 24840 24841 24842 24843 24844 24845 24846 24847 24848 24849 24850 24851 24852 24853 24854 24855 24856 24857 24858 24859 24860 24861 24862 24863 24864 24865 24866 24867 24868 24869 24870 24871 24872 24873 24874 24875 24876 24877 24878 24879 24880 24881 24882 24883 24884 24885 24886 24887 24888 24889 24890 24891 24892 24893 24894 24895 24896 24897 24898 24899 24900 24901 24902 24903 24904 24905 24906 24907 24908 24909 24910 24911 24912 24913 24914 24915 24916 24917 24918 24919 24920 24921 24922 24923 24924 24925 24926 24927 24928 24929 24930 24931 24932 24933 24934 24935 24936 24937 24938 24939 24940 24941 24942 24943 24944 24945 24946 24947 24948 24949 24950 24951 24952 24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034 25035 25036 25037 25038 25039 25040 25041 25042 25043 25044 25045 25046 25047 25048 25049 25050 25051 25052 25053 25054 25055 25056 25057 25058 25059 25060 25061 25062 25063 25064 25065 25066 25067 25068 25069 25070 25071 25072 25073 25074 25075 25076 25077 25078 25079 25080 25081 25082 25083 25084 25085 25086 25087 25088 25089 25090 25091 25092 25093 25094 25095 25096 25097 25098 25099 25100 25101 25102 25103 25104 25105 25106 25107 25108 25109 25110 25111 25112 25113 25114 25115 25116 25117 25118 25119 25120 25121 25122 25123 25124 25125 25126 25127 25128 25129 25130 25131 25132 25133 25134 25135 25136 25137 25138 25139 25140 25141 25142 25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25153 25154 25155 25156 25157 25158 25159 25160 25161 25162 25163 25164 25165 25166 25167 25168 25169 25170 25171 25172 25173 25174 25175 25176 25177 25178 25179 25180 25181 25182 25183 25184 25185 25186 25187 25188 25189 25190 25191 25192 25193 25194 25195 25196 25197 25198 25199 25200 25201 25202 25203 25204 25205 25206 25207 25208 25209 25210 25211 25212 25213 25214 25215 25216 25217 25218 25219 25220 25221 25222 25223 25224 25225 25226 25227 25228 25229 25230 25231 25232 25233 25234 25235 25236 25237 25238 25239 25240 25241 25242 25243 25244 25245 25246 25247 25248 25249 25250 25251 25252 25253 25254 25255 25256 25257 25258 25259 25260 25261 25262 25263 25264 25265 25266 25267 25268 25269 25270 25271 25272 25273 25274 25275 25276 25277 25278 25279 25280 25281 25282 25283 25284 25285 25286 25287 25288 25289 25290 25291 25292 25293 25294 25295 25296 25297 25298 25299 25300 25301 25302 25303 25304 25305 25306 25307 25308 25309 25310 25311 25312 25313 25314 25315 25316 25317 25318 25319 25320 25321 25322 25323 25324 25325 25326 25327 25328 25329 25330 25331 25332 25333 25334 25335 25336 25337 25338 25339 25340 25341 25342 25343 25344 25345 25346 25347 25348 25349 25350 25351 25352 25353 25354 25355 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381 25382 25383 25384 25385 25386 25387 25388 25389 25390 25391 25392 25393 25394 25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 25411 25412 25413 25414 25415 25416 25417 25418 25419 25420 25421 25422 25423 25424 25425 25426 25427 25428 25429 25430 25431 25432 25433 25434 25435 25436 25437 25438 25439 25440
|
2025-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* NEWS: Update.
* doc/gendocs_template: Update version to `4.3'.
2025-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-asm.h (pkl_asm_for_loop): Add new parameter for type of
loop's condition.
* libpoke/pkl-asm.c (pkl_asm_for_loop): Use new parameter to generate
appropriate variant of BZ insn when available.
* libpoke/pkl-promo.c (pkl_promo_ps_loop_stmt): New phase for loops to
promote loop's condition if the condition is of type integral struct.
(pkl_phase_promo): Register new phase.
* libpoke/pkl-gen.c (pkl_gen_pr_loop_stmt): Pass type of condition
to `pkl_asm_for_loop' when available.
* testsuite/poke.pkl/for-in-int-struct-1: Fix the test to actually
verify correctness of codegen. Test was unable to catch the bug due
to "sub-string match" behavior of `dg-output'.
* testsuite/poke.pkl/for-in-int-struct-2: New test.
* testsuite/poke.pkl/for-in-int-struct-3: Likewise.
* testsuite/poke.pkl/for-in-int-struct-4: Likewise.
* testsuite/poke.pkl/for-in-6.pk: Likewise.
* testsuite/poke.pkl/for-diag-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2025-03-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-term.c (pk_term_hyperlink_1): Only keep invocation of
`styled_ostream_set_hyperlink' under
`ifdef HAVE_TEXTSTYLE_HYPERLINK_SUPPORT' guard.
(pk_term_end_hyperlink_1): Likewise.
2025-03-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Compile constructor/mapper/
comparator/integrator/deintegrator/typifier for alias types to have
the correct names.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* testsuite/poke.map/type-alias-1.pk: New test.
* testsuite/poke.pkl/type-alias-1.pk: Likewise.
2025-03-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Set name of PVM struct
type to provided non-null compile-time name.
2025-03-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Add assertion to verify
that we're generating constructor for an unnamed struct.
2024-06-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_call_node_handlers): Use
PKL_AST_TYPE_CODE2 instead of PKL_AST_TYPE_CODE.
(pkl_do_pass_1): Likewise.
* libpoke/pkl-tab.y: Pass the ast to pkl_env_register.
(TYPENAME): Add a type alias node instead of the aliased type to
the AST.
* libpoke/pkl-typify.c (pkl_typify1_ps_op_typeof): Create a named
type.
* libpoke/pkl.c (pkl_defvar): Pass the ast to pkl_env_register.
* libpoke/pvm-val.c (pvm_make_struct_type): Do not get a `name' argument.
(pvm_type_equal_p): Struct types may have PVM_NULL as name.
(pvm_make_exception): Set struct type name explicitly.
* libpoke/pvm.jitter (mktysct): Do not get a type name argument.
(tysctsetn): New instruction.
* testsuite/poke.pkl/redef-diag-7.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* libpoke/pkl-insn.def: New instruction tysctsetn.
* libpoke/pkl-gen.pks (field_location_str): Get the name of the
struct type in an argument.
(check_struct_field_constraint): Likewise.
(handle_struct_field_constraints): Likewise.
(struct_field_extractor): Likewise.
(struct_field_mapper): Likewise.
(struct_mapper): Likewise.
(struct_constructor): Likewise.
(struct_deintegrator): Likewise.
(typifier_any_any_wrapper): Likewise.
(typifier_any_any_int_wrapper): Likewise.
(struct_typifier): Likewise.
(typeof): Set the name of the Pk_Type struct explicitly.
(common_typifier): Do not set the field `name' of Pk_Type.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Pass type names to RAS
macros requiring it.
(pkl_gen_pr_ass_stmt): Use PKL_AST_TYPE_NAMED_P instead of
PKL_AST_TYPE_NAME to query whether a type is aliased.
(pkl_gen_pr_func): Likewise.
(pkl_gen_pr_func_arg): Likewise.
(pkl_gen_pr_cast): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_pr_type_struct): Likewise.
(pkl_gen_pr_type_alias): New handler.
* libpoke/pkl-env.c (register_decl): Get an ast argument.
(register_decl): Invoke pkl_ast_rename_decl to rename
declarations.
(pkl_env_register): Get an ast argument.
* libpoke/pkl-env.h: Change prototype of pkl_ast_rename_decl
accordingly.
* libpoke/pkl-ast.h (enum pkl_ast_type_code): New value
PKL_TYPE_ALIAS.
(PKL_AST_TYPE_NAME): Redefine to support type aliases nodes.
(PKL_AST_TYPE_CODE2): Define.
(struct pkl_ast_type): Remove field name, new field named_p, and
add fields for type aliases.
(PKL_AST_DECL_TYPE_NAMES): Define.
(struct pkl_ast_decl): New field type_names.
* libpoke/pkl-ast.c (pkl_ast_make_type): Do not initialize name.
(pkl_ast_type_resolv): New function.
(pkl_ast_make_named_type): Likewise.
(pkl_ast_add_type_name_to_decl): Likewise.
(pkl_ast_rename_decl): Likewise.
(pkl_ast_node_free_1): Support type aliases nodes.
(pkl_ast_format_1): Likewise.
* libpoke/pk-val.c (pk_make_struct_type): Do not pass name to
pvm_make_struct_type.
2025-01-05 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-val.c (pvm_allocate_struct_attrs): Do not over-allocate.
`fnames' and `ftypes' only need `nfields' number of elements.
2025-01-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (RAS_MACRO_PUSHIOS): New macro to extend
`pushios' insn to raise exception if there's no IOS.
* libpoke/pkl-gen.c (pkl_gen_pr_map): Replace `pushios' insn with
`RAS_MACRO_PUSHIOS'.
* testsuite/poke.pkl/map-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-12-31 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-alloc.c (pvm_alloc_register_thread): Move side-effects out of
`assert'.
(pvm_alloc_unregister_thread): Likewise.
2024-12-31 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (bzl): Normalize branch condition to prevent
loss of information due to casting to `jitter_uint' on 32-bit systems.
(bzlu): Likewise.
(bnzl): Likewise.
(bnzlu): Likewise.
2024-12-29 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.h (pvm_make_integral): New function declaration.
* libpoke/pvm-val.c (pvm_make_integral): New function moved from
`libpoke/pvm-val.c'.
* libpoke/pkl-asm.c (pvm_make_integral): Removed.
* libpoke/pkl-promo.c (pkl_promo_ps_op_binary): Do not cast to `int<32>'
for the following operators: `&&', `||' and `=>' to prevent loss of
information due to possible truncation.
(pkl_promo_ps_op_unary): Likewise for `!' unary operator.
* libpoke/pkl-gen.c (pkl_gen_pr_op_and): Change codegen to work correctly
with operands wider than `int<32>'.
(pkl_gen_pr_op_or): Likewise.
(pkl_gen_pr_op_impl): Likewise.
(pkl_gen_pr_op_not): Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* testsuite/poke.pkl/and-16.pk: New test.
* testsuite/poke.pkl/and-17.pk: Likewise.
* testsuite/poke.pkl/and-18.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-4.pk: Likewise.
* testsuite/poke.pkl/impl-6.pk: Likewise.
* testsuite/poke.pkl/or-6.pk: Likewise.
* testsuite/poke.pkl/or-7.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-4.pk: Likewise.
2024-10-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-lex.l: Fix pattern for matching delimited alien token
to not use name definitions inside character class.
(NOT_GT): New name definition.
* testsuite/poke.cmd/ios-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-10-05 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_op_add): Install a writer for the
result of array concatenation.
* testsuite/poke.map/ass-map-29.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-10-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (atrim): Install a writer when the original
original is not mapped.
* testsuite/poke.map/ass-map-28.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-09-25 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/learn-poke-language-in-y-minutes.pk: Update and add a few
more examples.
2024-09-25 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* etc/poke-ras-mode.el: Replace FSF's address with URL.
* testsuite/poke.cmd/cmd.exp: Likewise.
* testsuite/poke.map/map.exp: Likewise.
* testsuite/poke.pickles/pickles.exp: Likewise.
* testsuite/poke.pkl/pkl.exp: Likewise.
* testsuite/poke.pktest/pktest.exp: Likewise.
* testsuite/poke.pvm/pvm.exp: Likewise.
* testsuite/poke.repl/repl.exp: Likewise.
* testsuite/poke.std/std.exp: Likewise.
* testsuite/poke.time/time.exp: Likewise.
2024-09-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec): Clear lexical cuckolding if
pk_compile_statement_with_loc fails.
2024-09-24 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (bootstrap_epilogue): Define.
2024-09-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-editor.c (pk_cmd_editor): Do not print a dot at the
end of error messages.
2024-09-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_SIS): Signal out of memory.
(EMUL_SIS): Use malloc instead of xmalloc.
(OP_BINARY_SSS): Call PKL_PASS_ERROR after PKL_ICE.
* libpoke/pkl-trans.c (pkl_trans1_ps_format): Likewise.
(pkl_trans2_ps_incdecr): Likewise.
* libpoke/pkl-trans.c (XSTRDUP): Likewise.
(XMALLOC): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_func): Likewise.
2024-09-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c: Likewise.
* libpoke/pkl-fold.c: Do not include xalloc.h.
* libpoke/pkl-tab.y: Do not include xalloc.h.
* libpoke/pkl-trans.c: Do not include xalloc.h.
(XSTRDUP): Define.
(XMALLOC): Likewise.
2024-09-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf-ext.pk (BTF_Ext_Header): Improve constraint for
`magic' so it handles endianness better.
2024-09-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-help.pk: Add missing "dispatch" in synopsis for .vm.
2024-09-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (dup-wap-to-dup): New rewrite.
(swap-tuck-to-over): Likewise.
2024-09-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Fix
memory leak.
2024-09-20 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/set-oacutoff-2.pk: Escape dots in regexps.
* testsuite/poke.pkl/printf-25.pk: Likewise.
* testsuite/poke.pkl/format-28.pk: Likewise.
* testsuite/poke.pkl/format-20.pk: Likewise.
* testsuite/poke.pkl/format-19.pk: Likewise.
* testsuite/poke.cmd/set-oindent.pk: Likewise.
* testsuite/poke.cmd/set-odepth-1.pk: Likewise.
2024-09-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h: Remove spurious definition of
pvm_make_mapinfo.
2024-09-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (file_cmd): Add flags to command synopsis.
(proc_cmd): Likewise.
2024-09-16 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Write-only Partial Bytes): New section.
2024-06-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/poke.pkl/break-while-7.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-06-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* NEWS: Update.
* doc/gendocs_template: Update version to `4.2'.
2024-06-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_format_1): Show `nframes' and
`npopes' fields of `PKL_AST_BREAK_CONTINUE_STMT' node.
2024-06-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/poke.pkl/break-while-3.pk: Use explicit
output base 10.
2024-06-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (PKL_TRANS_PUSH_ESCAPABLE): Initialize
`npopes' field.
2024-06-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_pr_try_stmt_handler): Fix
`nframes' tracking to only change iff we're using try-catch
with argument form: `try {...} catch (Exception ex) {...}'.
* (pkl_trans1_ps_try_stmt_handler): Likewise.
* testsuite/poke.pkl/break-while-4.pk: New test.
* testsuite/poke.pkl/break-while-5.pk: Likewise.
* testsuite/poke.pkl/break-while-6.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-06-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/diff.pk (diff_structured): Fix `elem_simple_p'
to detect "simple" types correctly.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* testsuite/poke.cmd/sdiff-13.pk: New test.
2024-06-15 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-tab.y (pushlevel_args): Call `assert' on
the result of `pkl_register_arg' function instead of the
whole function call expression.
2024-06-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-diag.c (pkl_detailed_location): Remove extra empty
line.
(pkl_loc_to_source): Handle compilation from buffer.
2024-06-13 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (expr_to_ios): Emit diagnostics in all failing
cases.
(pk_cmd_ios): Adjust accordingly.
(pk_cmd_close): Likewise.
2024-06-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (iogetb): Do not convert units to bytes.
* testsuite/poke.pkl/iobias-1.pk: Update test accordingly.
* testsuite/poke.pkl/iobias-2.pk: Likewise.
* testsuite/poke.pkl/iosetbias-2.pk: Likewise.
* testsuite/poke.pkl/iosetbias-3.pk: Likewise.
* testsuite/poke.pkl/iosetbias-4.pk: Likewise.
2024-06-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (INVALID_CAST): Remove.
(pkl_typify1_ps_cast): Mention types in invalid cast error
diagnostic.
2024-06-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_COMP_STMT_BUILTIN): Remove.
(struct pkl_ast_comp_stmt): Remove field `builtin'.
(PKL_AST_BUILTIN_NONE): Remove.
* libpoke/pkl-ast.c (pkl_ast_make_comp_stmt): Do not initialize
PKL_AST_COMP_STMT_BUILTIN.
(pkl_ast_make_builtin): Remove.
(pkl_ast_format_1): Do not print the `builtin' field.
* libpoke/pkl-anal.c (pkl_anal1_ps_comp_stmt): Remove handler.
* libpoke/pkl-gen.c (pkl_gen_pr_comp_stmt): Do not handle
builtins.
(pkl_gen_ps_comp_stmt): Likewise.
2024-06-09 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/array-bound-8.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2024-06-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_pr_try_stmt_body): increase
npopes only if not try-until.
(pkl_trans1_ps_try_stmt_body): Likewise.
2024-06-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_pr_try_stmt_body): Increase
npopes in escapable.
(pkl_trans1_ps_try_stmt_body): Decrease npopes in escapable.
* testsuite/poke.pkl/break-while-6.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2024-06-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (PKL_TRANS_PUSH_UNESCAPABLE): Define.
(pkl_trans1_pr_type_struct): Push unescapable context.
(pkl_trans1_ps_type_struct): Pop uescapable context.
(pkl_trans1_pr_type_array): Push unescapable context.
(pkl_trans1_ps_type_array): Pop uescapable context.
(pkl_trans1_pr_func): Push unescapable context.
(pkl_trans1_ps_func): Pop uescapable context.
* libpoke/pkl-trans.h (PKL_TRANS_MAX_COMP_STMT_NEST): Bump
to 120.
* testsuite/poke.pkl/break-diag-2.pk: New test.
* testsuite/poke.pkl/break-diag-3.pk: Likewise.
* testsuite/poke.pkl/break-diag-4.pk: Likewise.
* testsuite/poke.pkl/break-diag-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2024-06-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (Dot-Commands): Fix the example to use
`.vm disa' instead of `.vm dis'.
(.vm disassemble): Remove non-existent sub-commands.
2024-06-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/poke.pokefmt/pokefmt.exp (pokefmt_run): Catch
exceptional returns of `exec'.
2024-06-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (enum pkl_ast_code): Remove `PKL_AST_GCD'.
2024-06-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_struct_type_traverse): s/strtok/strtok_r/.
2024-06-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_struct_type_traverse): Exclude unnamed
fields.
2024-05-31 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-mmap.c (ios_dev_mmap_open): Fix error handling
of `strdup'.
2024-05-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* NEWS: Update.
* doc/gendocs_template: Update version to `4.1'.
2024-05-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_do_pass_1): Avoid accessing
uninitialized memory.
2024-05-01 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* utils/pk-jojopatch.in: Disable auto-remap to improve speed.
2024-04-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd-vm.c (vm_cmd): Update usage string to also mention
`profile' and `dispatch' sub-commands.
2024-04-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BREAK_CONTINUE_STMT_NPOPES): New
macro.
(struct pkl_ast_break_continue_stmt): New field `npopes' to keep
track of number of `pope' instructions.
* libpoke/pkl-trans.h (struct pkl_trans_escapable_ctx): Add new
field `npopes'.
* libpoke/pkl-trans.c (pkl_trans1_pr_comp_stmt): For EXCOND
expression statements, only keep track of number of `pope' insns.
(pkl_trans1_ps_comp_stmt): Likewise.
(pkl_trans1_ps_break_continue_stmt): Update the node with the number
of `pope' insns.
* libpoke/pkl-gen.c (pkl_gen_ps_break_continue_stmt): Emit `pope'
instruction(s).
(pkl_gen_pr_op_excond): Push the failure result after evaluation
of the EXCOND's LHS.
* testsuite/poke.pkl/excond-6.pk: New test.
* testsuite/poke.pkl/excond-7.pk: Likewise.
* testsuite/poke.pkl/excond-8.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2024-04-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-diag.c (pkl_detailed_location): Handle the failure
of `fseeko'.
2024-04-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Poke Scripts): Document poke_interactive_p.
2024-04-01 Sergio Durigan Junior <sergiodj@sergiodj.net>
* man/Makefile.am: Generate manpage for pokefmt.
2024-04-01 Sergio Durigan Junior <sergiodj@sergiodj.net>
* pokefmt/pokefmt.l (poke_stmt): Fix typo.
(poke_expr): Likewise.
2024-003-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_type_append_to): Include itype in
integral struct type string representations.
2024-03-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_do_pass_1): Do not increase reference
counter automatically in substituted PKL_PASS_NODE. Let the
handlers do it instead.
* libpoke/pkl-fold.c (OP_UNARY_II): Increase reference counting in
PKL_PASS_NODE.
(OP_UNARY_OO): Likewise.
(OP_BINARY_OOI): Likewise.
(OP_BINARY_OOO): Likewise.
(OP_BINARY_SIS): Likewise.
(OP_BINARY_OIO): Likewise.
(OP_BINARY_III): Likewise.
(OP_BINARY_SSS): Likewise.
(OP_BINARY_SSI): Likewise.
(OP_BINARY_AAA_ADD): Likewise.
(pkl_fold_pow): Likewise.
(pkl_fold_bconc): Likewise.
(pkl_fold_ps_cast): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_isa): Likewise.
* libpoke/pkl-trans.c (pkl_trans1_ps_var): Likewise.
(pkl_tarns2_ps_struct_ref): Likewise.
(pkl_trans3_ps_op_sizeof): Likewise.
2024-03-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt_1): Fix
reference counting in synthetized compount statement.
2024-03-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-mmap.c (ios_dev_mmap_open): Avoid using variable
fd uninitialized.
2024-03-30 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Update for 4.0.
* doc/gendocs_template: Likewise.
2024-03-30 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ios.pk: fix print :val.
2024-03-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-fold.c (pkl_fold_ps_cast): Fix integer cast by
adding missing conditional sign-extension operation.
Also fix offset casting to work with negative magnitudes by
using signed division, masking and conditional sign extension.
* libpoke/pkl-gen.pks (offset_cast): Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* testsuite/poke.pkl/cast-integers-20.pk: New test.
* testsuite/poke.pkl/cast-integers-21.pk: Likewise.
* testsuite/poke.pkl/cast-integers-22.pk: Likewise.
* testsuite/poke.pkl/cast-offsets-6.pk: Likewise.
* testsuite/poke.pkl/cast-offsets-7.pk: Likewise.
2024-03-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-mmap.c (ios_dev_mmap_open): Close the opened
file, in case of error.
2024-03-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/Makefile.am (check-DEJAGNU): Set `HOST_OS' env var.
* testsuite/lib/poke-dg.exp (dg-require): Add "no-darwin"
requirement.
* testsuite/poke.cmd/mmap-1.pk: Disable the test on Darwin.
2024-03-15 Andreas Klinger <ak@it-klinger.de>
* testsuite/poke.pickles/jpeg-test.pk: Fix trailing blank.
2024-03-15 Andreas Klinger <ak@it-klinger.de>
* pickles/jpeg.pk: New pickle for jpeg files.
* pickles/Makefile.am (dist_pickles_DATA): Add jpeg.pk.
* testsuite/poke.pickles/jpeg-test.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add jpeg-test.pk.
2024-03-15 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/jojodiff.pk (Jojo_Length2): Add initializer to
constraint.
(Jojo_Length2): Likewise.
(Jojo_Length3): Likewise.
(Jojo_Length5): Likewise.
(Jojo_Length9): Likewise.
(jojo_length_encode): New function to encode length according to
the Jojo format.
(Jojo_EscapedByte): Remove.
(Jojo_Datum): Auxiliary type for `Jojo_Bytes'.
(Jojo_Bytes): Type to describe sequence of data bytes in Jojo
format.
(Jojo_Bytes_Callback): Auxiliary type for `jojo_bytes_map' function.
(jojo_bytes_map): Add function to run the provided callback
for each decoded byte in `Jojo_Bytes'.
(jojo_bytes): Add function to encode bytes as `Jojo_Bytes'.
(Jojo_MOD): Use `Jojo_Bytes' instead of `Jojo_Byte[]'.
(Jojo_INS): Likewise.
(Jojo_MOD.get_count): Update accordingly.
(Jojo_INS.get_count): Likewise.
(Jojo_Hunk): Add `Jojo_Bytes' field to comply with the latest
version of JojoDiff generator.
(Jojo_Hunk_Orig): Add type to describe original format of JojoDiff.
(jojo_patch_from_orig): Add conversion function to transform
from `Jojo_Patch_Orig' to `Jojo_Patch'.
(jojo_patch_apply): Update to support new `Jojo_Patch' and make
verbosity more fine-grained.
* testsuite/poke.pickles/jojodiff-test.pk: Add tests for JojoDiff
pickle.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2024-03-05 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* autogen.sh: Updated by `./bootstrap --bootstrap-sync'.
* autopull.sh: Likewise.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
2024-02-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/lib/poke-unit.h (wait): Rename to `deja_wait'.
2024-02-27 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.libpoke/values.c: Use EXIT_FAILURE instead of 1
as exit status in case of error.
2024-02-27 Hannes Domani <ssbssa@yahoo.de>
* testsuite/poke.libpoke/Makefile.am (COMMON_LDADD): Put
libpoke.la before libgnu.la.
2024-02-27 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize_user): Only use xdg_config_home if it is
not NULL.
2024-02-27 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.libpoke/values.c: Get rid of err.h.
2024-02-27 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Check for runtest instead of dejagnu.h.
* testsuite/lib/poke-uni.h: New file adapted rom dejagnu.h.
* testsuite/Makefile.am (EXTRA_DIST): Add lib/poke-unit.h.
* testsuite/poke.libpoke/Makefile.am (COMMON_CPPFLAGS): Add
$(top_srcdir)/testsuite/lib to the include path.
(COMMON_CFLAGS): It is no more needed to use -fgnu89-inline.
(check_PROGRAMS): These are now built unconditionally.
* testsuite/poke.libpoke/api.c: Include poke-unit.h instead of dejagnu.h.
* testsuite/poke.libpoke/decls.c: Likewise.
* testsuite/poke.libpoke/foreign-iod.c: Likewise.
* testsuite/poke.libpoke/values.c: Likewise.
2024-02-25 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl.c (pkl_resolve_module): Handle failure of `asprintf'.
2024-02-25 Bruno Haible <bruno@clisp.org>
libpoke: Fix compiler warnings re [v]asprintf on AIX (regr. 2024-02-23).
* bootstrap.conf (libpoke_modules): Add back 'vasprintf-posix'.
2024-02-25 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Update entry for 3.90.4.
* doc/gendocs_template: Update version to 3.90.4.
2024-02-25 Jose E. Marchesi <jemarch@gnu.org>
* common/pk-utils.c (pk_str_concat): Assert that first argument
shall not be NULL.
* poke/poke.c (initialize_user): Take care to not use HOME if it
is not defined.
* libpoke/pvm.c: Include assert.h.
* libpoke/ios-dev-sub.c: Likewise.
* poke/pk-ios.c: Likewise.
2024-02-23 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Support --{enable,disable}-{poked,pokefmt} and
print summary at end.
* pokefmt/Makefile.am: Build pokefmt only if ENABLE_POKEFMT.
* poked/Makefile.am: Build poked only if ENABLE_POKED
* man/Makefile.am: Build poked manpages only if ENABLE_POKED.
* etc/hacking.org (Disabling building some components): New
section.
* HACKING: Regenerate.
2024-02-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* run.in (PATH): Add pokefmt/ and poked/ to PATH env var.
2024-02-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c (usock_handler_srv): Do F_GETFL before F_SETFL
on client sockets.
2024-02-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c (errorf): Remove.
(usock_errorf): Adapt `errorf' to accept `struct usock *'
to make the buffer usage implicit. Add more comments.
(usock_handle_srv): Replace `errorf' with `usock_errorf'.
(usock_handle_notif): Likewise.
(usock_serve): Likewise.
2024-02-23 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Add c-vasprintf and
c-vsnprintf gnulib modules.
* libpoke/pvm-wrappers.c: Use c_vaspritnf and c_vsnprintf.
2024-02-22 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-require): New procedure.
* testsuite/poke.cmd/file-mode.pk: Do not use /etc/passwd and
dg-require devnull.
2024-02-22 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Import modules c-strtof and
c-strtod.
* libpoke/pvm.c (pvm_stof): Use c_strtof.
(pvm_stod): Use c_strtod.
2024-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Move prototypes for pvm_stof and pvm_stod from
common/pk-utils.h.
* libpoke/pvm.c (pvm_stof): Move from common/pk-utils.c.
(pvm_stod): Likewise.
2024-02-22 Hannes Domani <ssbssa@yahoo.de>
* libpoke/ios-dev-file.c (ios_dev_file_open): Open files in
binary mode on windows.
2024-02-22 Hannes Domani <ssbssa@yahoo.de>
* poke/pk-repl.c (poke_sigint_handler, pk_repl): Use pthread
functions only if available.
2024-02-21 Hannes Domani <ssbssa@yahoo.de>
* libpoke/pvm.jitter: Undef raise on windows.
2024-02-21 Jose E. Marchesi <jemarch@gnu.org>
* AUTHORS: Add Hannes Domani.
2024-02-20 Hannes Domani <ssbssa@yahoo.de>
* poke/pk-term.c (pk_term_init): Set erase_line_str.
(pk_puts_paged): Use console functions on windows.
2024-02-17 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* bootstrap.conf (gnulib_modules): s/strerror/strerror_r-posix/.
* pokefmt/pokefmt.l (err): Use `strerror_r'.
* poked/poked.c (err): Likewise.
* poked/usock.c (errorf): New function.
(usock_handle_srv): Use `errorf' to make the buffer.
(usock_handle_notif): Likewise.
(usock_serve): Likewise.
2024-02-17 Hannes Domani <ssbssa@yahoo.de>
* poke/poke.c: Don't include <arpa/inet.h> on windows.
2024-02-17 Hannes Domani <ssbssa@yahoo.de>
* poke/pk-term.c (update_screen_dimensions): Define if not availbale.
2024-02-15 Hannes Domani <ssbssa@yahoo.de>
* libpoke/ras: Ignore '\r' of windows line endings.
2024-02-15 Hannes Domani <ssbssa@yahoo.de>
* doc/poke.texi: Mention colon characters in windows drives.
* libpoke/pkl.c: Don't use ':' of windows drives as path separator.
2024-02-15 Bruno Haible <bruno@clisp.org>
Provide an easy way to generate the monolithic HTML-formatted manual.
* doc/Makefile.am (html-monolithic, poke-manual.html): New targets.
(MOSTLYCLEANFILES): Add poke-manual.html.
2024-02-12 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import regex module from
gnulib.
2024-02-12 Jose E. Marchesi <jemarch@gnu.org>,
* doc/poke.texi (Struct Methods): Entry for SELF in concept index.
(Methods): Likewise.
2024-02-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c: Fix GNU code style.
* pokefmt/pokefmt.l: Likewise.
2024-02-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (#include <err.h>): Remove.
(#include <stdarg.h>): Add.
(err): New function.
(errx): Likewise.
* pokefmt/pokefmt.l (#include <err.h>): Remove.
(#include <stdarg.h>): Add.
(err): New function.
(errx): Likewise.
2024-02-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c (usock_handle_notif): Handle `EWOULDBLOCK'
errno.
(usock_serve): Likewise.
2024-02-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* bootstrap.conf (gnulib_modules): Update comment to mention
`pokefmt'.
2024-02-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* bootstrap.conf (gnulib_modules): Add `strerror'.
* poked/usock-buf.c (#include <err.h>): Remove.
* poked/usock.h (USOCK_SERVE_OK): New macro.
(USOCK_SERVE_NOK): Likewise.
(usock_serve): Change signature to return status (success/failure).
(usock_serve_error): New function to retrieve content of error
buffer (`errbuf').
(usock_out_printf): Change return type to `int' and return number
of sent bytes or -1 in case of error.
* poked/usock.c (#include <err.h>): Likewise.
(USOCK_ERRBUF_SIZE): New macro.
(USOCK_HANDLE_SRV_OK): Likewise.
(USOCK_HANDLE_SRV_NOK): Likewise.
(USOCK_HANDLE_NOTIF_OK): Likewise.
(USOCK_HANDLE_NOTIF_NOK): Likewise.
(struct usock): Add new field `errbuf' to save error messages.
(usock_handle_srv): Do not call `err'; fill `errbuf' and return
error.
(usock_handle_notif): Likewise.
(usock_serve): Adapt new signature and in case of error, fill
the `errbuf' and return `USOCK_SERVE_NOK'.
(usock_serve_error): New function.
* poked/poke.c (srvthread): Handle failure of `usock_serve'.
(poked_disas_send): Handle failure of `usock_out_printf'.
2024-02-10 Jose E. Marchesi <jemarch@gnu.org>
* utils/Makefile.am (bin_SCRIPTS): Remove pk-elfextractor.
(EXTRA_DIST): Remove pk-elfextractor.in.
2024-01-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* configure.ac (gl_HOST_CPU_ABI_32BIT): Emit an error instead of
warning when the result is "unknown".
2024-01-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-term.h (pk_compiler): Don't re-typedef `pk_compiler'.
Include "libpoke.h".
2024-01-25 Andreas Klinger <ak@it-klinger.de>
* poke/pk-cmd.h: New command arg type PK_CMD_ARG_UINT
* poke/pk-cmd.c (pk_atou): New function
* poke/pk-cmd-ios.c (pk_cmd_mmap, pk_cmd_sub):
Change base and size to PK_CMD_ARG_UINT
2024-01-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Update --version copyright to
2024.
2024-01-22 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Add entries for 3.90.1.
* doc/gendocs_template (For version): Update to 3.90.1.
2024-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (LTV_CURRENT): Bump to 1.
2024-01-20 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add `poke.pvm/pvm.exp'.
2024-01-20 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (open): Document that IO space identifiers are
allocated sequentially and consistently reused.
2024-01-07 Mark Wielaard <mark@klomp.org>
* etc/pvm-wraps-whitelist: Add __stack_chk_guard.
2023-12-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt): Add location
info to synthesized BCONC assignment statements.
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_asm_stmt): Add location info
to ass-stmt.
(pkl_trans2_ps_incrdecr): Likewise.
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-tab.y (pkl_make_assertion): Fix typo.
(expression): Fix location for unary/binary/ternary
expressions.
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (pkl_ast_format_loc): Change first input
param from `pkl_ast' to `const char *'. Pass filename
directly.
* libpoke/pkl-ast.c (pkl_ast_format_loc): Use the provided
filename and remove the extra ": ".
* libpoke/pkl-gen.c (pkl_gen_ps_func): Adapt.
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.h (struct pkl_gen_payload): Add new field
`filename'.
* libpoke/pkl-gen.c (pkl_gen_ps_src): Populate `filename'
field.
(pkl_gen_pr_program): Likewise.
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h: Fix comment:
s/PKL_AST_COMPOUND_STMT/PKL_AST_COMP_STMT/.
* libpoke/pkl-trans.h (struct pkl_trans_function_ctx): Remove
unnecessary field `next'.
* poke/pk-help.pk (Poke_HelpEntry::is_line_p): Remove extra
semi-colon.
2023-12-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* utils/Makefile.am (bin_SCRIPTS): Add `pk-jojopatch'.
(EXTRA_DIST): Add `pk-jojopatch.in'.
2023-12-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/jojodiff.pk: New pickle for JojoDiff utility.
* pickles/Makefile.am (dist_pickles_DATA): Add `jojodiff.pk'.
* utils/pk-jojopatch.in: New Poke script to apply JojoDiff patches
to files.
* utils/Makefile.am (pk-jojopatch): Add rule for `pk-jojopatch'.
2023-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_print): Change `fprintf' with `fputs'.
2023-12-01 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (struct pk_iod_if): Fix comments by referring to
`PK_IOD_*' return values instead of `IOD_*'.
2023-11-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (pk_make_int): Add new param of type `pk_compiler'.
(pk_make_uint): Likewise.
(pk_make_string): Likewise.
(pk_make_offset): Likewise.
(pk_make_struct): Likewise.
(pk_make_array): Likewise.
(pk_make_integral_type): Likewise.
(pk_make_string_type): Likewise.
(pk_make_any_type): Likewise.
(pk_make_offset_type): Likewise.
(pk_make_struct_type): Likewise.
(pk_make_array_type): Likewise.
* libpoke/pk-val.c (pk_make_int): Likewise.
(pk_make_uint): Likewise.
(pk_make_string): Likewise.
(pk_make_offset): Likewise.
(pk_make_struct): Likewise.
(pk_make_array): Likewise.
(pk_make_integral_type): Likewise.
(pk_make_string_type): Likewise.
(pk_make_any_type): Likewise.
(pk_make_offset_type): Likewise.
(pk_make_struct_type): Likewise.
(pk_make_array_type): Likewise.
(pk_val_offset): Update.
* poke/pk-cmd-help (pk_cmd_help): Likewise.
(pk_cmd_set): Likewise.
* poke/pk-hserver.c (pk_hserver_token_p): Likewise.
(pk_hserver_token_kind): Likewise.
(pk_hserver_cmd): Likewise.
(pk_hserver_function): Likewise.
(pk_hserver_init): Likewise.
(pk_hserver_start): Likewise.
(pk_hserver_make_hyperlink): Likewise.
* poke/poke.c (pk_set_var_int): Likewise.
(set_script_args): Likewise.
(initialize): Likewise.
* poked/poked.c (poked_init): Likewise.
* pokefmt/pokefmt.l (poke_init): Likewise.
* testsuite/poke.libpoke/values.c (test_simple_values): Likewise.
(test_simple_values_mapping): Likewise.
(test_pk_typeof): Likewise.
(main): Pass `pk_compiler' to `test_simple_values',
`test_simple_values_mapping' and `test_pk_typeof'.
2023-11-25 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (endhl): Do not raise exceptions.
(endsc): Likewise.
(pvm_literal_nohyperlink): Remove variable.
* libpoke/pkl-rt.pk (term_end_hyperlink): Adapt accordingly.
(term_end_class): Likewise.
2023-11-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify2_ps_type_array): Sanity check
fixed size bounds.
* testsuite/poke.map/maps-unions-14.pk: Adapt test.
* testsuite/poke.map/maps-unions-15.pk: Likewise.
* testsuite/poke.map/maps-unions-16.pk: Likewise.
* testsuite/poke.pkl/scons-union-14.pk: Likewise.
* testsuite/poke.pkl/scons-union-13.pk: Likewise.
* testsuite/poke.pkl/scons-union-12.pk: Likewise.
* testsuite/poke.pkl/array-siz-diag-2.pk: New test.
* testsuite/poke.pkl/array-siz-diag-3.pk: Likewise.
* testsuite/poke.pkl/array-siz-2.pk: Likewise.
* testsuite/poke.pkl/array-siz-3.pk: Likewise.
* testsuite/poke.pkl/cast-array-siz-diag-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-11-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/orc.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add orc.pk.
2023-11-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.c (hserver_thread_worker): Call
pk_unregister_thread before pthread_exit.
2023-11-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/srec.pk (srec_encode): Create start address records.
2023-11-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_Array): Use BTF_Type_Id for index_type.
2023-11-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (struct pk_term_if): Add `pk_compiler' parameter
to all function pointers.
* libpoke/libpoke.c (include "libpoke.h"): Move to the top.
(libpoke_term_if): Change the type to `struct pk_term_if_internal'.
(pk_compiler_new_with_flags): Populate `libpoke_term_if'.
* libpoke/pkt.h (PKT_IF): New macro to convey the terminal interface
function pointers.
(PK_PKC): New macro to convey the instance of current incremental
compiler.
(pk_*): Re-write the macro definitions to new paradigm.
(struct pk_term_if_internal): New data type.
(libpoke_term_if): Change the type of the variable.
* poke/pk-term.h (pk_puts): Define as a macro.
(pk_term_indent): Likewise.
(pk_term_class): Likewise.
(pk_term_end_class): Likewise.
(pk_term_hyperlink): Likewise.
(pk_term_end_hyperlink): Likewise.
(pk_term_get_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_set_color): Likewise.
(pk_term_set_bgcolor): Likewise.
(pk_term_flush_1): New terminal interface function with `pk_compiler'
parameter.
(pk_puts_1): Likewise.
(pk_printf_1): Likewise.
(pk_term_indent_1): Likewise.
(pk_term_class_1): Likewise.
(pk_term_end_class_1): Likewise.
(pk_term_hyperlink_1): Likewise.
(pk_term_end_hyperlink_1): Likewise.
(pk_term_get_color_1): Likewise.
(pk_term_get_bgcolor_1): Likewise.
(pk_term_set_color_1): Likewise.
(pk_term_set_bgcolor_1): Likewise.
* poke/pk-term.c (pk_term_flush_1): Likewise.
(pk_puts_1): Likewise.
(pk_printf_1): Likewise.
(pk_term_indent_1): Likewise.
(pk_term_class_1): Likewise.
(pk_term_end_class_1): Likewise.
(pk_term_hyperlink_1): Likewise.
(pk_term_end_hyperlink_1): Likewise.
(pk_term_get_color_1): Likewise.
(pk_term_get_bgcolor_1): Likewise.
(pk_term_set_color_1): Likewise.
(pk_term_set_bgcolor_1): Likewise.
(pk_term_flush_1): Likewise.
(pk_puts): Remove.
(pk_term_indent): Likewise.
(pk_term_class): Likewise.
(pk_term_end_class): Likewise.
(pk_term_hyperlink): Likewise.
(pk_term_end_hyperlink): Likewise.
(pk_term_get_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_set_color): Likewise.
(pk_term_set_bgcolor): Likewise.
* poked/poked.c (tif_flush): Add `pk_compiler' parameter.
(tif_puts): Likewise.
(tif_printf): Likewise.
(tif_indent): Likewise.
(tif_class): Likewise.
(tif_class_end): Likewise.
(tif_hlink): Likewise.
(tif_hlink_end): Likewise.
(tif_color): Likewise.
(tif_bgcolor): Likewise.
(tif_color_set): Likewise.
(tif_bgcolor_set): Likewise.
* pokefmt/pokefmt.l (tif_flush): Likewise.
(tif_puts): Likewise.
(tif_printf): Likewise.
(tif_indent): Likewise.
(tif_class): Likewise.
(tif_class_end): Likewise.
(tif_hlink): Likewise.
(tif_hlink_end): Likewise.
(tif_color): Likewise.
(tif_bgcolor): Likewise.
(tif_color_set): Likewise.
(tif_bgcolor_set): Likewise.
* testsutie/poke.libpoke/term-if.h (pk_term_flush): Likewise.
(pk_puts): Likewise.
(pk_printf): Likewise.
(pk_term_indent): Likewise.
(pk_term_class): Likewise.
(pk_term_end_class): Likewise.
(pk_term_hyperlink): Likewise.
(pk_term_end_hyperlink): Likewise.
(pk_term_get_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_set_color): Likewise.
(pk_term_set_bgcolor): Likewise.
2023-11-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* common/pk-utils.h (PK_INTEGRAL_SUFFIX): New macro.
(pk_integral_suffix): Remove function declaration.
(PK_PRINT_BINARY): Remove `use_suffix_p' parameter. And don't print
the suffix.
* common/pk-utils.c (PK_INTEGRAL_SUFFIX): Remove function definition.
* libpoke/pvm-val.c (pvm_print_val_1): Update use of `PK_PRINT_BINARY'
and use `PK_INTEGRAL_SUFFIX'.
* libpoke/pvm.jitter (wrapped-functions): Remove `pk_integral_suffix'.
(PVM_PRINTI): Update use of `PK_PRINT_BINARY'.
(PVM_PRINTL): Likewise.
2023-11-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* common/pk-utils.h (pk_print_binary): Remove function decl.
(PK_PRINT_BINARY): New macro for printing in base 2 to make use of
`pk_puts' macro easier.
* common/pk-utils.c (pk_print_binary): Remove function.
(pk_integral_suffix): New function.
* libpoke/pvm-val.c (pvm_print_val_1): Change `pk_print_binary' to
`PK_PRINT_BINARY'.
* libpoke/pvm.jitter (wrapped-functions):
s/pk_print_binary/pk_integral_suffix/.
(PVM_PRINTI): s/pk_print_binary/PK_PRINT_BINARY/.
(PVM_PRINTL): Likewise.
2023-11-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (pk_set_user_data): New function to register an
opaque data pointer.
(pk_get_user_data): New function to retrieve the registered opaque
data pointer.
* libpoke/libpoke.c (struct _pk_compiler): Add new field `user_data'.
(pk_set_user_data): New function impl.
(pk_get_user_data): Likewise.
* testsuite/poke.libpoke/api.c (main): Add tests for new functions.
2023-11-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_var): Fix detection of
non-methods.
* testsuite/poke.pkl/optcond-pre-13.pk: New test.
* testsuite/poke.pkl/optcond-pre-14.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* pickles/Makefile.am (dist_pickles_DATA): Distribute srec.pk.
* testsuite/poke.pickles/srec-test.pk: New file.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-11-03 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_exception_handler): Fix styling.
2023-11-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (ios_cmd): The option to .ios is optional.
(pk_cmd_ios): Avoid crash when no IO space is
(pk_cmd_file): Fix string.
2023-11-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c: Prepend . to dot-command Usage messages.
* poke/pk-cmd-compiler.c: Likewise.
* poke/pk-cmd-def.c: Likewise.
* poke/pk-cmd-set.c: Likewise.
* poke/pk-cmd-map.c: Likewise.
* poke/pk-cmd-vm.c: Likewise.
2023-11-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (sub_cmd): Use poke_completion_function.
2023-11-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Files as IO Spaces): Document that $<...>
supports specifying a non ambiguous non-empty substring.
2023-11-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios.h: Prototype for ios_get_handler.
* libpoke/ios.c (ios_get_handler): New function.
* libpoke/libpoke.h: Update description of
pk_ios_completion_function.
* libpoke/libpoke.c (pk_ios_completion_function): Complete on IOS
handlers/names, not ids.
* poked/poked.c (poked_autocmpl_send_one): Adapt to new
pk_ios_completion_function.
* poke/pk-repl.c (poke_completion_function): Complete IO space
names.
* testsuite/poke.repl/repl.exp: Update test
tab-completion-subcommand-3.
2023-11-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (ios_completion_function): Remove.
(ios_cmd): Use poke_completion_function.
(close_cmd): Likewise.
* poke/pk-cmd-map.c (info_maps_completion_function): Remove.
(info_maps_cmd): Use poke_completion_function.
2023-11-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_prompt): New function.
(pk_prompt_commented_p): Remove.
* poke/pk-repl.c (pk_prompt): Call the Poke function pk_prompt to
get the prompt string.
* poke/pk-settings.pk (Example): Remove the prompt-commented
setting.
* doc/poke.texi (Changing the Prompt): New sectino
2023-11-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-editor.c (pk_cmd_editor): Stylize the prompt.
2023-11-01 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (pk_ios_search): Add new param: FLAGS to support
partial match of handlers.
* libpoke/libpoke.c (pk_ios_search): Likewise.
* libpoke/ios.h (ios_search): Likewise.
* libpoke/ios.c (ios_search): Likewise.
* poke/pk-ios.c (pk_ios_alien_token_handler): Update to do partial
search for IOS handlers.
* poke/pk-cmd-ios.c (pk_cmd_file): Call `pk_ios_search' with
`PK_IOS_SEARCH_F_EXACT' flag.
(pk_cmd_mem): Likewise.
(pk_cmd_nbd): Likewise.
* testsuite/poke.libpoke/api.c (STREQ): New macro.
(test_pk_ios): New function for testing IO space functions.
(main): Call `test_pk_ios'.
2023-11-01 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-ios.c (pk_ios_alien_token_handler): Fix handling of
alien tokens of length 1, i.e. $<.> tokens.
2023-11-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.h (enum pk_cmd_arg_type): Remove PK_CMD_ARG_TAG.
(PK_CMD_ARG_TAG): Delete.
* poke/pk-cmd.c (pk_cmd_exec_1): Remove handling of tag arguments.
2023-11-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (expr_to_ios): New function.
(pk_cmd_close): Get a Poke expression as an
argument intead of an IOS tag.
(pk_cmd_sub): Likewise.
(pk_cmd_ios): Likewise.
* poke/pk-cmd-map.c (pk_cmd_map_remove): Likewise.
(pk_cmd_map_create): Likewise.
(pk_cmd_map_show): Likewise.
(pk_cmd_map_entry_add): Likewise.
(pk_cmd_map_entry_remove): Likewise.
(pk_cmd_map_load): Likewise.
(pk_cmd_info_maps): Likewise.
* testsuite/poke.cmd/extract-1.pk: Adapt test accordingly.
* testsuite/poke.cmd/close-sub-1.pk: Likewise.
* testsuite/poke.map/ass-map-22.pk: Likewise.
* testsuite/poke.pkl/ios-cur-1.pk: Likewise.
* testsuite/poke.cmd/ios-1.pk: Likewise.
* testsuite/poke.cmd/sub-2.pk: Likewise.
* testsuite/poke.cmd/sub-2.pk: Likewise.
* testsuite/poke.cmd/maps-3.pk: Likewise.
* testsuite/poke.cmd/maps-4.pk: Likewise.
* testsuite/poke.cmd/maps-5.pk: Likewise.
* testsuite/poke.cmd/maps-6.pk: Likewise.
* testsuite/poke.cmd/maps-7.pk: Likewise.
* testsuite/poke.cmd/maps-2.pk: Likewise.
* testsuite/poke.cmd/maps-7.pk: Likewise.
* testsuite/poke.cmd/maps-8.pk: Likewise.
* testsuite/poke.cmd/maps-9.pk: Likewise.
* testsuite/poke.cmd/file-mode.pk: Likewise.
* testsuite/poke.cmd/file-bias-1.pk: Likewise.
* testsuite/poke.cmd/file-bias-2.pk: Likewise.
* testsuite/poke.cmd/file-relative.pk: Likewise.
* doc/poke.texi: Update documentation on IO space tags and ids.
2023-10-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk (pk_help): Hint at activating the page at the
end of the output of `.help'.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-info.pk (pk_info_type): Skip field pretty-printers in
method list and anonymous fields in field list.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* pickles/linux.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Distribute linux.pk.
* pickles/ios.pk (ios_dump_bytes): Always use the IOS of :val if
present.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Field Labels): Document that field labels should
be specified after constraint expressions and initialization field
values.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (pk_cmd_info_type): Get a Poke expression as
the argument for .info type.
* poke/pk-help.pk: Update help of .info type.
* doc/poke.texi (info command): Likewise.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-info.pk (pk_info_type): Style sections.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (dot_cmds): Add compiler_cmd.
(pk_cmd_init): Initialize compiler_trie.
(pk_cmd_shutdown): Free compiler_trie.
* poke/pk-cmd-compiler.c: New file.
* poke/Makefile.am (poke_SOURCES): Add pk-cmd-compiler.c
* libpoke/pkl-ast.c (pkl_ast_format): Initialize the
string_buffer.
* poke/pk-help.pk: Add .help topic for the .compiler command.
* doc/poke.texi (@:.compiler ast): New section.
(compiler command): Likewise.
2023-10-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.h: Prototypes for pkl_debug_p, pkl_set_debug_p and
pkl_get_last_ast_str.
* libpoke/pkl.c (struct pkl_compiler): New fields debug_p and
last_ast_str.
(pkl_new): Initialize debug_p and last_ast_str.
(pkl_debug_p): New function.
(pkl_set_debug_p): Likewise.
(pkl_get_last_ast_str): Likewise.
(pkl_free): Free last_ast_str.
(rest_of_compilation): Save printable representation of the ast if
in debug mode.
* libpoke/libpoke.h: New services pk_set_debug_p and
pk_get_debug_ast.
* libpoke/libpoke.c (pk_set_debug_p): New function.
(pk_get_debug_ast): Likewise.
* libpoke/pkl-ast.h: Add prototype of pkl_ast_format.
* libpoke/pkl-ast.c (pkl_ast_format): New function.
(pkl_ast_print): Rewrite in terms of pkl_ast_format.
(pkl_ast_format_1): Rename from pkl_ast_print_1.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (print_info_ios): Do not style `size' and
`bias' entries as offsets.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk (pk_settings_dump): Do not emit hyperlinks
for setting headers, but style it.
* poke/pk-cmd-set.c (pk_cmd_set_dump): Likewise.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_print_hl): Make it possible to style
hyperlinks.
* pickles/pk-table.pk (PK_Table.print_table): Likewise.
* poke/pk-table.c (pk_table_print): Likewise.
* poke/pk-repl.c (banner): Likewise.
* poke/pk-cmd-set.c (pk_cmd_set_dump): Likewise.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ios.pk (ios_dump_bytes): Restore the proper style in the
ascii area once dump :val is done with the value range.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-repl.c (pk_repl): Emit a styled prompt.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_I_DYN_P): Define.
(struct pkl_ast_type): New field dyn_p in integral types.
* libpoke/pkl-ast.c (pkl_ast_dup_type): Handle dyn_p in integral
types.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-tab.y (dynamic_integral_type_specifier: New rule.
(integral_struct): Accept a dynamic integral type specifier as
itype.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Handle int<*>
and uint<*> as integral struct itypes.
(pkl_typify1_ps_type_integral): Do not check size boundaries at
compile-time for dynamic integral types.
* testsuite/poke.pkl/int-struct-type-diag-16.pk: New test.
* testsuite/poke.pkl/int-struct-type-diag-17.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-18.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-19.pk: Likewise.
* testsuite/poke.pkl/int-struct-dyn-1.pk: Likewise.
* testsuite/poke.pkl/int-struct-dyn-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Integral Structs): Document using int<*> and
uint<*> in integral structs.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/struct-ind-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* pickles/iscan-str.pk: Add usage example.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* pickles/base64.pk: Use std's strchr.
2023-10-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (strstr): New function.
* testsuite/poke.std/std-test.pk: Add tests for strstr.
* doc/poke.texi (strstr): New section.
2023-10-27 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-info.pk (pk_info_type): Do not list computed field
setters and getters nor pretty printers as methods.
2023-10-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/gcov.pk: GCOV_Length now stores length in number of
bytes and not in number of words.
(GCOV_Record): counters use GCOV_Int64, not int<64>.
2023-10-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pickles_DATA): Distribute gcov.pk.
2023-10-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/gcov.pk (GCOV_Version): Allow ' ' as status character.
(GCOV_String): Fix length constraint.
2023-10-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/gcov.pk: New file.
* testsuite/poke.pickles/bmp-test.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-10-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (pokefmt): Fix typo in example code.
(Integral Structs): Add missing map operator.
2023-10-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl.h (pkl_execute_file): Fix comment regarding
EXIT_EXCEPTION.
(pkl_execute_buffer): Likewise.
2023-10-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (pk_load): Add `exit_exception' parameter.
* libpoke/libpoke.c (pk_load): Likewise.
* libpoke/pkl.h (pkl_load): Likewise.
* libpoke/pkl.c (pkl_load): Likewise.
* poke/pk-cmd.c (pk_cmd_init): Call default handler for loading
`pk-cmd' module.
* poke/poke.c (initialize): Update use of `pk_load'.
* pokefmt/pokefmt.l (poke_init): Likewise.
* testsuite/poke.libpoke/api.c (test_pk_load): New function for
`pk_load'-related tests.
(main): Call `test_pk_load'.
2023-10-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (LIBPOKE_NONNULL): New macro for nonnull attribute
for functions.
(pk_compile_file): Use `LIBPOKE_NONNULL'.
(pk_compile_buffer): Likewise.
(pk_compile_buffer_with_loc): Likewise.
(pk_compile_statement): Likewise.
(pk_compile_statement_with_loc): Likewise.
(pk_compile_expression): Likewise.
(pk_compile_expression_with_loc): Likewise.
2023-10-06 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org: List Mohammad-Reza Nabipoor as GNU maintainer.
2023-10-04 Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
* etc/hacking.org (Write After Approval): Update.
* HACKING: Regenerate.
2023-10-04 Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
* etc/nix/default.nix: remove the empty line at the EOF.
2023-10-02 Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
* etc/nix/default.nix: add a simple nix shell.
2023-09-25 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.c (pk_compiler_new_with_flags): Add checks for
presence of user-provided function pointers for the terminal
interface.
* testsuite/poke.libpoke/api.c (test_pk_compiler_new): Update tests.
2023-09-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* etc/hacking.org (Maintainers): Update.
* HACKING: Regenerate.
2023-09-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* configure.ac (AC_CONFIG_FILES): Add `pokefmt/Makefile'.
* Makefile.am (SUBDIRS): Add `pokefmt'.
* pokefmt/pokefmt.l: New template system to embed Poke code in docs,
tests, etc.
* pokefmt/pokefmt.pk: Poke support code for `pokefmt' app.
* pokefmt/Makefile.am: New file.
* run.in (POKEFMTAPPDIR): New variable.
* poke.pokefmt/pokefmt.exp: New tests.
* testsuite/Makefile.am (check-DEJAGNU): Add `POKEFMTAPPDIR' env var.
(EXTRA_DIST): Update.
* doc/poke.texi (pokefmt): Add new chapter.
2023-09-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Accept t and T suffix for uint<1> values.
* libpoke/pkl-rt.pk: Adapt values printer accordingly.
* testsuite/poke.pkl/integers-13.pk: New test.
* testsuite/poke.pkl/integers-14.pk: Likewise.
* testsuite/poke.pkl/integers-15.pk: Likewise.
* testsuite/poke.pkl/integers-16.pk: Likewise.
* testsuite/poke.map/ass-map-19.pk: Update test accordingly.
* testsuite/poke.map/maps-int-structs-11.pk: Likewise.
* testsuite/poke.map/maps-int-structs-6.pk: Likewise.
* testsuite/poke.map/maps-int-union-3.pk: Likewise.
* testsuite/poke.map/maps-int-union-4.pk: Likewise.
* testsuite/poke.map/maps-int-union-5.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-6.pk: Likewise.
* testsuite/poke.pkl/cast-integers-12.pk: Likewise.
* testsuite/poke.pkl/cast-integers-8.pk: Likewise.
* testsuite/poke.pkl/printf-value-15.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Integer Literals): Document suffixes for bit
integer literals.
2023-09-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-diff.pk: Refer to default values of configuration
variables in doc strings as to hold the value "initially" rather
than "currently".
2023-09-16 Jose E. Marchesi <jose.marchesi@oracle.com>
* pickles/Makefile.am (dist_pickles_DATA): Add gpt.pk.
2023-09-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_array_insert): Fix defensive check when
array allocation grows.
* testsuite/poke.pkl/array-3.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-09-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/gpt.pk (GPT_SECTOR_SIZE): Remove.
(GPT_SectorSize): New unit.
(GPT_LBA): New type.
(GPT_Header): Change type of fields to offset when appropriate.
(GPT_Partition_Entry): Likewise.
(GPT): Update.
* testsuite/poke.pickles/gpt-test.pk (tests): Likewise.
2023-09-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/mbr.pk (MBR_SectorSize): New unit.
(MBR_PartitionType): Change it to integral struct.
(MBR_PTE): Change `lba' and `sector_count' to little-endian offset
type. Add `lba_end' method.
(MBR): Mark `signature' and `magic' as little-endian.
* testsuite/poke.pickles/mbr-test.pk (SAMPLE_MBR): New sample data.
("Sample MBR verification"): New test to verify sample data.
2023-09-09 Denis Maryin <des.maryin@googlemail.com>
* pickles/Makefile.am (dist_pickles_DATA): Add new pickles.
* pickles/gpt-partition-attrs.pk: New pickle.
* pickles/gpt-partition-types.pk: Likewise.
* pickles/gpt.pk: Liekwise.
* pickles/guid.pk: Likewise.
* pickles/mbr.pk (MBR_PT_*): New constants.
(MBR_PartitionType): New type.
(MBR_PTE): Use `MBR_PartitionType'.
* testsuite/poke.pickles/gpt-test.pk: New test.
* testsuite/poke.pickles/guid-test.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-09-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-lex.l (NEWLINE): Add `\r\n' sequence to newline
definition.
* doc/poke.texi (The Poke Language): Add a new section `Source Code
Encoding'.
2023-09-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_trimmer): The type of the
result of an array trim is an array bounded by number of elements.
* testsuite/poke.pkl/arrays-17.pk: Adapt test to the new type of
the trimmed value.
* testsuite/poke.pkl/trim-26.pk: Likewise.
* testsuite/poke.pkl/trim-32.pk: Likewise.
2023-09-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Remove PKL_INSN_ATRIM.
* libpoke/pkl-asm.c (pkl_asm_insn_atrim): Delete.
(pkl_asm_insn): Do not handle ATRIM.
* libpoke/pkl-asm.pks (atrim): Move macro from here...
* libpoke/pkl-gen.pks (atrim): ... to here.
2023-09-06 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (elfextractor): Fix example.
2023-08-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-alloc.h (GC_THREADS): New cpp define.
(pvm_alloc_register_thread): Remove `const' qualifier from local var.
2023-08-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-alloc.h: Fix prototypes for
pvm_alloc_{register,unregister}_thread.
2023-08-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ios.pk: Use "closure" hyperlinks to guarantee that they
will work ever if another subsequent dump is issued.
2023-08-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.c (hserver_thread_worker): Register/unregister
listener thread in libpoke.
2023-08-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Prototypes for pk_register_thread and
pk_unregister_threads.
* libpoke/libpoke.c (pk_register_thread): New function.
(pk_unregister_thread): Likewise.
* libpoke/pvm-alloc.h: Prototypes for pvm_alloc_register_thread
and pvm_alloc_unregister_thread.
* libpoke/pvm-alloc.c (pvm_alloc_initialize): Call
GC_allow_register_threads.
(pvm_alloc_register_thread): New function.
(pvm_alloc_unregister_thread): Likewise.
* libpoke/pvm.h: Prototype for pvm_register_thread and
pvm_unregister_thread.
* libpoke/pvm.c (pvm_register_thread): New function.
(pvm_unregister_thread): Likewise.
2023-08-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (pk_dump_max_line_width): New variable.
(dump): Pass val and max_line_width.
Document arguments :val and :max_line_width.
(dumpval): New function.
* doc/poke.texi (Information @command{dump} shows): Document dump
:val.
2023-08-21 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-dark.css (.dump-val1): New class.
(.dump-val2): Likewise.
(.dump-val3): Likewise.
(.dump-val4): Likewise.
* pickles/ios.pk (ios_dumpval_styles): New global.
2023-08-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Fix assigning values to
any[] arrays.
* libpoke/pvm-val.c (pvm_type_equal_p): Handle null[] types
properly.
* testsuite/poke.pkl/ass-22.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-08-20 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Add entries for poke 3.3.
* doc/gendocs_template (For version 3.3): Update version to 3.3.
2023-08-20 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Do not use AC_PROG_CC_C99 with autoconf >= 2.70.
2023-08-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* liboke/ios.c (ios_write_int_common): Fix the function when `bits'
is 16, 24, 32, 40, 48, 56, 64.
* testsuite/poke.map/maps-uint-write-75.pk: New test.
* testsuite/poke.map/maps-uint-write-76.pk: Likewise.
* testsuite/poke.map/maps-uint-write-77.pk: Likewise.
* testsuite/poke.map/maps-uint-write-78.pk: Likewise.
* testsuite/poke.map/maps-uint-write-79.pk: Likewise.
* testsuite/poke.map/maps-uint-write-80.pk: Likewise.
* testsuite/poke.map/maps-uint-write-81.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-07-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (Integral Structs): Update.
2023-07-20 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Scripts): Add missing `open' to example.
2023-07-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_sub): Avoid assert when no name is
specified for the sub IO space.
* testsuite/poke.cmd/sub-1.pk: New test.
* testsuite/poke.cmd/sub-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-07-12 David Faust <david.faust@oracle.com>
* pickles/btf.pk (BTF_KIND_ENUM64): New.
(BTF_KIND_LAST): Update accordingly.
(btf_kind_names): Add "enum64".
(type BTF_Enum64): New type.
(type BTF_Type): Support BTF_Enum64 here.
* pickles/btf-dump.pk (btf_dump_enum64): New function.
(btf_dump_type_vdata): Call it here.
2023-07-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Make sure `@field' is of
type `PKL_AST_STRUCT_TYPE_FIELD' before using the field accessor.
(struct_constructor): Likewise.
2023-07-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_DECL_PREV_DECL): New macro.
(PKL_AST_DECL_REDECL_CHAIN): Likewise.
(struct pkl_ast_decl): New fields.
* libpoke/pkl-ast.c (pkl_type_append_to): Don't report re-declared
names directly (because they contain the a dollar character and
a generation number which are implementation details). Use
user-defined name.
(pkl_ast_node_free_1): Handle `prev_decl' field.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-env.h (pkl_env_commit_renames): New function and
comments.
* libpoke/pkl-env.c (struct pkl_env): Add new field `redecls' to
keep track of re-declarations.
(decl_rollback): New static function.
(env_redecls_free): Likewise.
(register_decl): Add new param `env'. Change the logic of re-naming
for re-declarations.
(pkl_env_free): Handle `redecls'.
(pkl_env_register): Pass `env' to `register_decl'.
(decl_redefined_p): New static function.
(pkl_env_iter_begin): Updated to skip re-defined declarations.
(pkl_env_iter_next): Likewise.
(pkl_env_commit_renames): New function to commit new re-declarations
in the environment.
(pkl_env_rollback_renames): Rewrite to call `env_redecls_free'.
* libpoke/pkl.c (pkl_execute_buffer): Add
`pkl_env_{commit,rollback}_reanmes'.
(pkl_execute_statement): Likewise.
(pkl_compile_expression): Likewise.
(pkl_execute_expression): Likewise.
(pkl_execute_file): Likewise.
* testsuite/poke.pkl/redef-4.pk: New test.
* testsuite/poke.pkl/redef-5.pk: Likewise.
* testsuite/poke.pkl/redef-6.pk: Likewise.
* testsuite/poke.pkl/redef-7.pk: Likewise.
* testsuite/poke.pkl/redef-diag-4.pk: Likewise.
* testsuite/poke.pkl/redef-diag-5.pk: Likewise.
* testsuite/poke.pkl/redef-diag-6.pk: Likewise.
* testsuite/poke.pkl/deftype-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-07-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-env.h (pkl_env_new): Update comment to document
behavior on failure (return `NULL').
(pkl_env_push_frame): Likewise.
(pkl_env_dup_toplevel): Likewise.
* libpoke/pkl-env.c (xalloc.h): Remove include.
(pkl_env_new): Use `calloc' instead of `xzalloc'.
(pkl_env_push): Handle memory error.
(pkl_env_dup_toplevel): Likewise.
* libpoke/pkl.c (pkl_new): Handle memory failures related to
`pkl_env'.
(pkl_execute_buffer): Likewise.
(pkl_execute_statement): Likewise.
(pkl_compile_expression): Likewise.
(pkl_execute_expression): Likewise.
(pkl_execute_file): Likewise.
2023-06-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-ios.c (pk_open_proc_maps): Fix access to uninitialized
memory.
2023-06-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-stream.c (assert.h): Remove.
(ios_dev_stream_flush): Call `fflush' only on `<stdout>'/`<stderr>'
based on IOS flags.
* libpoke/pvm.jitter (flush): Push `PVM_NULL' when there's no error.
* testsuite/poke.pkl/flush-2.pk: New test.
* testsuite/poke.pkl/flush-3.pk: Likewise.
* testsuite/poke.pkl/flush-4.pk: Likewise.
* testsuite/poke.pkl/flush-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-06-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Re-raise an E_conv
from ATOA as an E_constraint.
* testsuite/poke.pkl/ass-19.pk: New test.
* testsuite/poke.pkl/ass-20.pk: Likewise.
* testsuite/poke.pkl/ass-21.pk: Likewise.
* testsuite/poke.pkl/scons-43.pk: Update test.
* libpoke/pkl-asm.pks (asetc): Raise E_constraint instead of
E_conv if the array type boundaries are violated.
* testsuite/poke.pkl/array-siz-diag-1.pk: Update test accordingly.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-06-22 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (From Bytes to Integers): Add missing word.
2023-06-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (asetc): Raise E_constraint and not E_conv
if the new value makes the array to not fulfill its boundary.
2023-06-19 Jose E. Marchesi <jemarch@gnu.org>
2023-06-19 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-val.h (array): New field sct.constructor.
(PVM_VAL_TYP_S_CONSTRUCTOR): Define.
* libpoke/pvm-val.c (pvm_struct_type_constructor): New function.
(pvm_make_struct_type): Get a new `constructor' argument.
* libpoke/pkl-insn.def (PKL_INSN_TYSCTGETC): New instruction.
(PKL_INSN_TYSCTSETC): Likewise.
* libpoke/pk-val.c (pk_make_struct_type): Pass PVM_NULL for
constructor.
* libpoke/pvm-val.c (pvm_make_exception): Likewise.
* libpoke/pvm.jitter (mktysct): Likewise.
(tysctgetc): New instruction.
(tysctsetc): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_type_struct): Install constructor
closure in the created PVM struct type.
(pkl_gen_pr_cons): Converted from pkl_gen_ps_cons.
(pkl_gen_pr_decl): Moving mapper generation after the generation of
constructor.
(pkl_gen_pr_ass_stmt): fix field assignements within methods.
* libpoke/pkl-asm.pks (ssetc): Use run-time consructor closure if
no struct_type AST node is provided.
* testsuite/poke.map/maps-structs-methods-12.pk: New test.
* testsuite/poke.map/maps-structs-methods-13.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-14.pk: Likewise.
* testsuite/poke.pkl/struct-method-20.pk: Likewise.
* testsuite/poke.pkl/struct-method-21.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-05-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_DECL_IN_STRUCT_P): Add comment to
explain the field.
2023-05-24 Constantin Nickel <constantin.nickel@gmail.com>
* libpoke/libpoke.h (pk_compiler_new): Remove leftover comment
about RTPATH argument.
2023-05-23 Constantin Nickel <constantin.nickel@gmail.com>
* common/pk-utils.h: Fix spelling mistakes.
* doc/poke.texi: Likewise.
* libpoke/ios.h: Likewise.
* libpoke/libpoke.h: Likewise.
* libpoke/pkl-ast.h: Likewise.
* libpoke/pkl-promo.c: Likewise.
* libpoke/pkl-rt.pk: Likewise.
* libpoke/pkl.h: Likewise.
* libpoke/pvm-val.h: Likewise.
* libpoke/pvm.jitter: Likewise.
* libpoke/ras: Likewise.
* pickles/pe.pk: Likewise.
* poke/pk-cmd-ios.c: Likewise.
* poke/pk-settings.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-2.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-3.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-4.pk: Likewise.
2023-05-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Perform a LMAP whenever
necessary when assigning to struct fields within methods.
* testsuite/poke.map/setter-1.pk: New test.
* testsuite/poke.map/setter-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-05-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Adjust hack that workarounds bison problem to
field pre-conditions.
* testsuite/poke.pkl/int-union-type-diag-9.pk: Fix test.
2023-05-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (PKL_GEN_PUSH_CONTEXT): Emit error instead of
aborting if maximum nesting level is reached.
* libpoke/pkl-anal.c (PKL_ANAL_PUSH_CONTEXT): Likewise.
* testsuite/poke.pkl/maxnest-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-05-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-env.c (pkl_env_iter_next): Skip re-defined
declarations.
(pkl_env_iter_begin): Likewise.
2023-05-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (check_struct_field_constraint): Get STRICT
as an argument in the stack and use it after executing the
constraint.
(handle_struct_field_constraints): Let
check_struct_field_constraint handle STRICT.
(struct_constructor): Pass a STRICT to
check_struct_field_constraint.
* testsuite/poke.map/nsmap-7.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* doc/poke.texi (Working with Incorrect Data): Document new
behavior.
2023-05-18 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Auto-complete fields foo->bar): New entry.
2023-05-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (find_field_referrer): New function.
2023-05-18 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Alien tokens for IO space names: $<path/to/file>):
Remove as done.
(Auto-complete $<...> in the prompt): New todo.
2023-05-18 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pvm/pvm-insns-test.pk: Add tests for instructions
`sconc', `and', `or', and `not'.
2023-05-18 Jose E. Marchesi <jemarch@gnu.org>a
* libpoke/pkl-promo.c (promote_array): Fix bounded array fast
path.
* testsuite/poke.pkl/promo-array-return-6.pk: New test.
* testsuite/poke.pkl/add-arrays-4.pk: Fix test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-05-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (iosearch): New function.
* testsuite/poke.pkl/iosearch-1.pk: New test.
* testsuite/poke.pkl/iosearch-2.pk: Likewise.
* testsuite/poke.pkl/iosearch-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (iosearch): New section.
2023-05-17 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/ios-2.pk: New test.
* testsuite/poke.cmd/ios-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-ios.c (pk_ios_init): New function.
(pk_ios_shutdown): Likewise.
(pk_ios_alien_token_handler): Likewise.
* poke/poke.c (initialize): Call pk_ios_init.
(finalize): Call pk_ios_shutdown.
2023-05-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Support $<...> alien tokens.
* libpoke/libpoke.c (pk_set_alien_dtoken_fn): New function.
* libpoke/pkl.c (struct pkl_compiler): New field alien_dtoken_fn.
(pkl_alien_dtoken_fn): New function.
(pkl_set_alien_dtoken_fn): Likewise.
2023-05-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Make sure the
destination type of a cast to an array has a bounder.
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Make sure the array
type has a bounder in PKL_GEN_CTX_IN_TYPE context.
* testsuite/poke.pkl/scons-72.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-05-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe.pk (PE_Name): //BASE64 is worse than I thought.
* testsuite/poke.pickles/pe-test.pk: Update.
2023-05-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pickles_DATA): Add base64.pk.
2023-05-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/base64.pk (base64_decode): Simplify.
2023-05-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/base64.pk (base64_decode): Quote characters are optional
as per RFC.
* testsuite/poke.pickles/pe-test.pk: Add tests for optional quote
characters.
* pickles/pe.pk (PE_Nam.get_offset): Simplify accordingly.
2023-05-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/coff.pk (COFF_File): Use pre-condition for optional
field opt_hdr.
2023-05-14 Jose E. Marchesi <jemarch@gnu.org>
* pickles/base64.pk: New file.
* testsuite/poke.pickles/base64-test.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* testsuite/poke.pickles/pe-test.pk: Add tests for PE names
encoding and decoding.
2023-05-14 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pvm/pvm-insns-test.pk: Add tests for subi, subiu,
subl and sublu.
2023-05-14 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pvm/pvm-insns-test.pk: Add tests for gei, geiu,
gel, gelu, ges, lei, leiu, lel, lelu, les, eqc and nec.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Add entries for 3.2.
* doc/gendocs_template (For version 3.2): Update version to 3.2.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pvm/pvm-insns-test.pk: Add tests for cgetn, nn,
nnn, eqi, eqiu, eql, eqlu, eqs, nei, neiu, nel, nelu, nes, lti,
ltiu, ltl, ltlu, lts, gti, gtiu, gtl, gtlu, gts.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_FALLIBLE_UNKNOWN): Define.
(PKL_AST_TYPE_FALLIBLE_YES): Likewise.
(PKL_AST_TYPE_FALLIBLE_NO): Likewise.
(PKL_AST_TYPE_FALLIBLE): Likewise.
(struct pkl_ast_type): New field `fallible'.
* libpoke/pkl-ast.c (pkl_ast_make_type): Initialize newly created
types with unknown fallible.
(pkl_ast_make_integral_type): Initialize fallible.
(pkl_ast_make_string_type): Likewise.
(pkl_ast_make_void_type): Likewise.
(pkl_ast_make_offset_type): Likewise.
(pkl_ast_make_any_type): Likewise.
(pkl_ast_dup_type): Handle fallible.
(pkl_ast_type_is_fallible): New function.
(pkl_ast_print_1): Print fallible.
* libpoke/pkl-typify.c (pkl_typify2_ps_type): Set fallibility of
type nodes.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/rtrace-3.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (RTRACE): New macro.
(rtrace): Call RTRACE.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (rtrace): New section.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def (PKL_INSN_RTRACE): New instruction.
* libpoke/pvm.jitter (PVM_CALL): Push the caller's name in the
returnstack.
(return): Drop the caller's name from the returnstack.
(rtrace): New instruction.
* libpoke/pkl-rt.pk (rtrace): New function.
* testsuite/poke.pkl/rtrace-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* etc/poke.rec (PVM stack traces): Remove as done.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_VAL_CLS_NAME): Define.
(struct pvm_cls): New field `name'.
* libpoke/pvm-val.c (pvm_make_cls): Get a a `name' argument.
* libpoke/pkl-insn.def (PKL_INSN_CGETN): New instruction.
* libpoke/pvm.jitter (duc): Specify a name in pvm_make_cls.
(cgetn): New instruction.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Likewise.
(pkl_gen_ps_lambda): Likewise.
(pkl_gen_pr_type_function): Likewise.
* libpoke/ras: Likewise.
* libpoke/pkl-rt.pk (_pkl_print_format_any): Print closure names.
* testsuite/poke.pkl/clsname-1.pk: New test.
* testsuite/poke.pkl/arrays-15.pk: Update test.
* testsuite/poke.pkl/funcall-17.pk: Likewise.
* testsuite/poke.pkl/ios-hook-close-pre-2.pk: Likewise.
* testsuite/poke.pkl/scons-59.pk: Likewise.
* testsuite/poke.pkl/struct-method-17.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_PEEK): Do not raise exceptions.
(peeki): Update description and remove branching jitter tag.
(peekiu): Likewise.
(peekl): Likewise.
(peeklu): Likewise.
(peekdi): Likewise.
(peekdiu): Likewise.
(peekdl): Likewise.
(peekdlu): Likewise.
(peeks): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_type_integral): Check and handler
exceptions by peek* instructions.
(pkl_gen_ps_type_string): Likewise.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (close): Do not raise exceptions.
(flush): Likewise.
* libpoke/pkl-rt.pk (close): Adapt accordingly.
(flush): Likewise.
* testsuite/poke.pkl/flush-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-05-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_MAKE_DFL_EXCEPTION): Define.
(PVM_POKE): Do not raise exceptions.
(pokei): Update description and remove branching jitter tag.
(pokeiu): Likewise.
(pokel): Likewise.
(pokelu): Likewise.
(pokedi): Likewise.
(pokediu): Likewise.
(pokedl): Likewise.
(pokedlu): Likewise.
(pokes): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_type_integral): Check and handler
exceptions by poke* instructions.
(pkl_gen_ps_type_string): Likewise.
2023-05-07 Patrick Trottier <code@algolibre.net>
Various fixes in the manual.
2023-05-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Fix check for non-null
field name.
* testsuite/poke.pkl/ass-18.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-04-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios.h (ios_context): New type.
(ios_init): Returns `ios_context`.
(ios_shutdown): Add new `ios_context` param.
(ios_open): Likewise.
(ios_close): Likewise.
(ios_cur): Likewise.
(ios_set_cur): Likewise.
(ios_search): Likewise.
(ios_search_by_id): Likewise.
(ios_begin): Likewise.
(ios_map): Likewise.
(ios_register_foreign_iod): Likewise.
(ios_foreign_iod): Likewise.
* libpoke/ios-dev-sub.c (ios_dev_sub_open): Update.
* libpoke/ios.c (struct ios): Mark `dev_if' as const.
(struct ios_context): Add new field `foreign_dev_if'.
(IOS_DEV_IF_DATA): Remove macro.
(IOS_DEV_ZERO): New constant.
(IOS_DEV_MEM): Likewise.
(IOS_DEV_STREAM): Likewise.
(IOS_DEV_NBD): Likewise.
(IOS_DEV_PROC): Likewise.
(IOS_DEV_SUB): Likewise.
(IOS_DEV_FILE): Likewise.
(ios_dev_ifs): Update.
(ios_ctx): Remove.
(ios_dev_ifs_count): New constant.
(ios_context_data): New internal function.
(ios_init): Returns `ios_context'.
(ios_shutdown): Add new `ios_context' param.
(ios_open): Likewise.
(ios_close): Likewise.
(ios_cur): Likewise.
(ios_set_cur): Likewise.
(ios_search): Likewise.
(ios_search_by_id): Likewise.
(ios_begin): Likewise.
(ios_map): Likewise.
(ios_foreign_iod): Likewise.
(ios_register_foreign_iod): Likewise.
* libpoke/pvm.h (pvm_ios_context): New function.
* libpoke/pvm.c (pvm_ios_context): Likewise.
(PVM_STATE_IOS_CONTEXT): New macro.
(pvm_init): Add IOS initialization.
(pvm_shutdown): Add IOS finalization.
* libpoke/libpoke.c (struct _pk_compiler): Add `struct ios_dev_if`
for foreign IOD.
(pk_ios_completion_function): Update to use `ios_context'.
(pk_ios_cur): Likewise.
(pk_ios_set_cur): Likewise.
(pk_ios_search): Likewise.
(pk_ios_search_by_id): Likewise.
(pk_ios_open): Likewise.
(pk_ios_close): Likewise.
(pk_ios_map): Likewise.
(foreign_iod_if): Remove global variable.
(pk_register_iod): Rely on `pk_compiler' fields instead of global
variable. Use `ios_context'.
* libpoke/pvm.jitter (state-struct-backing-c): Add new
field `ios_context'.
(state-initialization-c): Initialize new field.
(PVM_PEEK): Update to use IOS context.
(PVM_POKE): Likewise.
(open): Likewise.
(close): Likewise.
(flush): Likewise.
(pushios): Likewise.
(popios): Likewise.
(ioflags): Likewise.
(iosize): Likewise.
(ionum): Likewise.
(ioref): Likewise.
(iohandler): Likewise.
(iogetb): Likewise.
(iosetb): Likewise.
(peeks): Likewise.
(pokes): Likewise.
2023-04-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios.h (ios_get_dev_if): Add declaration.
(ios_get_dev): Likewise.
* libpoke/ios.c (ios_get_dev_if): Add `const' to function def.
* libpoke/ios-dev.h (ios_dev_if): Likewise.
2023-04-29 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev.h (struct ios_dev_if): Remove `data' field.
* libpoke/ios.h (ios_register_foreign_iod): Add new param: `data'.
* libpoke/ios.c (struct ios_context): New struct to put all
global states in one place.
(IOS_DEV_IF_DATA): New macro.
(ios_ctx): An instance of `struct ios_context' which contains
all global states.
(ios_shutdown): Adapt to use `ios_ctx' global variable.
(ios_open): Likewise.
(ios_close): Likewise.
(ios_cur): Likewise.
(ios_set_cur): Likewise.
(ios_search): Likewise.
(ios_search_by_id): Likewise.
(ios_set_bias): Likewise.
(ios_map): Likewise.
(ios_register_foreign_iod): Use new param.
* libpoke/libpoke.c (pk_register_iod): Update.
2023-04-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios.h (ios_zombie_p): Fix typo in function declaration.
2023-04-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_free): Remove unused variable.
2023-04-29 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios.h (ios_inc_sub_dev): New function to track sub
IO spaces.
(ios_dec_sub_dev): Likewise.
(ios_zombie_p): New function.
* libpoke/ios.c (struct ios): Add new fields `zombie_p` and
`num_sub_devs'.
(ios_inc_sub_dev): New function definition.
(ios_dec_sub_dev): Likewise.
(ios_zombie_p): Likewise.
(ios_open): Initialize new fields.
(ios_close): Instead of deallocating the IOS, it becomes a zombie,
if there's at least one sub-device that using this IOS.
* libpoke/ios-dev-sub.c (struct ios_dev_sub): Use `ios' instead of
ios id.
(ios_dev_sub_open): Update to track base IOS.
(ios_dev_sub_close): Likewise.
(ios_dev_sub_pread): Use base IOS directly instead of searching
using id.
(ios_dev_sub_pwrite): Likewise.
* testsuite/poke.pkl/open-sub-19.pk: New test.
* testusite/poke.pkl/open-sub-20.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-04-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (format_arg_list): Reworked to avoid code
duplication.
2023-04-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_module_loaded_p): Remove function.
(pkl_add_module): Likewise.
* libpoke/pkl.h: ... and prototypes.
* libpoke/pkl.c (struct pkl_compiler): Remove `modules' and
`num_modules' fields.
(pkl_new): Do not initialize these.
(pkl_free): Do not dispose memory for these.
* libpoke/pkl-tab.y (load_module): Do not call pkl_add_module.
2023-04-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_load): Allow loading modules more than once.
* libpoke/libpoke.h: Document this behavior.
2023-04-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (pk_load): Fix returned value.
* poke/pk-cmd.c (pk_cmd_init): Fix call to pk_load.
* poke/poke.c (initialize): Likewise.
2023-04-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Prototype for pk_keyword_p.
* libpoke/libpoke.c (pk_keyword_p): New function.
* libpoke/Makefile.am: Generate $(srcdir)/pkl-keywords.def.
* testsuite/poke.libpoke/api.c (test_pk_keyword_p): New test.
* .gitignore: Add /libpoke/pkl-keywords.def.
2023-04-25 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.std/std-test.pk: Do not use "standard" types.
2023-04-25 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-pk.exp (tap_execute): Pass --no-stdtypes to
poke.
* pickles/asn1-ber.pk: Do not use "standard" types.
* pickles/bmp.pk: Likewise.
* pickles/color.pk: Likewise.
* pickles/id3v2.pk: Likewise.
* pickles/id3v1.pk: Likewise.
* pickles/ieee754.pk: Likewise.
* pickles/leb128.pk: Likewise.
* pickles/mbr.pk: Likewise.
* pickles/openpgp.pk: Likewise.
* pickles/jffs2.pk: Likewise.
* pickles/pdap.pk: Likewise.
* pickles/pcap.pk: Likewise.
* pickles/riscv.pk: Likewise.
* testsuite/poke.pickles/mbr-test.pk: Likewise.
* testsuite/poke.pickles/uuid-test.pk: Likewise.
* testsuite/poke.pickles/search-test.pk: Likewise.
2023-04-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Use pk_compiler_new_with_flags.
(NO_STDTYPES_ARG): Define.
(parse_args_1): Handle NO_STDTYPES_ARG.
(parse_args_2): Likewise.
* poke/pk-hserver.pk: Do not use standard types.
* poke/pk-settings.pk: Likewise.
* poke/pk-dump.pk: Likewise.
* poke/pk-copy.pk: Likewise.
* poke/pk-save.pk: Likewise.
* poke/pk-scrabble.pk: Likewise.
* poke/pk-diff.pk: Likewise.
* pickles/diff.pk: Likewise.
2023-04-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk: Do not use "standard" types.
* pickles/btf.pk: Likewise.
* pickles/sframe.pk: Likewise.
* pickles/time.pk: Likewise.
* pickles/coff.pk: Likewise.
* pickles/pe.pk: Likewise.
* pickles/ustar.pk: Likewise.
* pickles/pktest.pk: Likewise.
* pickles/redoxfs.pk: Likewise.
* pickles/ios.pk: Likewise.
* pickles/argp.pk: Likewise.
2023-04-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-attrs.def: New attribute 'ref.
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Handle 'ref.
* libpoke/pkl-anal.c (pkl_anal1_ps_op_attr): Likewise.
* libpoke/pkl-promo.c (pkl_promo_ps_op_attr): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_op_attr): Likewise.
* libpoke/pkl-gen-attrs.pks (attr_ref): New macro.
* doc/poke.texi (Offset Attributes): Document the 'ref attribute.
* testsuite/poke.pkl/attr-ref-diag-1.pk: New test.
* testsuite/poke.pkl/attr-ref-diag-2.pk: Likewise.
* testsuite/poke.pkl/attr-ref-diag-3.pk: Likewise.
* testsuite/poke.pkl/attr-ref-diag-4.pk: Likewise.
* testsuite/poke.pkl/attr-ref-1.pk: Likewise.
* testsuite/poke.pkl/attr-ref-2.pk: Likewise.
* testsuite/poke.pkl/attr-ref-3.pk: Likewise.
* testsuite/poke.pkl/attr-ref-4.pk: New test.
* testsuite/poke.pkl/attr-ref-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-03-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_STRUCT_REF_INDIRECTION_P): Define.
(struct pkl_ast_struct_ref): New field indirection_p.
* libpoke/pkl-tab.y: New token IND.
(primary): New rule for indirecting struct fields.
* libpoke/pkl-lex.l: Recognize token IND.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_ref): Handle
indirected struct references.
* libpoke/pkl-trans.c (pkl_trans2_ps_struct_ref): Transform
indirected struct references into mapping operations.
* libpoke/pkl-gen.c (pkl_gen_ps_struct_ref): Support indirections.
(pkl_gen_pr_ass_stmt): Likewise.
* testsuite/poke.pkl/struct-ind-diag-1.pk: New test.
* testsuite/poke.pkl/struct-ind-diag-2.pk: Likewise.
* testsuite/poke.pkl/struct-ind-diag-3.pk: Likewise.
* testsuite/poke.pkl/struct-ind-diag-4.pk: Likewise.
* testsuite/poke.pkl/struct-ind-1.pk: Likewise.
* testsuite/poke.pkl/struct-ind-2.pk: Likewise.
* testsuite/poke.pkl/struct-ind-3.pk: Likewise.
* testsuite/poke.pkl/struct-ind-4.pk: Likewise.
* testsuite/poke.pkl/ass-ind-1.pk: Likewise.
* testsuite/poke.pkl/ass-ind-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (struct pkl_ast_type): New field ref_type in
offset types.
(PKL_AST_TYPE_O_REF_TYPE): Define.
* libpoke/pkl-ast.c (pkl_ast_make_offset_type): Get a ref_type
argument.
(pkl_ast_node_free_1): Free ref_type.
(pkl_ast_print_1): Print ref_type.
(pkl_type_append_to): Include ref_type in printed representation.
(pkl_ast_type_equal_p): Handle referred types.
* libpoke/pkl-tab.y (ref_type): New rule.
* libpoke/pkl-typify.c: Pass ref_type argument to calls to
pkl_ast_make_offset_type.
* libpoke/pkl-promo.c (promote_offset): Likewise.
* libpoke/pkl-trans.c: Likewise.
* libpoke/pkl-promo.c (promote_offset): Handle ref_type.
(promote_node): Likewise.
* libpoke/pkl-pass.c (pkl_do_pass_1): Traverse ref_type in offset
type nodes.
* libpoke/pkl-lex.l: Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_offset): Use ref_type.
* libpoke/pkl-rt.pk (_pkl_print_format_any): Print ref_type in
offset types.
* libpoke/pvm-val.h (PVM_VAL_TYP_O_REF_TYPE): Define.
* libpoke/pvm-val.c (pvm_make_offset_type): Get an argument
ref_type.
* libpoke/pvm.jitter (tyosetrt): New instruction.
(tyogetrt): Likewise.
* libpoke/pkl-insn.def: New instructions PKL_INSN_TYOSETRT and
PKL_INSN_TYOGETRT.
* libpoke/pk-val.c (pk_make_offset_type): Likewise.
* doc/poke.texi (Offset Types): Document referred types in offset
types.
* testsuite/poke.pkl/offset-type-2.pk: New test.
* testsuite/poke.pkl/print-any-4.pk: Likewise.
* testsuite/poke.pkl/add-offset-11.pk: Likewise.
* testsuite/poke.pkl/sub-offsets-9.pk: Likewise.
* testsuite/poke.pkl/mul-offsets-12.pk: Likewise.
* testsuite/poke.pkl/div-offsets-5.pk: Likewise.
* testsuite/poke.pkl/bnot-offsets-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (struct pkl_ast_type): New field ref_type in
offset types.
(PKL_AST_TYPE_O_REF_TYPE): Define.
* libpoke/pkl-ast.c (pkl_ast_make_offset_type): Get a ref_type
argument.
(pkl_ast_node_free_1): Free ref_type.
(pkl_ast_print_1): Print ref_type.
(pkl_type_append_to): Include ref_type in printed representation.
(pkl_ast_type_equal_p): Handle referred types.
* libpoke/pkl-tab.y (ref_type): New rule.
* libpoke/pkl-typify.c: Pass ref_type argument to calls to
pkl_ast_make_offset_type.
* libpoke/pkl-promo.c (promote_offset): Likewise.
* libpoke/pkl-trans.c: Likewise.
* libpoke/pkl-promo.c (promote_offset): Handle ref_type.
(promote_node): Likewise.
* libpoke/pkl-pass.c (pkl_do_pass_1): Traverse ref_type in offset
type nodes.
* libpoke/pkl-lex.l: Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_offset): Use ref_type.
* libpoke/pkl-rt.pk (_pkl_print_format_any): Print ref_type in
offset types.
* libpoke/pvm-val.h (PVM_VAL_TYP_O_REF_TYPE): Define.
* libpoke/pvm-val.c (pvm_make_offset_type): Get an argument
ref_type.
* libpoke/pvm.jitter (tyosetrt): New instruction.
(tyogetrt): Likewise.
* libpoke/pkl-insn.def: New instructions PKL_INSN_TYOSETRT and
PKL_INSN_TYOGETRT.
* libpoke/pk-val.c (pk_make_offset_type): Likewise.
* doc/poke.texi (Offset Types): Document referred types in offset
types.
* testsuite/poke.pkl/offset-type-2.pk: New test.
* testsuite/poke.pkl/print-any-4.pk: Likewise.
* testsuite/poke.pkl/add-offset-11.pk: Likewise.
* testsuite/poke.pkl/sub-offsets-9.pk: Likewise.
* testsuite/poke.pkl/mul-offsets-11.pk: Likewise.
* testsuite/poke.pkl/div-offsets-5.pk: Likewise.
* testsuite/poke.pkl/bnot-offsets-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-04-21 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-tab.y (primary): Remove typification of `format'.
Remove unnecessary `PKL_AST_LOC' invocations.
* libpoke/pkl-typify.c (pkl_typify1_ps_format): Typify the `format'.
2023-04-17 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Add entries for 3.1.
* doc/gendocs_template (For version 3.1): Bump version to 3.1.
* libpoke/Makefile.am (pvm-vm.h): Remove dependency on $(JITTER).
2023-04-17 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Continuous Integration): Update.
* HACKING: Regenerate.
2023-04-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (Integral Structs): s/little-endian/big-endian/
when talking about how gcc encodes bit fields.
2023-03-28 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec: Remove priority fields.
2023-03-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* common/pk-utils.h (pvm_stof): New declaration.
(pvm_stod): Likewise.
* common/pk-utils.c (pvm_stof): Definition of string to `float'
conversion function.
(pvm_stod): Definition of string to `double' conversion function.
* libpoke/pkl-insn.def (PKL_INSN_STOF): New instruction.
(PKL_INSN_STOD): Likewise.
* libpoke/pvm.jitter (wrapped-functions): Add `pvm_stof' and
`pvm_stod'.
(stof): New instruction to convert string to float32 number
represented as a `uint<32>'.
(stod): New instruction to convert string to float64 number
represented as a `uint<64>'.
* libpoke/std.pk (stof): New function to wrap `stof' instruction.
(stod): Likewise.
* testsuite/poke.pvm/pvm-insns-test.pk (tests): Add entries for
`stof' and `stod'.
* testsuite/poke.std/std-test.pk (tests): Likewise.
2023-03-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (push32): Fix printers.
2023-03-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (pushlo): Remove.
(pushhi): Likewise.
(push32): Changed to accept two arguments.
* libpoke/pvm-program.c (pvm_program_append_push_instruction):
Adapt accordingly.
2023-03-16 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support #foo within string literals): New bug.
2023-03-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_cast): Fix memory leak.
2023-03-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_type_any): Construct a value 0 for
values of type `any'.
* testsuite/poke.pkl/scons-71.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-03-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_OIO): Support units 0.
* testsuite/poke.pkl/mul-offsets-11.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-03-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (Poking a SBM Image :: Saving the Image): Fix
the example.
2023-02-27 Frederic Cambus <fred@statdns.com>
* INSTALL: Remove section about building the GUI.
2023-02-20 Jose E. Marchesi <jemarch@gnu.org>
* pickles/iscan.pk: New file.
* pickles/iscan-str.pk: Likewise.
* pickles/Makefile.am (dist_pickles_DATA): Add iscan.pk and
iscan-str.pk.
* testsuite/poke.pickles/iscan-test.pk: New testsuite.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-02-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Use pvm_strcat instead of strcat.
2023-02-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.c (pkl_asm_insn_cmp): Support values of type
any.
* testsuite/poke.pkl/eq-any-array-3.pk: New test.
* testsuite/poke.pkl/neq-array-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-02-19 Bruno Haible <bruno@clisp.org>
build: Regenerate pvm-vm.h, pvm-vm1.c, pvm-vm2.c when jitter has changed.
* libpoke/Makefile.am (generate-vm-files): When cross-compiling, don't
fail, just emit a warning.
(pvm-vm.h): Depend also on $(JITTER).
2023-02-19 Bruno Haible <bruno@clisp.org>
Allow accessing the installed files in a Cygwin-based mingw environment.
* bootstrap.conf (gnulib_modules, libpoke_modules): Add configmake.
* libpoke/Makefile.am (libpoke_la_CPPFLAGS): Don't define PKGDATADIR.
* libpoke/libpoke.c: Instead, include configmake.h.
* libpoke/pkl.c: Likewise.
* poke/Makefile.am (poke_CPPFLAGS): Don't define PKGDATADIR.
* poke/pk-map.c: Instead, include configmake.h.
* poke/pk-term.c: Likewise.
* poke/poke.c: Likewise.
* poked/Makefile.am (poked_CPPFLAGS): Remove useless -I options. Don't
define PKGDATADIR. Add -I options to find the common gl/ directories.
* poked/poked.c: Include configmake.h.
* testsuite/poke.libpoke/Makefile.am (COMMON_CPPFLAGS): Don't define
PKGDATADIR.
2023-02-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def (asettb): Remove instruction.
(tyasetb): New instruction.
* libpoke/pvm.jitter (asettb): Remove.
(tyasetb): New instruction to update the array's type bounder.
* libpoke/pkl-asm.c (pkl_asm_insn_atoa): Use new instruction.
* libpoke/pkl-asm.pks (array_conv_sel): Likewise.
(array_conv_siz): Likewise.
2023-02-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-asm.c (pkl_asm_insn_atoa): Do not use `PVM_NULL' as
the bounder in the type of array. Use a closure that returns
`PVM_NULL'.
* testsuite/poke.pkl/cast-array-8.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-02-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-globals): Remove
`pvm_literal_inval_obase'.
(late-c): Likewise.
2023-02-15 Hannes Domani <ssbssa@yahoo.de>
* poke/pk-map-lex.l: Rename ERROR to ERR.
* poke/pk-map-tab.y: Likewise.
2023-02-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* common/pk-utils.h (pk_unreachable): New function declaration.
(PK_UNREACHABLE): Changed the macro to use `pk_unreachable'.
* common/pk-utils.c (pk_unreachable): New function definition.
2023-02-14 Hannes Domani <ssbssa@yahoo.de>
* pickles/pe.pk: Add size_of_stack_reserve.
2023-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-parser.h (struct pkl_parser): New field `toplevel'.
* libpoke/pkl-parser.c (pkl_parse_buffer): Set a longjmp return
point for out-of-memory and other recoverable error conditions.
(pkl_parse_file): Likewise.
* libpoke/pkl-lex.l (YY_FATAL_ERROR): Longjump to parser->toplevel
instead of aborting.
2023-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-builtins.pks: Remove.
* libpoke/Makefile.am (libpoke_la_SOURCES): Update accordingly.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_TERM_GET_COLOR): Remove.
(PKL_AST_BUILTIN_TERM_SET_COLOR): Likewise.
(PKL_AST_BUILTIN_TERM_GET_BGCOLOR): Likewise.
(PKL_AST_BUILTIN_TERM_SET_BGCOLOR): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Do not handle
builtins.
* libpoke/pkl-lex.l: Remove rules for
__PKL_BUILTIN_TERM_{GET,SET}_[BG]COLOR__ tokens.
* libpoke/pkl-tab.y (builtin): Remove rule.
* libpoke/pkl-rt.pk (term_get_color): Rewrite using inline asm.
(term_get_bgcolor): Likewise.
(term_set_color): Likewise.
(term_set_bgcolor): Likewise.
2023-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (union_deintegrator): Remove unused
variable.
2023-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (ais): Rewrite.
(eqa): Do not revert argument arrays.
* testsuite/poke.pkl/in-10.pk: New test.
* testsuite/poke.pkl/in-11.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* common/pk-utils.h: Include assert.h.
* libpoke/libpoke.c: Do not include assert.h.
* poke/pk-cmd.c: Likewise.
* poke/pk-ios.c: Likewise.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.c (pkl_asm_insn): Remove reference to
pkl_asm_insn_oto.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Remove instruction PKL_INSN_OTO.
* libpoke/pkl-asm.c (pkl_asm_insn_oto): Remove.
(pkl_asm_insn): Do not handle PKL_INSN_OTO.
* libpoke/pkl-asm.pks: Move RAS_MACRO_OFFSET_CAST from here..
* libpoke/pkl-gen.pks: ... to here.
* libpoke/pkl-gen.c (pkl_gen_pr_cast): Use RAS_MACRO_OFFSET_CAST.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-attrs.pks (attr_size): Use mkoq.
(attr_offset): Likewise.
(attr_eoffset): Likewise.
(attr_esize): Likewise.
* libpoke/pkl-gen.pks (emit_tv_field_event): Likewise.
(struct_mapper): Likewise.
(struct_constructor): Likewise.
(struct_field_extractor): Create offset type explicitly.
(deint_extract_field_value): Likewise.
(union_deintegrator): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_offset): Create offset type
explicitly.
(pkl_gen_ps_offset): Likewise.
(pkl_gen_ps_op_div): Likewise.
* libpoke/pkl-asm.c (pkl_asm_insn_binop): Use mkoq instead of mko.
* libpoke/pkl-asm.pks (addo): Likewise.
(subo): Likewise.
(mulo): Likewise.
(modo): Likewise.
(offset_cast): Likewise.
* libpoke/pkl-insn.def (PKL_INSN_MKOQ): New instruction.
* libpoke/pvm.jitter (mkoq): New instruction.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_VAL_OFF_UNIT): Remove.
(PVM_VAL_OFF_BASE_TYPE): Likewise.
* libpoke/pvm-val.c (pvm_make_offset): Get an offset type as an
argument.
(pvm_typeof): Adjust accordingly.
(pvm_val_equal_p): Likewise.
(pvm_print_val_1): Likewise.
* libpoke/pvm.jitter (iosetb): Likewise.
(ogetu): Likewise.
(ogetbt): Likewise.
(iosize): Likewise.
(iogetb): Likewise.
* libpoke/pk-val.c (pk_offset_unit): Likewise.
(pk_val_set_offset): Likewise.
(pk_make_offset): Likewise.
(pk_val_offset): Likewise.
* libpoke/pkl-asm.c (pkl_asm_new): Remove old code involving the
IO base register.
2023-02-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (mktyo): Get the unit of the offset as an
ulong instead of an int.
2023-02-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_Header): Add constraint to check hdr_len.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_BINOP_SL): Remove macro.
(bsli): Use PVM_BINOP.
(bsliu): Likewise.
(bsll): Likewise.
(bsllu): Likewise.
* libpoke/pkl-asm.c (pkl_asm_insn_binop): Check for UB in SL
instructions and raise exception consequently.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (vm_set_obase): Check for valid values.
(vm_set_omode): Likewise.
* libpoke/pvm.jitter (popob): Do not raise exceptions.
(popom): Likewise.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.c (pkl_asm_insn_binop): Check for division by
zero before div and mod.
* libpoke/pvm.jitter (PVM_CHECKED_BINOP): Remove macro.
(divi): Do not raise division by zero exception.
(diviu): Likewise.
(divl): Likewise.
(divlu): Likewise.
(modi): Likewise.
(modiu): Likewise.
(modl): Likewise.
(modlu): Likewise.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_NEG_SIGNED): Do not check for overflow.
(negi): Remove jitter `branching' annotation, and use PVM_UNOP.
(negl): Likewise.
(addi): Likewise.
(addl): Likewise.
(subi): Likewise.
(subl): Likewise.
(muli): Likewise.
(mull): Likewise.
(divi): Likewise.
(divl): Likewise.
(modi): Likewise.
(modl): Likewise.
(powi): Likewise.
(powl): Likewise.
(PVM_NEG_SIGNED): Remove macro.
(PVM_ADD_SIGNED): Likewise.
(PVM_SUB_SIGNED): Likewise.
(PVM_MUL_SIGNED): Likewise.
(PVM_DIV_SIGNED): Likewise.
(PVM_MOD_SIGNED): Likewise.
(PVM_POWOP_SIGNED): Likewise.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.c (pkl_asm_insn_binop): Check for signed
overflow whenever appropriate.
(pkl_asm_insn): Handle signed overflow macro-instructions.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def (PKL_INSN_NEGOF): New macro-instruction.
(PKL_INSN_ADDOF): Likewise.
(PKL_INSN_SUBOF): Likewise.
(PKL_INSN_MULOF): Likewise.
(PKL_INSN_DIVOF): Likewise.
(PKL_INSN_MODOF): Likewise.
(PKL_INSN_POWOF): Likewise.
* libpoke/pkl-asm.c (pkl_asm_insn_binop): Add support for integer
overflow checking instructions.
2023-02-07 Indu Bhagat <indu.bhagat@oracle.com>
* pickles/sframe.pk: Use camel casing for types consistently.
* pickles/sframe-dump.pk: Likewise.
2023-02-07 Indu Bhagat <indu.bhagat@oracle.com>
* pickles/sframe.pk: Update the pickle for AArch64 PAuth
support.
2023-02-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (addiof): New instruction.
(addlof): Likewise.
(subiof): Likewise.
(sublof): Likewise.
(muliof): Likewise.
(mullof): Likewise.
(diviof): Likewise.
(divlof): Likewise.
(modiof): Likewise.
(modlof): Likewise.
(negiof): Likewise.
(neglof): Likewise.
(powiof): Likewise.
(powlof): Likewise.
* testsuite/poke.pvm/pvm-insns-test.pk (addiof): New test.
(addlof): Likewise.
(subiof): Likewise.
(sublof): Likewise.
(muliof): Likewise.
(mullof): Likewise.
(diviof): Likewise.
(divlof): Likewise.
(modiof): Likewise.
(modlof): Likewise.
(negiof): Likewise.
(neglof): Likewise.
(powiof): Likewise.
(powlof): Likewise.
2023-02-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/search.pk (search_type): Fix `mapper' invocation.
* testsuite/poke.pickles/search-test.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-02-06 Nikolaos Chatzikonstantinou <nchatz314@gmail.com>
* libpoke/std.pk (stoca): Add support for returning the converted
value.
* doc/poke.texi (stoca): Update accordingly.
* testsuite/poke.std/std-test.pk: Add stoca-catos idempotence
test.
2023-02-06 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pvm/pvm.exp: New file.
* testsuite/poke.pvm/vm-insns.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-02-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-alloc.c (pvm_alloc_initialize): Do not initialize
the boehm GC if it has been already initialized.
2023-02-06 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Update examples to new semantics of FNAME ==
EXPR.
2023-02-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_constant_fold): Get an ast argument and avoid
duplicating ast node uids.
* libpoke/pkl-gen.pks (aoref): Update call accordingly.
2023-02-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c: Add note to pkl_ast_sizeof_type comment.
* libpoke/pkl.h: Prototype for pkl_constant_fold.
* libpoke/pkl.c (pkl_constant_fold): New function.
* testsuite/poke.pkl/arrays-index-17.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-02-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_asm_stmt): Emit error whenever
necessary.
(pkl_gen_pr_asm_exp): Likewise.
* libpoke/pvm-program.c (pvm_program_parse_from_string): Return an
error status in the form of an error message.
* libpoke/pkl-asm.c (pkl_asm_from_string): Likewise.
2023-02-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (declaration): improve error message.
2023-02-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (The any Type): Document that == and != are
applicable to values of type `any'.
2023-02-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_eq_any): Fix comparation for structs.
* testsuite/poke.pkl/eq-any-union-1.pk: New test.
* testsuite/poke.pkl/neq-any-union-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-struct-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-02-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_eq_any): Fix typo in assembly template.
2023-02-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-stream.c: Include `<assert.h>'.
(ios_dev_stream_flush): Call `fflush' when user calls `flush'
on output streams.
2023-02-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_64x64_128): New function.
(_pkl_any_integral_p): Likewise.
(_pkl_eq_integral): Likewise.
(_pkl_eq_offset): Likewise.
(_pkl_eq_array): Likewise.
(_pkl_eq_struct): Likewise.
(_pkl_eq_any): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_op_rela): Support EQ and NE for
`any' values.
(pkl_gen_pr_cast): Do nothing for casts to `any'.
* libpoke/pkl-typify.c (pkl_typify1_ps_op_rela): Likewise.
* libpoke/pkl-promo.c (pkl_promo_ps_op_rela): Likewise.
(promote_to_any): New function.
* testsuite/poke.pkl/eq-any-diag-1.pk: Remove test.
* testsuite/poke.pkl/neq-any-diag-1.pk: Likewise.
* testsuite/poke.pkl/ge-any-diag-1.pk: New test.
* testsuite/poke.pkl/le-any-diag-1.pk: Likewise.
* testsuite/poke.pkl/lt-any-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-any-diag-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-2.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-3.pk: Likewise.
* testsuite/poke.pkl/eq-any-integral-4.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-2.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-3.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-4.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-5.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-6.pk: Likewise.
* testsuite/poke.pkl/eq-any-offset-7.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-1.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-2.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-3.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-4.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-5.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-6.pk: Likewise.
* testsuite/poke.pkl/neq-any-offset-7.pk: Likewise.
* testsuite/poke.pkl/eq-any-array-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-array-2.pk: Likewise.
* testsuite/poke.pkl/neq-any-array-1.pk: Likewise.
* testsuite/poke.pkl/neq-any-array-2.pk: Likewise.
* testsuite/poke.pkl/eq-any-string-1.pk: Likewise.
* testsuite/poke.pkl/neq-any-string-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-struct-1.pk: Likewise.
* testsuite/poke.pkl/eq-any-struct-2.pk: Likewise.
* testsuite/poke.pkl/eq-any-struct-3.pk: Likewise.
* testsuite/poke.pkl/eq-any-struct-4.pk: Likewise.
* testsuite/poke.pkl/neq-any-struct-1.pk: Likewise.
* testsuite/poke.pkl/neq-any-struct-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-02-01 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c: Include `<unistd.h>' for `getuid'.
(poked_options): Remove const-qualifier from `socket_path'.
(poked_options_init): Change the default socket path to have
UID in the path.
(main): Adapt.
2023-01-31 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c: Include `<sys/stat.h>' for `umask'.
(usock_new): use `umask' to create the unix
socket with the right permissions.
2023-01-31 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c (usock_new): use `pipe2' instead of `pipe'.
do a F_GETFL before F_SETFL to keep the current flags.
2023-01-31 Jose E. Marchesi <jose.marchesi@oracle.com>
* poked/poked.c (poked_options_init): Fix getopt_long to recognize
-S.
2023-02-12 Arsen Arsenović <arsen@aarsen.me>
Fix -Wreturn-type warnings on -DNDEBUG
* common/pk-utils.h (PK_UNREACHABLE): New macro. Diagnoses
reaching unreachable code and aborts.
* libpoke/ios.c: Use PK_UNREACHABLE.
* libpoke/libpoke.c: Ditto.
* libpoke/pkl-anal.c: Ditto.
* libpoke/pkl-asm.c: Ditto.
* libpoke/pkl-ast.c: Ditto.
* libpoke/pkl-diag.c: Ditto.
* libpoke/pkl-env.c: Ditto.
* libpoke/pkl-fold.c: Ditto.
* libpoke/pkl-gen.c: Ditto.
* libpoke/pkl-lex.l: Ditto.
* libpoke/pkl-parser.c: Ditto.
* libpoke/pkl-pass.c: Ditto.
* libpoke/pkl-promo.c: Ditto.
* libpoke/pkl-tab.y: Ditto.
* libpoke/pkl-trans.c: Ditto.
* libpoke/pkl-typify.c: Ditto.
* libpoke/pkl.c: Ditto.
* libpoke/pvm-val.c: Ditto.
* poke/pk-cmd-help.c: Ditto.
* poke/pk-cmd-set.c: Ditto.
* poke/pk-cmd-vm.c: Ditto.
* poke/pk-cmd.c: Ditto.
* poke/pk-ios.c: Ditto.
* poke/pk-map-tab.y: Ditto.
* poke/poke.c: Ditto.
2023-01-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (Pk_Version): Add control fields.
(Pk_Version.to_string): New method.
(Pk_Version._print): Likewise.
* doc/poke.texi (Version Tools): Reflect new contents of
Pk_Version.
* testsuite/poke.std/std-test.pk: Add tests for
Pk_Version.to_string.
2023-01-31 Arsen Arsenović <arsen@aarsen.me>
pk_vercmp: Allow passing and automatically parsing strings
* libpoke/std.pk (pk_vercmp): Allow passing strings.
* doc/poke.texi (Version Tools): Document the new flexibility of
pk_vercmp.
2023-01-31 Arsen Arsenović <arsen@aarsen.me>
pk_parse_version: Provide more context on parse failure
* libpoke/std.pk (raise_exception): New function, takes an
exception and augments it with more context, to create a new
exception. Intended as a helper for errors during parsing.
(pk_parse_version): Use new raise_exception facility.
* doc/poke.texi (strtok): Document raise_exception.
2023-01-30 Arsen Arsenović <arsen@aarsen.me>
poke.texi: Remedy syntax-check fails
* doc/poke.texi (strtoi): Remove ``lets''.
(strtok): Italicize usages of ``i.e.''.
2023-01-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-info.pk (pk_info_type): Do not print a header for
Computed Fields if there are no computed fields.
2023-01-29 Arsen Arsenović <arsen@aarsen.me>
std.pk: Implement pk_version_parse, pk_vercmp
* doc/poke.texi (Other Functions): New node and section.
Documents miscellaneous functions.
(Concept Index): Merge the variable index into the concept index.
(Version Tools): New node. Documents pk_version,
pk_version_parse, Pk_Version, pk_vercmp and the version string
format.
* libpoke/std.pk (pk_vercmp): New function. Compares a pair of
Pk_Version structs.
(pk_version_parse): New function. Parses a version string into a
new Pk_Version struct.
* testsuite/poke.std/std-test.pk: Add pk_version_parse, pk_vercmp
tests.
* autoconf/poke.m4 (PK_PROG_POKE): Update to use pk_vercmp.
2023-01-29 Arsen Arsenović <arsen@aarsen.me>
std.pk: Implement strtok
* doc/poke.texi (strtok): Document the strtok API.
(String Functions): Add strtok to menu.
(Concept Index): Merge fn -> cp, as there's not enough use of the
function index to justify separate section currently.
* libpoke/std.pk (String_Tokenizer): New type. Holds the persistent
state of the strtok-like operation.
(strtok): New function. Returns a new String_Tokenizer.
(String_Tokenizer): New type. Holds tokenization state.
* testsuite/poke.std/std-test.pk: Add strtok test.
2023-01-29 Arsen Arsenović <arsen@aarsen.me>
std.pk: Refactor atoi into strtoi
* libpoke/std.pk (Strtoi_Result): New type. Stores the result of
a strtoi call.
(strtoi): New function. Parses a numeric prefix on a string and
returns the result and the number of parsed characters.
(atoi): Refactor to wrap strtoi.
* doc/poke.texi (strtoi): New node.
(atoi): Refer to strtoi for a list of bases.
* testsuite/poke.std/std-test.pk: Add tests for strtoi
offset-returning semantics.
2023-01-28 Arsen Arsenović <arsen@aarsen.me>
std.pk: Implement strrchr
* libpoke/std.pk (strrchr): New function. Finds the last
occurrence of a character in a string and returns its index, or
-1.
* doc/poke.texi (strrchr): Document new standard library function.
(String Functions): Add strrchr to menu, disambiguate menu entries
of strchr and strrchr.
* testsuite/poke.std/std-test.pk: Add strrchr test.
2023-01-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/std.pk (isdigit): New function.
(isxdigit): Likewise.
* testsuite/poke.std/std-test.pk (tests): Add tests for `isdigit'
and `isxdigit'.
* doc/poke.texi (The Standard Library): Add doc.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Make sure to end
styling classes before returning.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Use tar-ustar option in Automake.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* pickles/sframe.pk: Do not load elf.pk. It is not needed.
* pickles/elf.pk: Remove.
* pickles/elf-32.pk: Likewise.
* pickles/elf-64.pk: Likewise.
* pickles/elf-common.pk: Likewise.
* pickles/dwarf.pk: Likewise.
* pickles/dwarf-common.pk: Likewise.
* pickles/dwarf-expr.pk: Likewise.
* pickles/dwarf-frame.pk: Likewise.
* pickles/dwarf-info.pk: Likewise.
* pickles/dwarf-pubnames.pk: Likewise.
* pickles/dwarf-types.pk: Likewise.
* pickles/README.elf: New file.
* pickles/README.dwarf: Likewise.
* pickles/Makefile.am (dist_pickles_DATA): Remove elf pickles.
(EXTRA_DIST): Distribute README.elf and README.dwarf.
* testsuite/poke.pickles/elf-test.pk: Remove.
* testsuite/poke.pickles/dwarf-test.pk: Likewise.
* testsuite/poke.pickles/ctf-test.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Remove elf-test.pk,
dwarf-test.pk and ctf-test.pk.
* doc/poke.texi (Binary Files): Tell how to find the elf pickles.
(ELF): Likewise.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Fix addition of POKE_LOAD_PATH to
load_path.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Honor POKE_LOAD_PATH.
(print_help): Document new env var.
* doc/poke.texi (Invoking poke): Likewise.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Remove obsolete package memcpy.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* autoconf/poke.m4 (PK_PROG_POKE): Simplify regexp.
2023-01-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-config.pk.in: Make pk_version immutable.
2023-01-27 Arsen Arsenović <arsen@aarsen.me>
* run.in (setup to run uninstalled poke): Replace fragile export
listings with set -a/set +a block.
2023-01-27 Jose E. Marchesi <jemarch@gnu.org>
* autoconf/poke.m4: New file.
* autoconf/Makefile.am: Likewise.
* libpoke/pkl-config.pk.in: Likewise.
* run.in (POKECONFIGDIR): Define POKECONFIGDIR.
* testsuite/Makefile.am (check-DEJAGNU): Likewise.
* libpoke/pkl.c (pkl_new): Load pkl-config.pk as part of the
compiler bootstrapping.
* Makefile.am (SUBDIRS): Add autoconf.
* configure.ac (AC_CONFIG_FILES): Add autoconf/Makefile.
Add pkl-config.pk.
Turn / into _ in poke_branch.
* libpoke/Makefile.am (dist_pkgdata_DATA): Add pkl-config.pk.
2023-01-27 Arsen Arsenović <arsen@aarsen.me>
* configure.ac (poke_branch): Fix grep -q portability issue.
* .x-sc_two_space_separator_in_usage: New file. Exclude
configure.ac.
2023-01-27 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Change dircategory to GNU poke.
2023-01-27 Arsen Arsenović <arsen@aarsen.me>
* configure.ac: Add git-version-gen reminder.
2023-01-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Simplify code.
2023-01-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_decl): Do not validate
signature of _print* functions, as opposed to methods.
* testsuite/poke.pkl/struct-types-defun-4.pk: New test.
* testsuite/poke.pkl/struct-field-pretty-print-diag-1.pk: Fix
test.
* testsuite/poke.pkl/struct-field-pretty-print-diag-2.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-diag-1.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-diag-2.pk: Likewise.
2023-01-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_decl): Check field
pretty-printers.
* libpoke/pkl-rt.pk (_pkl_print_format_any): Use field
pretty-printers whenever available.
* testsuite/poke.pkl/struct-field-pretty-print-diag-1.pk: New
test.
* testsuite/poke.pkl/struct-field-pretty-print-diag-2.pk:
Likewise.
* testsuite/poke.pkl/struct-field-pretty-print-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Struct Pretty Printers): New section.
2023-01-26 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: get_time is now gettime.
2023-01-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios.c (ios_close): Re-use the IOS ID if possible.
* testsuite/poke.pkl/ios-close-1.pk: New test.
* testsuite/poke.pkl/ios-close-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-01-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l (pkl_lex_get_base): Handle 0[Bb] literals
properly.
* testsuite/poke.pkl/integers-11.pk: New test.
* testsuite/poke.pkl/integers-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-01-25 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump version number to 3.0.
* NEWS: Likewise.
2023-01-24 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump version number to 2.90.1.
* NEWS: Likewise.
2023-01-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* libpoke/Makefile.am (uninstall-sources): New rule.
(uninstall-local): Likewise.
(install-data-local): Likewise.
2023-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c (usock_new): Don't blindly set FD_CLOEXEC; first
get the flags, enable the FD_CLOEXEC flag and set new the flag.
2023-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (get_time): Renamed to `gettime'.
* pickles/time.pk (gettimeofday): s/get_time/gettime/.
* testsuite/poke.pkl/get-time-1.pk: Removed.
* testsuite/poke.pkl/gettime-1.pk: Added.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/poke.pkl/apop-diag-2.pk: Fixed.
* testsuite/poke.pkl/apop-diag-3.pk: Likewise.
* testsuite/poke.pkl/apush-diag-4.pk: Likewise.
* testsuite/poke.pkl/apush-diag-5.pk: Likewise.
2023-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-anal.c (pkl_anal2_ps_op_apush_apop): New phase for
compile-time check of `apush' and `apop' operations on arrays;
emit compile-time error unless the array is unbounded.
(pkl_phase_anal2): Add new phases for `PKL_AST_OP_A{PUSH,POP}'.
* testsuite/poke.pkl/apush-diag-4.pk: New test.
* testsuite/poke.pkl/apush-diag-5.pk: Likewise.
* testsuite/poke.pkl/apop-diag-2.pk: Likewise.
* testsuite/poke.pkl/apop-diag-3.pk: Likewise.
* testsuite/poke.pkl/apop-1.pk: Adapt.
* testsuite/poke.pkl/apush-1.pk: Likewise.
* testsuite/poke.pkl/apush-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (time): Change the instruction to push
SEC and NSEC to the stack (instead of creating an array and
pushing the array to the stack).
* libpoke/pkl-rt.pk (get_time): Adapt.
* testsuite/poke.pkl/get-time-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_integral): Reject
`int<1>' as invalid type.
* testsuite/poke.cmd/sdiff-10.pk: s/int<1>/uint<1>/.
* testsuite/poke.map/maps-int-structs-6.pk: Likewise.
* testsuite/poke.map/maps-int-structs-11.pk: Likewise.
* testsuite/poke.pkl/cast-integers-12.pk: Likewise.
* testsuite/poke.pkl/eq-integers-5.pk: Likewise.
* testsuite/poke.pkl/eq-offsets-8.pk: Likewise.
* testsuite/poke.pkl/mod-offsets-3.pk: Likewise.
* testsuite/poke.pkl/mod-offsets-4.pk: Likewise.
* testsuite/poke.pkl/int-type.pk: Remove `int<1>'.
* testsuite/poke.pkl/int-type-diag-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (poked_version): Don't use year range.
2023-01-24 Arsen Arsenović <arsen@aarsen.me>
Integrate git-version-gen.
* etc/hacking.org (Building Release Tarballs): Add some notes
about how to get correct versioning information.
* configure.ac: Invoke git-version-gen to compute version value.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
* Makefile.am (EXTRA_DIST): Add ``.version''.
(BUILT_SOURCES): Ditto.
($(top_srcdir)/.version): store current $(VERSION) value.
(dist-hook): Store version as .tarball-version.
* .gitignore: Ignore .version
* HACKING: Regenerate.
2023-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_BINOP_SL): Do not trigger left-shit UB.
2023-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (pkl_phase_fold): Remove duplicated handler
entry.
* libpoke/pkl-trans.c (pkl_phase_trans1): Likewise.
2023-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios.c (ios_read_int): Avoid UB in signed left shifts,
and overflows in unsigned left shifts.
* libpoke/pvm-val.h (PVM_VAL_INT): Likewise.
(PVM_MAKE_INT): Likewise.
(PVM_MAKE_UINT): Likewise.
(PVM_VAL_LONG): Likewise.
* libpoke/pvm.jitter (PVM_ADD_SIGNED): Likewise.
(PVM_SUB_SIGNED): Likewise.
(PVM_MUL_SIGNED): Likewise.
2023-01-23 Arsen Arsenović <arsen@aarsen.me>
* libpoke/pvm.jitter (sleep): Push an error code rather than
raising an exception. Do a range check on the passed seconds and
nanoseconds value, to reconcile differences between platforms.
* libpoke/pkl-rt.pk (sleep): Translate error codes pushed by the
sleep instruction into exceptions.
2023-01-23 Arsen Arsenović <arsen@aarsen.me>
* doc/poke.texi (Exceptions): Fix typo in the E_no_return
description (end of a void function -> end of a non-void
function).
2023-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (iolist): Use array indexing instead of
`apush'.
2023-01-23 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/typeof-struct-2.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-1.pk: Update test.
* libpoke/pkl-gen.pks (typeof): Initialize integral_p.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Bump copyright year to 2023 and
do not use a year range.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (typifier_mapper_wrapper): New function.
(array_typifier): Use typifier_mapper_wrapper.
(struct_typifier): Likewise.
* libpoke/pkl-rt.pk (Pk_type): Do not expose ebound and sbound in
the mapper closure.
* doc/poke.texi (typeof): Update accordingly.
* testsuite/poke.pkl/typeof-27.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (typeof): New section.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Prototype for pkl_asm_struct_type_method_p.
Prototype for pkl_asm_get_struct_type_field.
* libpoke/pkl-ast.c (pkl_asm_get_struct_type_method): New
function.
(pkl_asm_get_struct_type_field): Likewise.
* libpoke/pkl-anal.c (pkl_anal2_ps_struct_ref): New handler.
(pkl_anal2_ps_ass_stmt): Likewise.
(pkl_phase_anal2): Register handlers.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Do no force
to define getter and setter methods for computer fields.
* libpoke/pkl-gen.c (pkl_gen_ps_struct_ref): Raise an exception
when referring to a computed field with no getter.
(pkl_gen_pr_ass_stmt): Likewise for the setter.
* testsuite/poke.pkl/sref-diag-3.pk: New test.
* testsuite/poke.pkl/computed-19.pk: Likewise.
* testsuite/poke.pkl/computed-diag-5.pk: Remove.
* testsuite/poke.pkl/computed-diag-6.pk: Likewise.
* testsuite/poke.pkl/computed-diag-7.pk: Likewise.
* testsuite/poke.pkl/ass-diag-10.pk: Likewise.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/acons-20.pk: New test.
* testsuite/poke.pkl/acons-21.pk: Likewise.
* testsuite/poke.pkl/acons-22.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-01-22 Jose E. Marchesi <jemarch@termi>
* libpoke/pkl-gen.pks (array_constructor): Support element types
of size 0 with sbound > 0.
* testsuite/poke.pkl/acons-15.pk: New test.
* testsuite/poke.pkl/acons-16.pk: Likewise.
* testsuite/poke.pkl/acons-17.pk: Likewise.
* testsuite/poke.pkl/acons-18.pk: Likewise.
* testsuite/poke.pkl/acons-19.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_constructor): Get an argument with
the initial value to put in constructed arrays.
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Pass initial value
to the constructor.
(pkl_gen_ps_cons): Likewise.
2023-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal1_ps_cons): Constructing non-empty
arrays of `any' without initial values is not supported.
* testsuite/poke.pkl/acons-diag-9.pk: New test.
* testsuite/poke.pkl/acons-diag-10.pk: Likewise.
* testsuite/poke.pkl/acons-13.pk: Likewise.
* testsuite/poke.pkl/acons-14.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2023-01-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec): Add support for `immutable'.
2023-01-21 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Change version to 2.90.0.
* NEWS: Add entries for 2.90.0.
2023-01-21 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-val.c (pvm_sizeof): Add case for `PVM_NULL'.
* libpoke/pvm.jitter (siz): Add a comment describing special
cases.
2023-01-20 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Report missing gensub-capable awk at configure
time.
2023-01-19 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* man/Makefile.am (man_MANS): Add poked.
(poked.1): New rule to generate man page for poked.
2023-01-19 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/pdap.pk: New pickle for "PokeD Application Protocol".
* testsuite/poke.pickles/pdap-test.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-01-19 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (poked): Add new chapter.
2023-01-19 Arsen Arsenović <arsen@aarsen.me>
* poke/pk-repl.c (space_substitute_display_matches): Force
redisplay after displaying match list, to match GNU Readline
behavior.
2023-01-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (VUCMD_*): Re-enumerate the view (vu) commands.
* poked/poked.pk (plet_vu): Simplify the dump format. We can
make it more flexible again later.
(plet_vu_highlight): Simplify array allocation.
2023-01-18 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_pvm_wrappers): Remove empty lines.
2023-01-18 Jose E. Marchesi <jemarch@gnu.org>
* etc/pvm-wraps-whitelist: Add rpl_printf, __stpcpy_chk, memcpy,
rpl_memcpy and __strcpy_chk.
2023-01-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (libpoke_la_SOURCES): Add pvm-wrappers.c and
pvm-wrappers.h.
* libpoke/pvm-wrappers.c: New file.
* libpoke/pvm-wrappers.h: Likewise.
* libpoke/pvm.jitter: Move pvm_* wrappers to pvm-wrappers.c.
* etc/pvm-wraps-whitelist: Remove entries for functions called
from pvm_* wrappers.
* etc/pvm-wraps-static-whitelist: Remove functions no longer
defined in pvm.jitter.
2023-01-18 Jose E. Marchesi <jemarch@gnu.org>
* etc/pvm-wraps-whitelist: Add printf and rpl_printf.
2023-01-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Wrap pvm_free.
2023-01-17 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (FORMATF): Rename the macro to `PVM_FORMATF'
and s/memcpy/pvm_memcpy/.
(formatf32): s/FORMATF/PVM_FORMATF/.
(formatf64): Likewise.
2023-01-17 Arsen Arsenović <arsen@aarsen.me>
* doc/poke.texi (Top): Include the introductory paragraph from
<https://jemarch.net/poke.html>, and a brief elaboration on the
contents of the manual.
* doc/Makefile.am (html-local): Remove outdated workaround for bug
in older Texinfo versions.
2023-01-17 Jose E. Marchesi <jemarch@termi>
* libpoke/pkl-anal.c (pkl_anal_ps_default): Remove handler.
(pkl_phase_anal1): And do not use it.
(pkl_phase_anal2): Likewise.
2023-01-16 Arsen Arsenović <arsen@aarsen.me>
* cfg.mk (sc_tests_listed_in_makefile_am): Modernize egrep
invocation into grep -E, as the former was deprecated.
2023-01-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (wrapped-functions): Wrap pvm_random,
pvm_srandom, pvm_gettime and pvm_secure_getenv.
(pvm_random): New function.
(pvm_srandom): Likewise.
(pvm_gettime): Likewise.
(pvm_secure_getenv): Likewise.
(rand): Use pvm_srandom, pvm_random and pvm_gettime.
(time): Use pvm_gettime.
(getenv): Use pvm_secure_getenv.
* etc/pvm-wraps-static-whitelist: Add pvm_random, pvm_srandom,
pvm_gettime and pvm_secure_getenv.
* etc/pvm-wraps-whitelist: Add random, rpl_random, srandom,
rpl_srandom, gettime, rpl_gettime, secure_getenv and
rpl_secure_getenv.
2023-01-14 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Import module vsnprintf-posix.
* libpoke/pvm.jitter (wrapped-functions): Add pvm_snprintf.
(pvm_snprintf): New function.
(FORMATF): Use pvm_snprintf.
(PVM_FORMATI): Likewise.
(PVM_FORMATL): Likewise.
* etc/pvm-wraps-static-whitelist: Add pvm_snprintf.
* etc/pvm-wraps-whitelist: Add vsnprintf and rpl_vsnprintf.
2023-01-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (FORMATF): Use pvm_asprint.
(wrapped-functions): Add pvm_asprintf.
(pvm_asprintf): New function.
* etc/pvm-wraps-static-whitelist: Add pvm_asprintf.
* etc/pvm-wraps-whitelist: Add asprintf and rpl_asprintf.
2023-01-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (pvm_free): New function.
(formatf32): Use pvm_free.
(formatf64): Likewise.
Remove rpl_free from wrapped-functions.
* etc/pvm-wraps-whitelist: Whitelist rpl_free and free.
* etc/pvm-wraps-static-whitelist: Whitelist pvm_free.
2023-01-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Add rpl_free and asprintf to
wrapped-functions.
* etc/pvm-wraps-static-whitelist: Add pvm_literal_dispatch_name,
pvm_literal_formatf_fmt and pvm_literal_formatf_styles.
2023-01-12 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (.vm dispatch): Fix menu.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (__dots): Renamed to `__poked_dots'.
(__PokedDotUpdateFunc): Removed.
(__PokedDotUpdateFuncEntry): Removed.
(dots): Renamed to `plet_vu_dots'.
(dot): Renamed to `plet_vu_dot'.
(dot2): Renamed to `plet_vu_dot2'.
(dots_set): Renamed to `plet_vu_dots_set'.
(dot_set_txtcoord): Renamed to `plet_vu_dot_set_txtcoord'.
(__vu_Args): Renamed to `__Poked_VuArgs'.
(__vu_do_p): Renamed to `__plet_vu_do_p'.
(__vu_args): Renamed to `__plet_vu_args'.
(__vu_filter): Renamed to `__plet_vu_filter'.
(__vu_dump): Renamed to `__plet_vu_dump'.
(plet_vu): Adapt.
(plet_vu_highlight): Adapt.
(treevu): Remove treevu pokelet code. Needs more work.
(__Disasm): Renamed to `__Poked_Disasm'.
* poked/poked.c (poked_init): Adapt.
(poked_compile): Likewise.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-globals): Add
pvm_literal_dispatch_name.
(pvm_literal_dispatch_name): New global constant.
(vmdisp): New instruction for pushing the name of current
dispatching strategy to the stack.
* libpoke/pkl-rt.pk (vm_dispatch): New function.
* doc/poke.texi (.vm dispatch): Add new subsection.
* poke/pk-cmd-vm.c (pk_cmd_vm_dispatch): New function.
(vm_dispatch_cmd): New variable.
(vm_cmds): Add `vm_dispatch_cmd' command.
* poke/pk-help.pk (.vm topic): Add `.vm dispatch'.
* poke/poke.pk (pk_print_vm_dispatch): New function.
* testsuite/poke.repl/repl.exp (tab-completion-3): Adapt.
(tab-completion-4): Likewise.
(tab-completion-6): Likewise.
(tab-completion-5): New test for tab completion of
`.vm dispatch'.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-globals): Add
pvm_literal_formatf_{fmt,styles} to the list.
(pvm_literal_formatf_fmt): Define global variable for wrapping
format string in `formatf{32,64}' (we cannot directly use string
literals in advanced modes).
(pvm_literal_formatf_styles): Likewise.
(FORMATF): Use new wrapped globals. Remove % operator.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (poked_version): Add new function to print version
in GNU style.
(poked_options_init): Use `poked_version'.
(poked_help): Make it GNU-compatible.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (formatf32): Add literal parameter to the
instruction's doc.
(formatf64): Likewise.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/riscv.pk (RV_Opcode): Remove the re-definition.
(RV32_OPCODE_*): Change the type from `RV_Opcode' to `uint<7>'.
(RV32_InsnFmt_I): Adapt.
(RV32_InsnFmt_S): Likewise.
(RV32_InsnFmt_B): Likewise.
(RV32_InsnFmt_U): Likewise.
(RV32_InsnFmt_J): Likewise.
(rv32_lui): Likewise.
(rv32_auipc): Likewise.
(rv32_jal): Likewise.
(_rv32_branch): Likewise.
(rv32_jalr): Likewise.
(rv32_lb): Likewise.
(rv32_lh): Likewise.
(rv32_lw): Likewise.
(rv32_lbu): Likewise.
(rv32_lhu): Likewise.
(rv32_addi): Likewise.
(rv32_slti): Likewise.
(rv32_sltiu): Likewise.
(rv32_xori): Likewise.
(rv32_ori): Likewise.
(rv32_andi): Likewise.
(rv32_slli): Likewise.
(rv32_srli): Likewise.
(rv32_srai): Likewise.
(rv32_fence): Likewise.
(rv32_ecall): Likewise.
(rv32_ebreak): Likewise.
(_rv32_op): Likewise.
(_rv32_s): Likewise.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/ieee754.pk: New pickle for IEEE 754 floating-point
numbers based on initial code from apache2.
* pickles/Makefile.am (dist_pickles_DATA): Add new pickle.
* testsuite/poke.pickles/ieee754-test.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-01-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def (formatf32): Add new instruction.
(formatf64): Likewise.
* libpoke/pvm.jitter (FORMATF): New macro for formatting
floating-point numbers.
(formatf32): New instruction for formatting floating-point
numbers.
(formatf64): Likewise.
* libpoke/pkl-ast.h (PKL_AST_FORMAT_ARG_FLOATING_POINT_P): New macro.
(PKL_AST_FORMAT_ARG_FLOATING_POINT_STYLE): Likewise.
(PKL_AST_FORMAT_ARG_FLOATING_POINT_PREC): Likewise.
(PKL_AST_FORMAT_ARG_FLOATING_POINT_WIDTH): Likewise.
(PKL_AST_FORMAT_ARG_FLOATING_POINT_WIDTH_SINGLE): Likewise.
(PKL_AST_FORMAT_ARG_FLOATING_POINT_WIDTH_DOUBLE): Likewise.
(struct pkl_ast_format_arg): Add new fields for floating-points.
* libpoke/pkl-trans.c (pkl_trans1_ps_format): Handle new specifiers
for floating-point numbers (f, e, g).
* libpoke/pkl-gen.c (pkl_gen_pr_format): Add support for formatting
and printing floating-point numbers.
* doc/poke.texi (Printing): Add new format specifiers to the table.
* testsuite/poke.pkl/format-43.pk: New test.
* testsuite/poke.pkl/format-44.pk: Likewise.
* testsuite/poke.pkl/format-45.pk: Likewise.
* testsuite/poke.pkl/format-46.pk: Likewise.
* testsuite/poke.pkl/format-47.pk: Likewise.
* testsuite/poke.pkl/format-48.pk: Likewise.
* testsuite/poke.pkl/format-49.pk: Likewise.
* testsuite/poke.pkl/format-50.pk: Likewise.
* testsuite/poke.pkl/format-51.pk: Likewise.
* testsuite/poke.pkl/format-52.pk: Likewise.
* testsuite/poke.pkl/format-53.pk: Likewise.
* testsuite/poke.pkl/format-54.pk: Likewise.
* testsuite/poke.pkl/format-55.pk: Likewise.
* testsuite/poke.pkl/format-56.pk: Likewise.
* testsuite/poke.pkl/format-57.pk: Likewise.
* testsuite/poke.pkl/format-58.pk: Likewise.
* testsuite/poke.pkl/format-59.pk: Likewise.
* testsuite/poke.pkl/format-60.pk: Likewise.
* testsuite/poke.pkl/format-61.pk: Likewise.
* testsuite/poke.pkl/format-62.pk: Likewise.
* testsuite/poke.pkl/format-63.pk: Likewise.
* testsuite/poke.pkl/format-64.pk: Likewise.
* testsuite/poke.pkl/format-65.pk: Likewise.
* testsuite/poke.pkl/format-66.pk: Likewise.
* testsuite/poke.pkl/format-67.pk: Likewise.
* testsuite/poke.pkl/format-68.pk: Likewise.
* testsuite/poke.pkl/format-69.pk: Likewise.
* testsuite/poke.pkl/format-70.pk: Likewise.
* testsuite/poke.pkl/format-71.pk: Likewise.
* testsuite/poke.pkl/format-72.pk: Likewise.
* testsuite/poke.pkl/format-73.pk: Likewise.
* testsuite/poke.pkl/format-diag-2.pk: Likewise.
* testsuite/poke.pkl/format-diag-3.pk: Likewise.
* testsuite/poke.pkl/format-diag-4.pk: Likewise.
* testsuite/poke.pkl/format-diag-5.pk: Likewise.
* testsuite/poke.pkl/format-diag-6.pk: Likewise.
* testsuite/poke.pkl/format-diag-7.pk: Likewise.
* testsuite/poke.pkl/format-diag-8.pk: Likewise.
* testsuite/poke.pkl/format-diag-9.pk: Likewise.
* testsuite/poke.pkl/printf-41.pk: Likewise.
* testsuite/poke.pkl/printf-42.pk: Likewise.
* testsuite/poke.pkl/printf-43.pk: Likewise.
* testsuite/poke.pkl/printf-44.pk: Likewise.
* testsuite/poke.pkl/printf-45.pk: Likewise.
* testsuite/poke.pkl/printf-46.pk: Likewise.
* testsuite/poke.pkl/printf-47.pk: Likewise.
* testsuite/poke.pkl/printf-48.pk: Likewise.
* testsuite/poke.pkl/printf-49.pk: Likewise.
* testsuite/poke.pkl/printf-50.pk: Likewise.
* testsuite/poke.pkl/printf-51.pk: Likewise.
* testsuite/poke.pkl/printf-52.pk: Likewise.
* testsuite/poke.pkl/printf-53.pk: Likewise.
* testsuite/poke.pkl/printf-54.pk: Likewise.
* testsuite/poke.pkl/printf-55.pk: Likewise.
* testsuite/poke.pkl/printf-56.pk: Likewise.
* testsuite/poke.pkl/printf-57.pk: Likewise.
* testsuite/poke.pkl/printf-58.pk: Likewise.
* testsuite/poke.pkl/printf-59.pk: Likewise.
* testsuite/poke.pkl/printf-60.pk: Likewise.
* testsuite/poke.pkl/printf-61.pk: Likewise.
* testsuite/poke.pkl/printf-62.pk: Likewise.
* testsuite/poke.pkl/printf-63.pk: Likewise.
* testsuite/poke.pkl/printf-64.pk: Likewise.
* testsuite/poke.pkl/printf-65.pk: Likewise.
* testsuite/poke.pkl/printf-66.pk: Likewise.
* testsuite/poke.pkl/printf-67.pk: Likewise.
* testsuite/poke.pkl/printf-68.pk: Likewise.
* testsuite/poke.pkl/printf-69.pk: Likewise.
* testsuite/poke.pkl/printf-70.pk: Likewise.
* testsuite/poke.pkl/printf-71.pk: Likewise.
* testsuite/poke.pkl/printf-diag-19.pk: Likewise.
* testsuite/poke.pkl/printf-diag-20.pk: Likewise.
* testsuite/poke.pkl/printf-diag-21.pk: Likewise.
* testsuite/poke.pkl/printf-diag-22.pk: Likewise.
* testsuite/poke.pkl/printf-diag-23.pk: Likewise.
* testsuite/poke.pkl/printf-diag-24.pk: Likewise.
* testsuite/poke.pkl/printf-diag-25.pk: Likewise.
* testsuite/poke.pkl/printf-diag-26.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2023-01-11 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-elfextractor.in: Update to new semantics of `in'
operator.
2023-01-11 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_KIND_LAST): Define.
(BTF_Type): Add constraint to info.kind.
2023-01-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_print_1): Fix names in
PRINT_AST_SUBAST.
2023-01-10 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (set_script_args): Fix check for -L in argv.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (getenv): Avoid calling the `gettenv'
instruction twice.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_stroref): Make immutable.
(_pkl_aoref): Likewise.
(_pkl_aoref_complete): Likewise.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-builtins.pks (builtin_iohandler): Remove.
* libpoke/pkl-tab.y (builtin): Remove rule for BUILTIN_IOHANDLER.
* libpoke/pkl-gen-builtins.pks (builtin_unsafe_string_set): Remove.
* libpoke/pkl-tab.y (builtin): Remove rule for BUILTIN_UNSAFE_STRING_SET.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_GETENV): Remove.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Remove case for
PKL_AST_BUILTIN_GETENV.
* libpoke/pkl-lex.l: Remove rule for __PKL_BUILTIN_GETENV__.
* libpoke/pkl-tab.y (builtin): Remove rule for BUILTIN_GETENV.
* libpoke/pkl-gen-builtins.pks (builtin_getenv): Remove.
* libpoke/pkl-rt.pk (getenv): Rewrite as a normal function.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/sdiff-2.pk: Adapt to new value printing.
* testsuite/poke.cmd/sdiff-3.pk: Likewise.
* testsuite/poke.cmd/sdiff-4.pk: Likewise.
* testsuite/poke.cmd/sdiff-8.pk: Likewise.
* testsuite/poke.cmd/sdiff-1.pk: Run sdiff with :values 0.
* testsuite/poke.cmd/sdiff-5.pk: Likewise.
* testsuite/poke.cmd/sdiff-6.pk: Likewise.
* testsuite/poke.cmd/sdiff-7.pk: Likewise.
* testsuite/poke.cmd/sdiff-10.pk: Likewise.
* testsuite/poke.cmd/sdiff-12.pk: Likewise.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/diff.pk (format_value): Remove function.
Use regular `format' for `any' values.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_CLOSE): Remove.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Remove case for
PKL_AST_BUILTIN_CLOSE.
* libpoke/pkl-lex.l: Remove rule for __PKL_BUILTIN_CLOSE__.
* libpoke/pkl-tab.y (builtin): Remove rule for BUILTIN_CLOSE.
* libpoke/pkl-gen-builtins.pks (builtin_close): Remove.
* libpoke/pkl-rt.pk (close): Rewrite as a normal function.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_SET_IOS): Remove.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Remove case for
PKL_AST_BUILTIN_SET_IOS.
* libpoke/pkl-lex.l: Remove rule for __PKL_BUILTIN_SET_IOS__.
* libpoke/pkl-tab.y (builtin): Remove rule for BUILTIN_SET_IOS.
* libpoke/pkl-gen-builtins.pks (builtin_set_ios): Remove.
* libpoke/pkl-rt.pk (set_ios): Rewrite as a normal function.
2023-01-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Simplify inline asm
snippet.
2023-01-07 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/pcap.pk (PCAP_Packet): Declare body as a byte array.
2022-12-22 Darshit Shah <darnir@gnu.org>
* doc/poke.texi: Simplify Hyperlink setup by calling `make install`
2022-12-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Emit
tv_field_constructed event for fields for which there are
initializers in the constructor.
2022-12-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Define oover.
* libpoke/pvm.jitter (oover): New instruction.
* libpoke/pkl-rt.pk (PK_TV_FIELD_CONSTRUCTED): Define.
* libpoke/pkl.h (PK_TV_FIELD_CONSTRUCTED): Likewise.
* libpoke/pkl-gen.pks (emit_tv_field_event): New macro.
(struct_field_mapper): Use it.
(struct_field_constructor): Emit an event for constructed fields.
(typeof): Eval to PVM_NULL if the requested typeof is for Pk_Type.
* poke/pk-tracer.pk (pk_tv_action_field_mapped_constructed):
Rename from pk_tv_action_field_mapped and adapted to handle both
events.
2022-12-10 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/scons-constraints-1.pk: Adapt to new
exception mesage.
* testsuite/poke.pkl/scons-constraints-2.pk: Likewise.
* testsuite/poke.pktest/pktest-12.pk: Likewise.
2022-12-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (struct pkl_ast_struct_type_field): New field
constraint_src.
(PKL_AST_STRUCT_TYPE_FIELD_CONSTRAINT_SRC): Define.
* libpoke/pkl-ast.c (pkl_ast_dup_type): Adapt accordingly.
(pkl_ast_node_free_1): Likewise.
* libpoke/pkl-tab.y (struct_type_field): Fill in constraint_src in
struct field type AST nodes.
* libpoke/pkl-rt.pk (_pkl_e_constraint_msg): New function.
* libpoke/pkl-gen.pks (check_struct_field_constraint): Call
_pkl_e_constraint_msg.
* testsuite/poke.map/maps-structs-constraints-2.pk: Adapt to new
message.
* testsuite/poke.map/maps-structs-constraints-3.pk: Likewise.
* testsuite/poke.pickles/pcap-test.pk: Likewise.
2022-12-05 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (AUTOCMPL_IDENT): Change the value.
(AUTOCMPL_IOS): Likewise.
(AUTOCMPL_ITER_BEGIN): New macro.
(AUTOCMPL_ITER_END): Likewise.
(poked_autocmpl_send_one): Adapt.
(poked_autocmpl_send): Send iteration.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (plet_disasm): Add an assertion for valid
architectures.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (PDISAS_ITER_BEGIN): New macro.
(PDISAS_ITER_END): Likewise.
(PDISAS_ERR): Likewise.
(PDISAS_TXT): Likewise.
(PDISAS_KIND): Likewise.
(termout_disas): New function.
(poked_disasm_send): Likewise.
(iteration_send): Add new param (`chan').
(iteration_begin): Likewise.
(iteration_end): Likewise.
(poked_compile): Add support for Poke disasm.
(main): Update `iteration_begin' and `iteration_end'
invocation.
* poked/poked.pk (PLET_DISAS_KIND_FUNC): New const.
(PLET_DISAS_KIND_FUNC_NATIVE): Likewise.
(PLET_DISAS_KIND_EXPR): Likewise.
(PLET_DISAS_KIND_EXPR_NATIVE): Likewise.
(__Poked_Disas): New type.
(__poked_disas_data): New variable.
(__poked_disas_p): Likewise.
(__poked_disas_reset): New function.
(plet_disas_func): Likewise.
(plet_disas_expr): Likewise.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (OUTCMD_TXT): Change the value.
(OUTCMD_ITER_END): Likewise.
(OUTCMD_CLS_BEGIN): Likewise.
(OUTCMD_CLS_END): Likewise.
(OUTCMD_EVAL): Likewise.
(OUTCMD_ERR): Likewise.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.h (usock_out_printf): New function.
* poked/usock.c (usock_out_printf): Likewise.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.h (USOCK_CHAN_IN_AUTOCMPL): Remove macro.
(USOCK_CHAN_OUT_DISASM): Likewise.
(USOCK_CHAN_OUT_PDISAS): New macro.
(USOCK_CHAN_OUT_CDISAS): Likewise.
* poked/poked.pk (plet_disasm): Update the CPU disasm channel.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (__poked_libpoke_version): New variable.
(poked_libpoke_version): New function.
* poked/poked.c (poked_init): Set `__poked_libpoke_version'.
2022-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (main): Print PDAP version.
(poked_init): Add new param (`pdap_version').
Update `__poked_pdap_version' Poke variable.
* poked/poked.pk (__poked_pdap_version): New variable.
(poked_pdap_version): New function.
2022-11-29 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/lib/poke-pk.exp (tap_execute): Only keep the filename
and parent directory name for test files to be consistent with
the rest.
2022-11-27 Arsen Arsenović <arsen@aarsen.me>
* bootstrap: Sync with Gnulib.
* autopull.sh: New file from Gnulib, as a result of sync.
* autogen.sh: Ditto.
* bootstrap-funclib.sh: Ditto.
* bootstrap.conf (bootstrap_print_option_usage_hook): Fix help
string alignment.
(bootstrap_post_import_hook): Default JITTER_SRCDIR to Jitter,
die-guard cd "${JITTER_SRCDIR}" to prevent recursing, move Jitter
submodule update code...
(bootstrap_post_pull_hook): ... to this new hook.
(bootstrap_option_hook): Export JITTER_SRCDIR.
* gnulib: Update to newest.
2022-11-24 Arsen Arsenović <arsen@aarsen.me>
* poke/poke.c (poke_getopt_string): Extract the getopt string, to
avoid repetition.
(parse_args_1): Use common poke_getopt_string, assert out on
unhandled option, and exit on unknown option.
(parse_args_2): Use common poke_getopt_string, assert out on
unhandled option.
2022-11-24 Agathe Porte <floss@microjoe.org>
* doc/poke.texi: fix sbm image bytes in example.
2022-11-23 Arsen Arsenović <arsen@aarsen.me>
* doc/Makefile.am (poke.text): Make dependencies match other
Texinfo targets.
2022-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l (build_overflow_error_msg): Use PRIu64 instead
of `lu'.
2022-11-21 Arsen Arsenović <arsen@aarsen.me>
* etc/hacking.org (Continuous Integration): Document the
Sourceware buildbot.
* HACKING: Regenerate.
2022-11-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/uuid.pk: New pickle.
* pickles/redoxfs.pk: Likewise.
* pickles/pcap.pk: Likewise.
* testsuite/poke.pickles/uuid-test.pk: New test.
* testsuite/poke.pickles/pcap-test.pk: Likewise.
* testsuite/poke.pickles/redoxfs-test.pk: Likewise.
* pickles/Makefile.am (dist_pickles_DATA): Update.
* testsuite/Makefile.am (EXTRA_DIST): Likewise.
2022-11-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Require at least one digit in octal
constants.
* testsuite/poke.pkl/integers-diag-3.pk: New test.
* testsuite/poke.pkl/integers-diag-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Change `map' instruction to not raise
exceptions.
2022-11-11 Arsen Arsenović <arsen@aarsen.me>
* .gitmodules: Upgrade to HTTPS URLs.
2022-11-11 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-unions-17.pk: New test.
* testsuite/poke.map/maps-unions-18.pk: Likewise.
* testsuite/poke.map/maps-unions-19.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-11-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_extractor): Keep the right
lexical environment when subpassing results in a constraint
exception.
2022-11-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* etc/vim/syntax/poke.vim (keyword): Add `computed' to the list
of keywords.
2022-11-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (pushios): Modified to not raise exceptions.
* libpoke/pkl-tab.y: Remove BUILTIN_GET_IOS.
* libpoke/pkl-rt.pk (get_ios): raise E_io with an explicative
message if pushios returns < 0.
2022-11-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (open): Modified to not raise exceptions.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_OPEN): Remove.
* libpoke/pkl-lex.l: Do not recognize __PKL_BUILTIN_OPEN__.
* libpoke/pkl-tab.y (builtin): Remove rule for BUILTIN_OPEN.
* libpoke/pkl-gen-builtins.pks (builtin_open): Remove.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Do not handle
PKL_AST_BUILTIN_OPEN.
* libpoke/pkl-rt.pk (open): Handle error status from `open' and
raise proper exceptions.
2022-11-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/riscv.pk (RV32_Insn): Make it integral union and
remove `as_uint' method.
2022-11-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Handle integral unions.
* testsuite/poke.map/maps-int-union-6.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-11-03 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-misc.c (pk_cmd_jmd): New quote.
2022-11-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Fix `lutos' for long
values.
* libpoke/std.pk (ltos): Likewise.
* testsuite/poke.pkl/printf-40.pk: New test.
* testsuite/poke.std/std-test.pk: Test ltos with i > 2^31.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-11-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_DECL_PREV_NAME): Define.
(struct pkl_ast_decl): New field prev_name.
* libpoke/pkl-ast.c (pkl_ast_node_free_1): Free PREV_NAME.
(pkl_ast_print_1): Print PREV_NAME.
* libpoke/pkl-env.h: Prototype for pkl_env_rollback_renames.
* libpoke/pkl-env.c (pkl_env_rollback_renames_1): New function.
(pkl_env_rollback_renames): Likewise.
(register_decl): Cache the previous name used in the decl.
* libpoke/pkl.c (pkl_compile_expression): Rollback renames in the
compile-time environment in case of compilation error.
(pkl_execute_expression): Likewise.
(pkl_execute_file): Likewise.
(pkl_execute_statement): Likewise.
(pkl_execute_buffer): Likewise.
2022-11-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans2_ps_exp): Do not assume EXP
expressions will be constant-folded.
* libpoke/pkl-fold.c (OP_BINARY_III): Add a note regarding the
workaround in pkl_trans2_ps_exp.
* testsuite/poke.pkl/pow-folding-workaround.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-11-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_sizeof_type): Add assertion.
2022-11-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (atrim): Fix boundaries checking for empty
arrays.
* testsuite/poke.pkl/trim-36.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-10-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_aoref): Array element offsets are
absolute.
* testsuite/poke.pkl/arrays-index-15.pk: New test.
* testsuite/poke.pkl/arrays-index-16.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-10-31 Jose E. Marchesi <jemarch@gnu.org>
* pickles/coff.pk (COFF_Strtab): Make the get_string method
map-agnostic.
2022-10-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_indexer): Allow offsets as
indexes in indexers.
* libpoke/pkl-promo.c (pkl_promo_ps_indexer): Promote offset
indexes.
* libpoke/pkl-gen.c (pkl_gen_pr_indexer): Handle offset indexes.
* libpoke/pkl-gen.pks (aoref): New macro.
(stroref): Likewise.
* libpoke/pkl-rt.pk (_pkl_aoref): New function.
(_pkl_aoref_complete): Likewise.
* testsuite/poke.pkl/arrays-index-4.pk: New test.
* testsuite/poke.pkl/arrays-index-5.pk: Likewise.
* testsuite/poke.pkl/arrays-index-6.pk: Likewise.
* testsuite/poke.pkl/arrays-index-7.pk: Likewise.
* testsuite/poke.pkl/arrays-index-8.pk: Likewise.
* testsuite/poke.pkl/arrays-index-9.pk: Likewise.
* testsuite/poke.pkl/arrays-index-10.pk: Likewise.
* testsuite/poke.pkl/arrays-index-11.pk: Likewise.
* testsuite/poke.pkl/arrays-index-12.pk: Likewise.
* testsuite/poke.pkl/arrays-index-13.pk: Likewise.
* testsuite/poke.pkl/arrays-index-14.pk: Likewise.
* testsuite/poke.pkl/strings-index-3.pk: Likewise.
* testsuite/poke.pkl/strings-index-4.pk: likewise.
* testsuite/poke.pkl/strings-index-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Array Indexing): Document indexing by offset.
(String Indexing): Likewise.
2022-10-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Make unary operators take precedence over AS
and ISA.
* testsuite/poke.pkl/cast-integers-19.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-10-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_make_break_stmt): Remove.
(pkl_ast_make_break_continue_stmt): Renamed from
pkl_ast_make_continue_stmt.
(pkl_ast_node_free_1): Adapt accordingly.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-ast.h (enum pkl_ast_code): Rename
PKL_AST_CONTINUE_STMT to PKL_AST_BREAK_CONTINUE_STMT.
(enum pkl_ast_code): Remove PKL_AST_BREAK_STMT.
(PKL_AST_CONTINUE_STMT_KIND): Define.
(struct pkl_ast_break_continue_stmt): Renamed from
pkL_ast_continue_stmt.
(PKL_AST_BREAK_CONTINUE_STMT_BREAK): Define.
(PKL_AST_BREAK_CONTINUE_STMT_CONTINUE): Likewise.
* libpoke/pkl-tab.y: Adapt to the unified AST node.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-anal.c: Likewise.
* libpoke/pkl-trans.c: Likewise.
* etc/poke.rec (unify `break' and `continue' in the same AST
node): Removed as DONE.
2022-10-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-val.c (pvm_make_array_type): Fix assertion
for `bounder' to check that if it is a closure.
2022-10-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (_pk_bounder_unbounded): New function.
* poke/poke.c (set_script_args): Install a proper bounder in array
type.
* libpoke/libpoke.h: Fix doc string of pk_make_array_type.
2022-10-28 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.std/std-test.pk: Fix with_temp_ios test for
big-endian.
2022-10-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-diag.c (pkl_loc_to_source): Fix memory overrun.
2022-10-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-val.c (pvm_make_array_type): Add an assertion
for `bounder' to make sure it's not NULL.
2022-10-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (Describe-Compute): Fix Packet struct to use
constraint.
(Commands and Dot-Commands): Use `expression` and `function`
sub-cmd of `.vm disassemble`.
(Poking a SBM Image): Fix typo.
(Signed Weird Integers): Minor fix (s/byte/bit/).
(How Structs are Built): Fix example.
(Reserved fields): Likewise.
(Setters and Getters): Likewise.
(Loading pickles as Modules): Likewise.
(Field Constraints): Likewise.
(mem command): Explain invocation of .mem with no arg.
2022-10-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (mktya): Fix documentation.
* libpoke/pkl-rt.pk (_Pkl_ClsN): New type.
(_Pkl_ClsI): Likewise.
(_Pkl_ClsO): Likewise.
(_pkl_mkclsn): New function.
(_pkl_mkclsi): Likewise.
(_pkl_mkclso): Likewise.
2022-10-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def (isn): Remove instruction because we
already have the `nnn' instruction.
* libpoke/pvm.jitter: Likewise.
* libpoke/pkl-rt.pk (_pkl_print_format_any): Adapt.
2022-10-27 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (How `any' is handed in the PVM): New section.
* HACKING: Regenerate.
2022-10-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c: Do not include pvm-program.h.
2022-10-27 Arsen Arsenović <arsen@aarsen.me>
* bootstrap.conf (libpoke_modules): Add set, xset and
linkedhash-set.
* libpoke/pkl-ast.c (pkl_ast_node_free): Allocate a visitation
set, and move most code...
(pkl_ast_node_free_1): ... to here, so that we can track and avoid
freed nodes. Also, no longer consult IS_RECURSIVE for lifetime
information.
* testsuite/poke.pkl/recursion-bad-1.pk: New test.
* testsuite/poke.pkl/recursion-bad-2.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add the new tests.
2022-10-27 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Fix %destructors in parser): Removed as DONE.
(Do not leak decl AST nodes in parser): Likewise.
2022-10-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (integer): New rule.
(primary): Use it.
(integral_type_specifier): Likewise.
(offset_type_specifier): Likewise.
* testsuite/poke.pkl/offsets-diag-3.pk: New test.
* testsuite/poke.pkl/int-type-diag-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-10-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Fix array boundary
for types.
2022-10-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Handle PVM types.
2022-10-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen-attrs.pks (attr_size): Add `typof' and `nip'
instructions around `tyis*` instructions.
(attr_eoffset): Likewise.
(attr_esize): Likewise.
(attr_ename): Likewise.
(attr_elem): Likewise.
* libpoke/pkl-insn.def (isn): New instruction.
(isty): Likewise.
(tyigetsz): Likewise.
(tyigetsg): Likewise.
(tyisv): Likewise.
(tyogetm): Likewise.
(tyogetu): Likewise.
(tyagetn): Likewise.
(tyagett): Likewise.
(tyagetb): Likewise.
(tysctgetnf): Likewise.
(tysctgetfn): Likewise.
(tysctgetft): Likewise.
* libpoke/pkl-rt.pk (_pkl_print_format_any): Adapt.
* libpoke/pvm-val.c (pvm_typeof): Handle closure case (return
`PVM_NULL' as the type of closure).
* libpoke/pvm.jitter (isn): New instruction.
(isty): Likewise.
(tyigetsz): Likewise.
(tyigetsg): Likewise.
(tyisv): Likewise.
(tyogetm): Likewise.
(tyogetu): Likewise.
(tyagetn): Likewise.
(tyagett): Likewise.
(tyagetb): Likewise.
(tysctgetnf): Likewise.
(tysctgetfn): Likewise.
(tysctgetft): Likewise.
(tyisi): Adapt to expect type (not value).
(tyisiu): Likewise.
(tyisl): Likewise.
(tyislu): Likewise.
(tyiso): Likewise.
(tyiss): Likewise.
(tyisa): Likewise.
(tyisc): Likewise.
(tyissct): Likewise.
2022-10-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def (iolist): Remove instruction.
(ionum): New instruction.
(ioref): Likewise.
* libpoke/pvm.jitter (iolist): Remove instruction.
(ionum): New instruction.
(ioref): Likewise.
(late-c): Add callback functions to traverse IO space.
* libpoke/pkl-rt.pk (iolist): Re-write in terms of new
instructions.
2022-10-26 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Introduce SELF in methods): Removed as DONE.
2022-10-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (pushlevel_args): Register a named argument
"SELF" instead of a dummy.
* testsuite/poke.pkl/self-1.pk: New test.
* testsuite/poke.pkl/self-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Methods): Mention the SELF variable.
(Struct Methods): Likewise.
2022-10-25 Arsen Arsenović <arsen@aarsen.me>
* doc/Makefile.am (AM_MAKEINFOFLAGS): Enable the
`CHECK_NORMAL_MENU_STRUCTURE' flag.
* doc/poke.texi (Top): Add `Indices' to menu.
(Indices): Rename from Indicies (i.e. fix a typo).
2022-10-25 Arsen Arsenović <arsen@aarsen.me>
* pickles/dwarf-frame.pk: Set CFA constants to `uint<6>'
explicitly, to avoid `in' type errors.
* pickles/pe.pk: Set PE_DEBUG_TYPE constants to uint<32>,
PE_SUBSYS uint<16>, and cast alignemnt_info to uint<32> explicitly
to avoid `in' type errors.
* pickles/jffs2.pk: Se various constants to their right type
explicitly, to avoid `in' type errors.
* pickles/asn1-ber.pk: Explicitly set BER tags as uint<5>, to
avoid `in' type errors.
* pickles/dwarf-expr.pk: Explicitly set `DW_OP' constants to
uint<8>, to avoid `in' type errors.
* pickles/ctf.pk: Explicitly set kinds to uint<6>, to avoid `in'
type errors.
* pickles/coff-i386.pk: Explicitly set i386 relocation types to
uint<16>, to avoid `in' type error.
* pickles/dwarf-info.pk: Explicitly specify type in version
`constraint', to avoid `in' type error.
* pickles/elf-64.pk: Cast d_tag to int<32>, to avoid `in' type
errors.
* pickles/bpf.pk: Explicitly make instruction classes three-bit
uints.
* pickles/bmp.pk: Use unsigned offsets explicitly, to match header
type.
2022-10-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def (PKL_INSN_TYSCTN): Removed.
(PKL_INSN_TYSCTGETN): Added (renamed from PKL_INSN_TYSCTN).
* libpoke/pkl-rt.pk (_pkl_print_format_any): s/tysctn/tysctgetn/.
* libpoke/pvm.jitter (tysctn): Removed.
(tysctgetn): Added (renamed from tysctn).
2022-10-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-functions): Remove `pvm_make_any_type'.
(mktyany): Remove instruction.
* libpoke/pkl-insn.def (PKL_INSN_MKTYANY): Remove instruction.
* libpoke/pvm.h (pvm_make_any_type): Remove function decl.
* libpoke/pvm-val.h (enum pvm_type_code): Remove PVM_TYPE_ANY.
* libpoke/pk-val.c (pk_type_code): Remove case for PVM_TYPE_ANY.
(pk_make_any_type): Remove function def.
* libpoke/pkl-gen.c (pkl_gen_ps_type_any): Replace PKL_INSN_MKTYANY
with PVM_NULL. And use PVM_NULL as the result of construction.
* libpoke/pkl.c (pvm_type_to_ast_type): Remove case for PVM_TYPE_ANY.
* libpoke/pvm-val.c (any_type): Remove variable.
(pvm_make_any_type): Remove function.
(pvm_print_val_1): Remove case for PVM_TYPE_ANY.
(pvm_type_equal_p): Likewise.
(pvm_val_initialize): Remove `any_type'.
(pvm_val_finalize): Likewise.
* libpoke/libpoke.h (PK_TYPE_ANY): Remove macro.
(PK_TYPE_VOID): Add macro.
* libpoke/pkl-gen.pks (emit_tv_field_absent): s/mktyany/push null/.
(struct_field_mapper): Likewise.
2022-10-23 Arsen Arsenović <arsen@aarsen.me>
* doc/gen-pvm-insns.sh (SUBSECTIONS): Emit @pvindex calls for
insns.
* doc/poke.texi (PVM Instruction Index): New section.
(Indicies): New appendix.
(Concept Index): Move under Indicies and number using @appendixsec.
2022-10-23 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pickles/ustar-test.pk: Likewise.
* testsuite/poke.pickles/riscv-test.pk: Likewise.
* testsuite/poke.pickles/pe-test.pk: Likewise.
* testsuite/poke.pickles/openpgp-test.pk: Likewise.
* testsuite/poke.pickles/mcr-test.pk: Likewise.
* testsuite/poke.pickles/leb128-test.pk: Likewise.
* testsuite/poke.pickles/jffs-test.pk: Likewise.
* testsuite/poke.pickles/id3v2-test.pk: Likewise.
* testsuite/poke.pickles/dwarf-test.pk: Likewise.
* testsuite/poke.pickles/ctf-test.pk: Likewise.
* testsuite/poke.pickles/coff-test.pk: Likewise.
* testsuite/poke.pickles/bpf-ext-test.pk: Likewise.
* testsuite/poke.pickles/bpf-test.pk: Likewise.
* testsuite/poke.pickles/bmp-test.pk: Likewise.
* testsuite/poke.pickles/asn1-ber-test.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* testsuite/poke.pickles/elf-test.pk: New file.
2022-10-23 Arsen Arsenović <arsen@aarsen.me>
* AUTHORS: Add myself.
* etc/hacking.org (Write After Approval): Likewise.
* HACKING: Regenerate.
2022-10-22 Arsen Arsenović <arsen@aarsen.me>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_in): Don't allow
different types between LHS and element of RHS.
* libpoke/pkl-rt.pk: More strictly specify PK_TYPE_... constants,
to adhere to new `in' promotion rules.
* pickles/btf.pk: More strictly specify BTF_KIND_... constants, to
adhere to new `in' promotion rules.
* doc/poke.texi (Array Elements): Update documentation to match
new promotion behavior.
(Struct Attributes): Update `magic' field constraint to not fail
due to new promotion rules.
* testsuite/poke.pkl/in-3.pk: Refactor test to work with new `in'
promotion rules.
* testsuite/poke.pkl/in-2.pk: Likewise.
* testsuite/poke.pkl/in-1.pk: Likewise.
* testsuite/poke.pkl/field-init-9.pk: Likewise.
* testsuite/poke.pkl/field-init-12.pk: Likewise.
* testsuite/poke.pkl/field-init-11.pk: Likewise.
* testsuite/poke.pkl/field-init-10.pk: Likewise.
2022-10-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (aset): Do not check for ebounds nor sbounds.
2022-10-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_cast): In casts from any, make
sure that the target type has a bounder if it is an array type.
(pkl_gen_ps_isa): Likewise for `isa' operations.
2022-10-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Install array bounders in
function types that may need them.
(pkl_gen_pr_func_type_arg): Install bounders in function type
argument if necessary.
(pkl_gen_ps_type_function): Likewise for the return type.
2022-10-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (asetc): New macro.
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Require a bounder in
IN_TYPE context.
(pkl_gen_pr_array): Generate bounder of the type of array
literals.
(pkl_gen_pr_ass_stmt): Use ASETC instead of ASET.
* libpoke/pkl-asm.pks (array_conv_sel): Set closures as array type
bounders.
(array_conv_siz): Likewise.
* libpoke/pkl-fold.c (OP_BINARY_AAA_ADD): Add missing ASTREF.
* libpoke/pkl-gen.pks (array_mapper): Use IN_TYPE context to get
the type of the mapped array.
(array_constructor): Likewise for constructed arrays.
* libpoke/pkl-insn.def: New macro-instruction PKL_INSN_ASETC.
* libpoke/pkl-asm.c (pkl_asm_insn_asetc): New function.
(pkl_asm_insn): Handle PKL_INSN_ASETC.
* testsuite/poke.pkl/array-bound-1.pk: Update test.
* testsuite/poke.pkl/array-bound-2.pk: Likewise.
* testsuite/poke.pkl/array-bound-3.pk: Likewise.
* testsuite/poke.pkl/array-bound-4.pk: Likewise.
* testsuite/poke.pkl/array-bound-5.pk: New test.
* testsuite/poke.pkl/array-bound-6.pk: Likewise.
* testsuite/poke.pkl/array-bound-7.pk: Likewise.
* testsuite/poke.map/ass-map-27.pk: Likewise.
2022-10-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_asm_stmt): Do not check the result
of the asm statement for null.
(pkl_gen_pr_asm_exp): Likewise.
* testsuite/poke.pkl/asm-exp-5.pk: Remove.
* testsuite/poke.pkl/asm-stmt-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update accordingly.
2022-10-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_mapper): Install the sbound in the
new array type as an offset and not a bit-offset.
(array_constructor): Likewise, and do not traverse the array type
IN_TYPE to actually get a bounder.
* testsuite/poke.pkl/array-bound-1.pk: New test.
* testsuite/poke.pkl/array-bound-4.pk: Likewise.
* testsuite/poke.pkl/array-bound-3.pk: Likewise.
* testsuite/poke.pkl/array-bound-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-10-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/gen-pvm-insns.sh: s/egrep/grep -E/g.
2022-10-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-lex.l (integer_literal_width): New function to
calculate the width of integer literal.
(integer_literal_overflow_handling): New function to handle
overflow in integer literals.
(build_overflow_error_msg): New function to make integer literal
overflow errors.
(Alien token rule): Use new functions.
(Integer literal rule): Likewise.
* libpoke/pkl-tab.y (%union): Add new field `exception_msg'.
(INTEGER_OVERFLOW): Remove token.
(LEXER_EXCEPTION): New token.
(primary): Use LEXER_EXCEPTION instead of INTEGER_OVERFLOW.
* testsuite/poke.pkl/array-integ-33.pk: Adapt to new semantics.
* testsuite/poke.pkl/cdiv-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/mod-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/mod-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/neg-int-overflow-1.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/integers-diag-2.pk: Likewise.
* testsuite/poke.pkl/int-union-28.pk: Likewise.
2022-10-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_ASM_STMT_EXPANDED_TEMPLATE): Likewise.
(PKL_AST_ASM_EXP_EXPANDED_TEMPLATE): Remove.
* libpoke/pkl-ast.c: Remove expanded_template.
* libpoke/pkl-trans.c (pkl_trans2_ps_asm_stmt): Remove handler.
(pkl_trans2_ps_asm_exp): Likewise.
* libpoke/pkl-asm.c (pkl_asm_from_string): Expand the given
template before assembling.
* testsuite/poke.pkl/asm-exp-diag-5.pk: New test.
* testsuite/poke.pkl/asm-stmt-diag-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-10-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (PK_PRINT_F_MAPS): Remove.
(PK_PRINT_F_PPRINT): Likewise.
(pk_print_val_with_params): Remove function prototype.
* libpoke/libpoke.c (pk_print_val_with_params): Remove function.
* testsuite/poke.libpoke/values.c (testcase_pk_val_equal_p): Use
pk_print_val instead of pk_print_val_with_params.
2022-10-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk: Change documentation of TV_FIELD_MAPPED.
* libpoke/pkl-gen.pks (struct_field_mapper): Do not pass a
formatted_value to the TV_FIELD_MAPPED tracing event.
* poke/pk-tracer.pk (pk_tv_action_field_mapped): Do not get a
formatted_value argument and format the value instead.
2022-10-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Auto-Remapping): New section.
(@code{vm_autoremap}): Likewise.
(@code{vm_set_autoremap}): Likewise.
2022-10-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ops.def: Define PKL_AST_OP_REMAP.
* libpoke/pkl-lex.l: Recognize token `remap'.
* libpoke/pkl-tab.y: New token REMAP.
(unary_operator): Syntax for the `remap' operator.
* libpoke/pkl-typify.c (pkl_typify1_ps_op_remap): New handler.
(pkl_phase_typify1): Register new handler.
* libpoke/pkl-gen.c (pkl_gen_ps_op_remap): New handler.
(pkl_phase_gen): Register new handler.
(pkl_gen_ps_var): Use AREMAP instead of REMAP.
(pkl_gen_pr_indexer): Likewise.
(pkl_gen_ps_struct_ref): Likewise.
* libpoke/pkl-insn.def: New macro-instruction AREMAP.
* libpoke/pkl-asm.c (pkl_asm_insn_aremap): New function.
(pkl_asm_insn): Hanlde PKL_INSN_AREMAP.
* libpoke/pkl-asm.pks (atrim): Use aremap intead of remap.
* testsuite/poke.map/remap-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-10-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Prototypes for pk_autoremap and
pk_set_autoremap.
* libpoke/libpoke.c (pk_autoremap): New function.
(pk_set_autoremap): Likewise.
* libpoke/pvm.h: Prototypes for pvm_autoremap and
pvm_set_autoremap.
* libpoke/pvm.c (pvm_autoremap): New function.
(pvm_set_autoremap): Likewise.
* libpoke/pvm.jitter (state-struct-runtime-c): Add field
`autoremap' to the VM.
(state-initialization-c): Initialize `autoremap' to the default
value 0.
(pusharem): New instruction.
(poparem): Likewise.
* libpoke/pkl-rt.pk (vm_autoremap): New function.
(vm_set_autoremap): Likewise.
* poke/pk-settings.pk: Add new setting `autoremap'.
* libpoke/pkl-asm.pks (remap): Acknowledge autoremap.
* testsuite/poke.cmd/set-autoremap-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-10-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-10-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Remove PKL_INSN_INDENT.
* libpoke/pvm.jitter (indent): Remove instruction.
2022-10-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (integral_printer): Remove.
(integral_formater): Likewise.
(format_int_suffix): Likewise.
(print_int_suffix): Likewise.
(indent_if_tree): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_type_integral): Use the any
printer and formater for integral values.
* libpoke/pkl-rt.pk (_pkl_format_int_suffix): Remove.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (offset_printer): Remove.
(offset_formater): Likewise.
(format_boffset): Likewise.
(print_boffset): Likewise.
(string_printer): Likewise.
(string_formater): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_offset): Use the any printer
and formatter for offset values.
(pkl_gen_ps_type_string): Likewise.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Fix handling of
odepth and of depth.
(_pkl_print_any): Set default value of depth to 0.
(_pkl_format_any): Likewise.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_PRINTER): Remove.
(PKL_AST_TYPE_S_FORMATER): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Remove struct
printers and formatters.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Do not compile closures for
struct printers and formatters.
(pkl_gen_pr_type_struct): Use the `any' printer/formater for
struct values.
* libpoke/pkl-gen.pks (struct_printer): Remove.
(struct_formater): Likewise.
(typifier_formater_wrapper): Likewise.
(struct_typifier): Do not fill in struct formatters/printers.
* libpoke/pkl-rt.pk: Remove fields `printer' and `formater'.
(_pkl_indentation): Remove function.
* testsuite/poke.pkl/format-19.pk: Adapt test.
* testsuite/poke.pkl/printf-value-15.pk: Likewise.
* testsuite/poke.pkl/printf-value-12.pk: Likewise.
* testsuite/poke.pkl/printf-value-11.pk: Likewise.
* testsuite/poke.pkl/format-28.pk: Likewise.
* testsuite/poke.pkl/format-20.pk: Likewise.
* testsuite/poke.pkl/typeof-13.pk: Remove test.
* testsuite/poke.pkl/typeof-14.pk: Likewise.
* testsuite/poke.pkl/typeof-15.pk: Likewise.
* testsuite/poke.pkl/typeof-16.pk: Likewise.
* testsuite/poke.pkl/typeof-21.pk: Likewise.
2022-10-12 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Fix indentation
for struct formatter.
2022-10-12 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.c (pk_print_val): Use `pk_call' properly.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Use
any_printer/formatter instead of array_printer/formatter macros.
* libpoke/pkl-gen.pks (array_printer): Remove.
(array_formater): Likewise.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_formater): Turn into a macro.
(array_printer): Likewise.
(array_typifier): Do not fill in `printer' and `formatter' fields.
* libpoke/pkl-ast.h (PKL_AST_TYPE_A_PRINTER): Remove.
(PKL_AST_TYPE_A_FORMATER): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_array_type): Do not initialize
A_PRINTER nor A_FORMATER.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Remove handling of arrays
and structs printers and formatters.
(pkl_gen_pr_type_array): Use macros for printer and formatter.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Use `integer' styling
class.
2022-10-12 Jose E. Marchesi <jemarch@gnu.org>,
* libpoke/libpoke.c (pk_print_val): Use _pkl_print_any instead of
the C printer.
* testsuite/poke.cmd/maps-alien-1.pk: Expect padded digits and
prefixes in output integrals.
* testsuite/poke.pkl/open-sub-6.pk: Likewise.
* testsuite/poke.pkl/open-sub-9.pk: Likewise.
* testsuite/poke.pkl/optcond-1.pk: Likewise.
* testsuite/poke.pkl/optcond-11.pk: Likewise.
* testsuite/poke.pkl/optcond-2.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-1.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-10.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-2.pk: Likewise.
* testsuite/poke.pkl/pow-integers-1.pk: Likewise.
* testsuite/poke.pkl/pow-offsets-1.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-5.pk: Likewise.
* testsuite/poke.pkl/sl-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/sl-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/scons-65.pk: Likewise.
* testsuite/poke.pkl/scons-56.pk: Likewise.
* testsuite/poke.map/map-struct-offset-5.pk: Likewise.
* testsuite/poke.map/map-struct-offset-4.pk: Likewise.
* testsuite/poke.map/map-optcond-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/sr-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/sr-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/sl-offsets-2.pk: Likewise.
* testsuite/poke.pkl/sl-integers-3.pk: Likewise.
* testsuite/poke.pkl/sl-integers-2.pk: Likewise.
* testsuite/poke.pkl/sr-integers-2.pk: Likewise.
* testsuite/poke.pkl/sr-integers-1.pk: Likewise.
* testsuite/poke.pkl/sr-offsets-2.pk: Likewise.
* testsuite/poke.pkl/sr-offsets-1.pk: Likewise.
* testsuite/poke.pkl/strings-esc-1.pk: Likewise.
* testsuite/poke.pkl/strings-esc-2.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-2.pk: Likewise.
* testsuite/poke.pkl/ior-offsets-1.pk: Likewise.
* testsuite/poke.pkl/ior-integers-1.pk: Likewise.
* testsuite/poke.pkl/bconc-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/bconc-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/int-union-30.pk: Likewise.
* testsuite/poke.pkl/int-union-29.pk: Likewise.
* testsuite/poke.pkl/int-union-23.pk: Likewise.
* testsuite/poke.pkl/int-union-19.pk: Likewise.
* testsuite/poke.pkl/cast-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/band-integers-1.pk: Likewise.
* testsuite/poke.pkl/array-integ-9.pk: Likewise.
* testsuite/poke.pkl/array-integ-8.pk: Likewise.
* testsuite/poke.pkl/array-integ-34.pk: Likewise.
* testsuite/poke.pkl/array-integ-30.pk: likewise.
* testsuite/poke.pkl/array-integ-29.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/add-int-struct-4.pk: Likewise.
* testsuite/poke.pkl/bconc-7.pk: Likewise.
* testsuite/poke.pkl/bconc-6.pk: Likewise.
* testsuite/poke.pkl/bconc-5.pk: Likewise.
* testsuite/poke.pkl/bconc-4.pk: Likewise.
* testsuite/poke.pkl/bconc-3.pk: Likewise.
* testsuite/poke.map/maps-int-structs-28.pk: Likewise.
* testsuite/poke.map/maps-int-structs-27.pk: Likewise.
* testsuite/poke.map/maps-int-structs-26.pk: Likewsie.
* testsuite/poke.map/maps-int-structs-25.pk: Likewise.
* testsuite/poke.map/maps-unions-method-2.pk: Likewise.
* testsuite/poke.map/maps-uint-write-15.pk: Likewise.
* testsuite/poke.map/maps-structs-labels-2.pk: Likewise.
* testsuite/poke.map/maps-structs-labels-1.pk: Likewise.
* testsuite/poke.map/maps-structs-6.pk: Likewise.
* testsuite/poke.map/maps-structs-5.pk: Likewise.
* testsuite/poke.map/maps-structs-2.pk: Likewise.
* testsuite/poke.map/maps-structs-13.pk: Likewise.
* testsuite/poke.map/maps-ios-9.pk: Likewise.
* testsuite/poke.map/maps-ios-7.pk: Likewise.
* testsuite/poke.map/maps-ios-8.pk: Likewise.
* testsuite/poke.map/maps-ios-6.pk: Likewise.
* testsuite/poke.map/maps-ios-5.pk: Likewise.
* testsuite/poke.map/maps-ios-4.pk: Likewise.
* testsuite/poke.map/maps-ios-2.pk: Likewise.
* testsuite/poke.map/map-struct-offset-3.pk: Likewise.
* testsuite/poke.pkl/pos-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/not-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/mul-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/mul-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/mul-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/ior-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/ior-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/ior-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/div-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/div-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/div-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/band-offsets-1.pk: Likewise.
* testsuite/poke.pkl/band-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/band-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/band-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/add-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/add-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/add-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/sub-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/sub-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/sub-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/typeof-25.pk: Likewise.
* testsuite/poke.pkl/vm-set-obase-1.pk: Likewise.
* testsuite/poke.pkl/cast-integers-10.pk: Likewise.
* testsuite/poke.pkl/cast-integers-11.pk: Likewise.
* testsuite/poke.pkl/xor-integers-2.pk: Likewise.
* testsuite/poke.pkl/xor-offsets-2.pk: Likewise.
* testsuite/poke.map/nsmap-6.pk: Likewise.
* testsuite/poke.map/trimmed-map-2.pk: Likewise.
* testsuite/poke.map/trimmed-map-3.pk: Likewise.
* testsuite/poke.map/trimmed-map-4.pk: Likewise.
* testsuite/poke.map/trimmed-map.pk: Likewise.
* testsuite/poke.map/unmap-1.pk: Likewise.
* testsuite/poke.map/write-structs-1.pk: Likewise.
* testsuite/poke.map/write-unions-2.pk: Likewise.
* testsuite/poke.map/write-unions-3.pk: Likewise.
* testsuite/poke.map/maps-int-structs-11.pk: Likewise.
* testsuite/poke.map/maps-int-49.pk: Likewise.
* testsuite/poke.map/maps-int-47.pk: Likewise.
* testsuite/poke.map/maps-int-46.pk: Likewise.
* testsuite/poke.map/maps-int-44.pk: Likewise.
* testsuite/poke.map/maps-int-43.pk: Likewise.
* testsuite/poke.map/maps-int-42.pk: Likewise.
* testsuite/poke.map/maps-int-40.pk: Likewise.
* testsuite/poke.map/maps-int-39.pk: Likewise.
* testsuite/poke.map/maps-int-38.pk: Likewise.
* testsuite/poke.map/maps-int-36.pk: Likewise.
* testsuite/poke.map/maps-int-35.pk: Likewise.
* testsuite/poke.map/maps-int-34.pk: Likewise.
* testsuite/poke.map/maps-int-32.pk: Likewise.
* testsuite/poke.map/maps-int-30.pk: Likewise.
* testsuite/poke.map/maps-int-26.pk: Likewise.
* testsuite/poke.map/maps-int-24.pk: Likewise.
* testsuite/poke.map/maps-int-23.pk: Likewise.
* testsuite/poke.map/maps-int-22.pk: Likewise.
* testsuite/poke.map/maps-int-21.pk: Likewise.
* testsuite/poke.map/maps-int-20.pk: Likewise.
* testsuite/poke.map/maps-int-19.pk: Likewise.
* testsuite/poke.map/maps-int-18.pk: Likewise.
* testsuite/poke.map/maps-int-13.pk: Likewise.
* testsuite/poke.map/maps-int-11.pk: Likewise.
* testsuite/poke.map/maps-int-09.pk: Likewise.
* testsuite/poke.map/maps-int-05.pk: Likewise.
* testsuite/poke.cmd/set-obase-2.pk: Likewise.
* testsuite/poke.cmd/set-obase-4.pk: Likewise.
* testsuite/poke.map/ass-map-3.pk: Likewise.
* testsuite/poke.map/ass-map-9.pk: Likewise.
* testsuite/poke.map/ass-map-10.pk: Likewise.
* testsuite/poke.map/ass-map-11.pk: Likewise.
* testsuite/poke.map/ass-map-14.pk: Likewise.
* testsuite/poke.map/ass-map-15.pk: Likewise.
* testsuite/poke.map/ass-map-17.pk: Likewise.
* testsuite/poke.map/ass-map-19.pk: Likewise.
* testsuite/poke.map/ass-map-22.pk: Likewise.
* testsuite/poke.map/ass-map-23.pk: Likewise.
* testsuite/poke.map/ass-map-24.pk: Likewise.
* testsuite/poke.map/ass-map-25.pk: Likewise.
* testsuite/poke.map/map-struct-offset-2.pk: Likewise.
* testsuite/poke.map/map-struct-fun-3.pk: Likewise.
* testsuite/poke.map/map-size-3.pk: Likewise.
* testsuite/poke.map/map-size-2.pk: Likewise.
* testsuite/poke.map/map-size-1.pk: Likewise.
* testsuite/poke.map/ass-map-struct-int-1.pk: Likewise.
* testsuite/poke.map/maps-arrays-20.pk: Likewise.
2022-10-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Do not emit negative
written forms for numeration bases other than 10.
2022-10-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Pad digits when
printing out integral values for bases other than 10.
2022-10-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Handle struct
pretty-printers.
2022-10-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Fix assembly template
for struct_type_name and avoid calling vm_odepth twice.
2022-10-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal2_ps_asm_stmt): New handler.
(pkl_anal2_ps_asm_exp): Likewise.
* libpoke/pkl-anal.c (pkl_phase_anal2): Register new handlers.
2022-10-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Use the "special"
formatting class to print #<...> strings.
2022-10-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def: /PKL_DEF_INSN/s/, /,/g to not make troubles
for Apple cpp (see IMPORTANT2 note in file).
2022-10-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_any): `depth' defaults to 1.
(_pkl_format_any): Likewise.
(_pkl_print_format_any): Support for struct types.
2022-10-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Simplify
handle_integral.
2022-10-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (_pkl_print_format_any): Make argument `depth'
non-optional.
Use named arguments in calls to handle_integral for sake of
clarity.
2022-10-10 Jose E. Marchesi <jemarch@gnu.org>,
* libpoke/pkl-insn.def (PKL_INSN_TYISI): Define.
(PKL_INSN_TYISIU): Likewise.
(PKL_INSN_TYISL): Likewise.
(PKL_INSN_TYISLU): Likewise.
(PKL_INSN_TYISS): Likewise.
(PKL_INSN_TYISO): Likewise.
* libpoke/pvm.jitter (tyisi): New instruction.
(tyisiu): Likewise.
(tyisl): Likewise.
(tyislu): Likewise.
(tyiso): Likewise.
* libpoke/pkl-rt.pk (_Pkl_Print_Format_Ctx): New type.
(_pkl_print_format_any): New function.
(_pkl_print_any): Likewise.
(_pkl_format_any): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_format): Allow arguments of
type `any' in format.
* libpoke/pkl-gen.c (pkl_gen_ps_type_any): Implement printer and
formatter for values of type `any'.
* libpoke/pkl-gen.pks (any_printer): New macro.
(any_formater): Likewise.
* testsuite/poke.pkl/printf-diag-17.pk: Remove test.
* testsuite/poke.pkl/print-any-1.pk: New test.
* testsuite/poke.pkl/print-any-2.pk: Likewise.
* testsuite/poke.pkl/print-any-3.pk: Likewise.
* testsuite/poke.pkl/format-any-1.pk: Likewise.
* testsuite/poke.pkl/format-any-2.pk: Likewise.
* testsuite/poke.pkl/format-any-3.pk: Likewise.
2022-10-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_RAND): Remove.
(PKL_AST_BUILTIN_GET_ENDIAN): Likewise.
(PKL_AST_BUILTIN_SET_ENDIAN): Likewise.
(PKL_AST_BUILTIN_GET_IOS): Likewise.
(PKL_AST_BUILTIN_IOSIZE): Likewise.
(PKL_AST_BUILTIN_GET_TIME): Likewise.
(PKL_AST_BUILTIN_STRACE): Likewise.
(PKL_AST_BUILTIN_TERM_BEGIN_CLASS): Likewise.
(PKL_AST_BUILTIN_TERM_END_CLASS): Likewise.
(PKL_AST_BUILTIN_TERM_BEGIN_HYPERLINK): Likewise.
(PKL_AST_BUILTIN_TERM_END_HYPERLINK): Likewise.
(PKL_AST_BUILTIN_IOFLAGS): Likewise.
(PKL_AST_BUILTIN_SLEEP): Likewise.
(PKL_AST_BUILTIN_VM_OBASE): Likewise.
(PKL_AST_BUILTIN_VM_SET_OBASE): Likewise.
(PKL_AST_BUILTIN_VM_OPPRINT): Likewise.
(PKL_AST_BUILTIN_VM_SET_OPPRINT): Likewise.
(PKL_AST_BUILTIN_VM_OACUTOFF): Likewise.
(PKL_AST_BUILTIN_VM_SET_OACUTOFF): Likewise.
(PKL_AST_BUILTIN_VM_ODEPTH): Likewise.
(PKL_AST_BUILTIN_VM_SET_ODEPTH): Likewise.
(PKL_AST_BUILTIN_VM_OINDENT): Likewise.
(PKL_AST_BUILTIN_VM_SET_OINDENT): Likewise.
(PKL_AST_BUILTIN_VM_OMAPS): Likewise.
(PKL_AST_BUILTIN_VM_SET_OMAPS): Likewise.
(PKL_AST_BUILTIN_VM_OMODE): Likewise.
(PKL_AST_BUILTIN_VM_SET_OMODE): Likewise.
(PKL_AST_BUILTIN_UNSAFE_STRING_SET): Likewise.
(PKL_AST_BUILTIN_IOHANDLER): Likewise.
(PKL_AST_BUILTIN_IOLIST): Likewise.
* libpoke/pkl-gen-builtins.pks (builtin_rand): Remove.
(builtin_get_endian): Likewise.
(builtin_set_endian): Likewise.
(builtin_get_ios): Likewise.
(builtin_iosize): Likewise.
(builtin_ioflags): Likewise.
(builtin_iobias): Likewise.
(builtin_iolist): Likewise.
(builtin_iosetbias): Likewise.
(builtin_flush): Likewise.
(builtin_get_time): Likewise.
(builtin_sleep): Likewise.
(builtin_strace): Likewise.
(builtin_term_begin_class): Likewise.
(builtin_term_end_class): Likewise.
(builtin_term_begin_hyperlink): Likewise.
(builtin_term_end_hyperlink): Likewise.
(builtin_vm_obase): Likewise.
(builtin_vm_set_obase): Likewise.
(builtin_vm_opprint): Likewise.
(builtin_vm_set_opprint): Likewise.
(builtin_vm_oacutoff): Likewise.
(builtin_vm_set_oacutoff): Likewise.
(builtin_vm_odepth): Likewise.
(builtin_vm_set_odepth): Likewise.
(builtin_vm_oindent): Likewise.
(builtin_vm_set_oindent): Likewise.
(builtin_vm_omaps): Likewise.
(builtin_vm_set_omaps): Likewise.
(builtin_vm_omode): Likewise.
(builtin_vm_set_omode): Likewise.
(builtin_unsafe_string_set): Likewise.
* libpoke/pkl-rt.pk (rand): Reimplement with inlined asm.
(get_endian): Likewise.
(set_endian): Likewise.
(get_ios): Likewise.
(set_ios): Likewise.
(iosize): Likewise.
(iohandler): Likewise.
(ioflags): Likewise.
(iobias): Likewise.
(iosetbias): Likewise.
(flush): Likewise.
(get_time): Likewise.
(sleep): Likewise.
(strace): Likewise.
(term_begin_class): Likewise.
(term_end_class): Likewise.
(term_begin_hyperlink): Likewise.
(term_end_hypelink): Likewise.
(vm_obase): Likewise.
(vm_set_obase): Likewise.
(vm_opprint): Likewise.
(vm_set_opprint): Likewise.
(vm_oacutoff): Likewise.
(vm_set_oacutoff): Likewise.
(vm_odepth): Likewise.
(vm_set_odepth): Likewise.
(vm_oindent): Likewise.
(vm_set_oindent): Likewise.
(vm_omaps): Likewise.
(vm_set_omaps): Likewise.
(vm_omode): Likewise.
(vm_set_omode): Likewise.
(__pkl_unsafe_string_set): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Remove builtins now
implemented with asm statements.
* libpoke/pkl-tab.y (builtin): Adjust rule accordingly.
* libpoke/pkl-lex.l: Remove rules for builtins.
2022-10-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: New token ASM.
Rule for ASM statements and expressions.
* libpoke/pkl-lex.l: Recognize token ASM.
* libpoke/pkl-ast.h (PKL_AST_ASM_STMT_TEMPLATE): Define.
(PKL_AST_ASM_STMT_INPUTS): Likewise.
(PKL_AST_ASM_STMT_OUTPUTS): Likewise.
(PKL_AST_ASM_STMT_EXPANDED_TEMPLATE): Likewise.
(PKL_AST_ASM_EXP_TEMPLATE): Likewise.
(PKL_AST_ASM_EXP_TYPE): Likewise.
(PKL_AST_ASM_EXP_INPUTS): Likewise.
(PKL_AST_ASM_EXP_EXPANDED_TEMPLATE): Likewise.
(struct pkl_ast_asm_stmt): New struct.
(struct pkl_ast_asm_exp): Likewise.
(union pkl_ast_node): New fields asm_exp and asm_stmt.
* libpoke/pkl-ast.c (pkl_ast_make_asm_stmt): New function.
(pkl_ast_make_asm_exp): Likewise.
(pkl_ast_node_free): Handle asm statement and expression nodes.
(pkl_ast_print_1): Likewise.
(pkl_ast_make_ass_stmt): Allow building ass_stmt AST nodes without
r-value.
* libpoke/pkl-pass.c (pkl_do_pass_1): Traverse asm statement and
asm expression nodes.
(pkl_do_pass_1): `exp' may be NULL in ass_stmt.
* libpoke/pkl-trans.c (pkl_trans1_ps_asm_stmt): New handler.
(pkl_trans2_ps_asm_stmt): Likewise.
(pkl_trans2_ps_asm_exp): Likewise.
(pkl_phase_trans1): Register handler.
(pkl_phase_trans2): Register handlers.
* libpoke/pkl-typify.c (pkl_typify1_ps_asm_stmt): New handler.
(pkl_typify1_ps_asm_exp): Likewise.
(pkl_phase_typify1): Register new handlers.
(pkl_typify1_ps_ass_stmt): `exp' may be NULL.
* libpoke/pkl-promo.c (pkl_promo_ps_ass_stmt): Do not promote
anything if `exp' is NULL.
* libpoke/pkl-gen.c (pkl_gen_pr_asm_exp): New handler.
(pkl_gen_pr_asm_stmt): Likewise.
(pkl_phase_gen): Register handlers.
(pkl_gen_pr_ass_stmt): Do not subpass in EXP if it is null.
* libpoke/pkl-asm.c (pkl_asm_from_string): New function.
* libpoke/pvm-program.h: Prototype for pvm_program_parse_from_string.
* libpoke/pvm-program.c (pvm_program_parse_from_string): New function.
* libpoke/pkl-rt.pk: New exception E_stack.
* libpoke/libpoke.h (PK_EC_STACK): Define.
* libpoke/pvm.h (PVM_E_STACK): Likewise.
(PVM_E_STACK_NAME): Likewise.
(PVM_E_STACK_ESTATUS): Likewise.
* testsuite/poke.pkl/asm-stmt-diag-1.pk: New test.
* testsuite/poke.pkl/asm-stmt-diag-2.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-diag-3.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-diag-4.pk: Likewise.
* testsuite/poke.pkl/asm-exp-diag-1.pk: Likewise.
* testsuite/poke.pkl/asm-exp-diag-2.pk: Likewise.
* testsuite/poke.pkl/asm-exp-diag-3.pk: Likewise.
* testsuite/poke.pkl/asm-exp-diag-4.pk: Likewise.
* testsuite/poke.pkl/asm-exp-1.pk: Likewise.
* testsuite/poke.pkl/asm-exp-2.pk: Likewise.
* testsuite/poke.pkl/asm-exp-3.pk: Likewise.
* testsuite/poke.pkl/asm-exp-4.pk: Likewise.
* testsuite/poke.pkl/asm-exp-5.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-1.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-2.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-3.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-4.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-5.pk: Likewise.
* testsuite/poke.pkl/asm-stmt-6.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Assembler): New chapter.
2022-10-06 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-tracer.pk (pk_tv_action_field_mapped): Get a Pk_Type as
the second argument of the event.
* libpoke/pkl-gen.pks (struct_field_mapper): Pass the Pk_Type of
the field type to the TV_FIELD_MAPPED event.
2022-10-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_op_typeof): Move logic to the
typeof RAS macro, and use the macro.
* libpoke/pkl-gen.pks (typeof): New macro.
2022-10-06 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe.pk (PE_File): Fix the location of the sections table.
2022-10-05 Jose E. Marchesi <jemarch@gnu.org>
* pickles/coff.pk (COFF_Name): Add pretty-printer.
* pickles/pe.pk (PE_File): Map the symtab by size.
(PE_Sym): Fix definition.
2022-10-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_formater): Support formatting absent
fields in structs.
* testsuite/poke.pkl/format-optcond-1.pk: New test.
* testsuite/poke.pkl/format-optcond-2.pk: Likewise.
* testsuite/poke.pkl/foramt-optcond-3.pk: Likewise.
* testsuite/poke.pkl/format-optcond-4.pk: Likewise.
* testsuite/poke.pkl/format-optcond-5.pk: Likewise.
* testsuite/poke.pkl/format-optcond-6.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-10-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: (struct_type_field_opcond_pre): New rule.
(struct_type_field_optcond_post): Likewise.
* libpoke/pkl-ast.h (PKL_AST_STRUCT_TYPE_FIELD_OPTCOND_PRE): New macro.
(PKL_AST_STRUCT_TYPE_FIELD_OPTCOND_POST): Renamed from OPTCOND.
(struct pkl_ast_struct_type_field): New field optcond_pre and
optcond renamed to optcond_post.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type_field): Handle both
optcond_pre and optcond_post.
(pkl_ast_dup_type): Likewise.
(pkl_ast_sizeof_type): Likewise.
(pkl_ast_type_is_complete): Likewise.
(pkl_ast_node_free): Likewise.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-anal.c (pkl_anal2_ps_type_struct): Support both
optcond_pre and optcond_post.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-promo.c (pkl_promo_ps_struct_type_field): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct): Likewise.
(pkl_typify1_ps_type_struct): Likewise.
* libpoke/pvm-val.c (pvm_print_val_1): Do not print offset for
absent fields in omaps.
* libpoke/pkl-gen.pks (handle_struct_field_constraints): Likewise.
(struct_comparator): Likewise.
(struct_field_mapper): Likewise.
* testsuite/poke.pkl/optcond-pre-diag-1.pk: New test.
* testsuite/poke.pkl/optcond-pre-diag-2.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-1.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-2.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-3.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-4.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-5.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-6.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-7.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-8.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-9.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-10.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-11.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-12.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-write-1.pk: Likewise.
* testsuite/poke.map/map-optcond-pre-write-2.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-1.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-2.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-3.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-4.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-5.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-6.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-7.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-8.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-9.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-10.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-11.pk: Likewise.
* testsuite/poke.pkl/optcond-pre-12.pk: Likewise.
* testsuite/poke.map/map-optcond-write-1.pk: Renamed from
map-opcond-write-1.pk.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Pretty-printers): Use prefix optional field
conditions.
(Optional Fields): Rewrite to document both prefix and suffix
conditional expressions in optional fields.
* pickles/pe.pk: Adapted to use pre conditional expressions.
* pickles/elf-64.pk: Likewise.
* pickles/elf-32.pk: Likewise.
* pickles/btf-ext.pk: Likewise.
* pickles/coff.pk: Likewise.
* pickles/id3v2.pk: Likewise.
* pickles/jffs2.pk: Likewise.
* pickles/openpgp.pk: Likewise.
2022-10-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe-arm64.pk (PE_ARM64_Reloc): New type.
* pickles/pe.pk (PE_Reloc): Use ARM64 relocs.
(PE_Opt_Hdr): data_start only exists if not PE32+.
2022-10-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (PK_TV_FIELD_ABSENT): Define.
(PK_TV_NUM_EVENTS): Adjust.
* libpoke/pkl.h (PK_TV_FIELD_ABSENT): Define.
* libpoke/pkl-gen.pks (handle_struct_field_constraints): Generate
a PK_TV_FIELD_ABSENT event whenever necessary.
(struct_constructor): Likewise.
* poke/pk-tracer.pk (pk_tv_action_field_absent): New function.
2022-10-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_mapper): Handle anonymous
fields in PK_TV_FIELD_MAPPED events.
* poke/pk-tracer.pk (pk_tv_action_field_mapped): Print <anonymous>
for empty field names.
2022-10-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk: Note that PK_TV_FIELD_MAPPED is generated
before constraints are checked.
* libpoke/pkl-gen.pks (struct_field_mapper): Adjust accordingly.
2022-10-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_mapper): Force flat omode when
formatting values for PK_TV_FIELD_MAPPED events.
2022-10-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe.pk (PE_Opt_Hdr): Fix the constraint for
file_alignment.
2022-10-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (PK_TV_FIELD_CONSTRAINT_FAILED): New variable.
(PK_TV_NUM_EVENTS): Update.
* libpoke/pkl.h (PK_TV_FIELD_CONSTRAINT_FAILED): Define.
2022-10-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (pk_tracer_p): New variable.
(PK_TV_FIELD_MAPPED): Likewise.
(PK_TV_NUM_EVENTS): Likewise.
(Pk_Tracer_Action): New type.
(Pk_Tracer_Dispatch_Table): Likewise.
(pk_tracer_dispatch): New variable.
* libpoke/pkl.h: Prototype for pkl_tracer_p.
(PK_TV_FIELD_MAPPED): Define.
* libpoke/pkl.c (pkl_tracer_p): New function.
* libpoke/ras: Support referring to tracing events with PK_TV_*.
* libpoke/pkl-gen.pks (struct_field_mapper): Generate
PK_TV_FIELD_MAPPED.
* poke/pk-tracer.pk: New file.
* poke/poke.pk: Load pk-tracer.pk.
* poke/pk-settings.pk: Add setting for tracer.
* poke/Makefile.am (dist_app_DATA): Add pk-tracer.pk.
2022-10-03 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe.pk (PE_Load_Configuration_Layout): New type.
(PE_GUARD_*): New variables.
2022-10-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-diag.h: Prototype for pkl_loc_to_source.
* libpoke/pkl-diag.c (pkl_loc_to_source): New function.
* libpoke/pkl-tab.y (pkl_make_assertion): Call pkl_loc_to_source.
* pickles/pe.pk: Use asserts without explicit message.
* pickles/color.pk: Likewise.
* pickles/asn1-ber.pk: Likewise.
* pickles/mcr.pk: Likewise.
* pickles/rgb24.pk: Likewise.
* testsuite/poke.pkl/assert-6.pk: New test.
* testsuite/poke.pkl/assert-7.pk: Likewise.
* testsuite/poke.pktest/pktest-11.pk: Adapt test.
* testsuite/poke.pktest/pktest-7.pk: Likewise.
* testsuite/poke.pktest/pktest-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (assert): Document new behavior.
2022-10-03 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe-debug.pk: New file.
* pickles/pe.pk (PE_Debug_Directory_Entry): New type.
Load pe-debug.pk.
(PE_Name): New method match_p.
* pickles/Makefile.am (dist_pickles_DATA): Add pe-debug.pk and
pe-riscv.pk.
2022-10-03 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe.pk: Load architecture-specific PE parts.
* pickles/coff.pk (COFF_LINENO): New type.
(COFF_Shdr): Use COFF_LINENO instead of COFF_LINENO_16.
(COFF_Sym): e_scnum is signed.
(COFF_N_ABS): Make negative.
(COFF_N_DEBUG): Likewise.
* pickles/coff-pe.pk: Remove file.
* pickles/pe-i386.pk: New file.
* pickles/pe-ia64.pk: Likewise.
* pickles/pe-mips.pk: Likewise.
* pickles/pe-amd64.pk: Likewise.
* pickles/pe-arm.pk: Likewise.
* pickles/pe-arm64.pk: Likewise.
* pickles/pe-sh3.pk: Likewise.
* pickles/pe-ppc.pk: Likewise.
* pickles/pe-m32r.pk: Likewise.
* pickles/Makefile.am (dist_pickles_DATA): Add new pickles.
2022-10-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/coff-pe.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add coff-pe.pk.
* pickles/coff.pk (COFF_RELOC): Add alternative for PE/COFF
relocations.
2022-10-02 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am: Add missing file header.
* pickles/Makefile.am: Likewise.
* maps/Makefile.am: Likewise.
2022-10-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pe.pk: New file.
* pickles/coff.pk: Remove 64-bit optional header, which is
actually the PE one.
* pickles/Makefile.am (dist_pickles_DATA): Add pe.pk
2022-10-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/coff.pk: New file.
* pickles/coff-i386.pk: Likewise.
* pickles/coff-aarch64.pk: Likewise.
* pickles/Makefile.am (dist_pickles_DATA): Add new pickles.
2022-09-30 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Field Labels): Expand with an additional example.
2022-09-30 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Writing REPL tests): Fix typo.
(General REPL tests): Fix ordering.
(Command REPL tests): Likewise.
(PVM values in AST nodes): Update to new implementation.
2022-09-26 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support bit-concatenation in l-value): Removed as
done.
(Union integrators and deintegrators): Likewise.
2022-09-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (struct pkl_ast_comp_stmt): New field
frameless_p.
(PKL_AST_COMP_STMT_FRAMELESS_P): Define.
* libpoke/pkl-gen.c (pkl_gen_pr_comp_stmt): Do not generate a
pushf for frameless compound statements.
(pkl_gen_ps_comp_stmt): Likewise for popf.
* libpoke/pkl-ast.h: Prototype for pkl_ast_handle_bconc_ass_stmt.
* libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt): New function.
* libpoke/pkl-trans.c (pkl_trans2_pr_ass_stmt): New rule.
(pkl_phase_trans2): Register new rule.
* libpoke/pkl-typify.c (pkl_typify1_ps_ass_stmt): Check the width
of r-values assigned to bconc expressions.
* testsuite/poke.pkl/bconc-lvalue-diag-1.pk: New test.
* testsuite/poke.pkl/bconc-lvalue-diag-2.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-1.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-2.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-3.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-4.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-5.pk: Likewise.
* testsuite/poke.pkl/bconc-lvalue-6.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Bit Assignments): New section.
2022-09-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/riscv.pk (RV32_InsnFmt_S): Add computed field `imm'
(hence add `set_imm' method).
(RV32_InsnFmt_B): Likewise.
(RV32_InsnFmt_J): Likewise.
(RV32_InsnFmt_U): s/imm/imm31_12/. Add computed field `imm'
(hence add `set_imm' method).
(RV32_InsnFmt_I): s/imm/imm11_0/. Add computed field `imm'
(hence add `set_imm' method).
(_rv32_i): s/imm/imm11_0/.
(_rv32_u): s/imm/imm31_12/.
2022-09-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-tab.y (tokens): s/token/%token/.
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Handle integral
unions.
(pkl_typify1_ps_type_struct): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Likewise.
(pkl_gen_pr_decl): Likewise.
(pkl_gen_pr_cast): In cast from an integral type to struct type,
add a cast to ITYPE of the struct.
* libpoke/pkl-gen.pks (RAS_FUNCTION_UNION_INTEGRATOR): New function.
(RAS_FUNCTION_UNION_DEINTEGRATOR): Likewise.
(RAS_FUNCTION_STRUCT_INTEGRATOR): Add assertion.
(RAS_FUNCTION_STRUCT_DEINTEGRATOR): Likewise.
* doc/poke.texi (Integral Unions): Add new section.
* testsuite/poke.pkl/int-union-1.pk: New test.
* testsuite/poke.pkl/int-union-2.pk: Likewise.
* testsuite/poke.pkl/int-union-3.pk: Likewise.
* testsuite/poke.pkl/int-union-4.pk: Likewise.
* testsuite/poke.pkl/int-union-5.pk: Likewise.
* testsuite/poke.pkl/int-union-6.pk: Likewise.
* testsuite/poke.pkl/int-union-7.pk: Likewise.
* testsuite/poke.pkl/int-union-8.pk: Likewise.
* testsuite/poke.pkl/int-union-9.pk: Likewise.
* testsuite/poke.pkl/int-union-10.pk: Likewise.
* testsuite/poke.pkl/int-union-11.pk: Likewise.
* testsuite/poke.pkl/int-union-12.pk: Likewise.
* testsuite/poke.pkl/int-union-13.pk: Likewise.
* testsuite/poke.pkl/int-union-14.pk: Likewise.
* testsuite/poke.pkl/int-union-15.pk: Likewise.
* testsuite/poke.pkl/int-union-16.pk: Likewise.
* testsuite/poke.pkl/int-union-17.pk: Likewise.
* testsuite/poke.pkl/int-union-18.pk: Likewise.
* testsuite/poke.pkl/int-union-19.pk: Likewise.
* testsuite/poke.pkl/int-union-20.pk: Likewise.
* testsuite/poke.pkl/int-union-21.pk: Likewise.
* testsuite/poke.pkl/int-union-22.pk: Likewise.
* testsuite/poke.pkl/int-union-23.pk: Likewise.
* testsuite/poke.pkl/int-union-24.pk: Likewise.
* testsuite/poke.pkl/int-union-25.pk: Likewise.
* testsuite/poke.pkl/int-union-26.pk: Likewise.
* testsuite/poke.pkl/int-union-27.pk: Likewise.
* testsuite/poke.pkl/int-union-28.pk: Likewise.
* testsuite/poke.pkl/int-union-29.pk: Likewise.
* testsuite/poke.pkl/int-union-30.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-1.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-2.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-3.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-4.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-5.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-6.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-7.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-8.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-9.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-10.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-11.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-12.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-13.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-14.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-15.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-16.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-17.pk: Likewise.
* testsuite/poke.pkl/int-union-type-diag-18.pk: Likewise.
* testsuite/poke.map/maps-int-union-1.pk: Likewise
* testsuite/poke.map/maps-int-union-2.pk: Likewise
* testsuite/poke.map/maps-int-union-3.pk: Likewise
* testsuite/poke.map/maps-int-union-4.pk: Likewise
* testsuite/poke.map/maps-int-union-5.pk: Likewise
* testsuite/poke.pkl/int-struct-type-diag-3.pk: Adapted.
* testsuite/poke.pkl/int-struct-type-diag-4.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-5.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-11.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-16.pk: Removed.
* testsuite/poke.pkl/int-struct-type-diag-17.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-09-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (function struct_constructor): Do not alter
items that are already on the stack because `raise' will restore
the height of stack and the caller will see garbage on the stack.
(function struct_deintegrator): Likewise.
2022-09-25 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk: Do not set the CWD to load_path here.
* poke/poke.pk: Do it here instead.
2022-09-24 Arsen Arsenović <arsen@aarsen.me>
* poke/poke.c: Prefer $XDG_CONFIG_HOME to $XDG_CONFIG_DIRS, even
when unset.
2022-09-24 Jose E. Marchesi <jemarch@gnu.org>
BZ 27481
* etc/hacking.org: Fix spelling mistakes.
* NEWS: Likewise.
* ChangeLog: Likewise.
* doc/poke.texi: Likewise.
* etc/parse-valgrind-suppressions.sh: Likewise.
* etc/poke.rec: Likewise.
* libpoke/ios.h: Likewise.
* libpoke/pkl-gen.pks: Likewise.
* libpoke/pkl-trans.c: Likewise.
* libpoke/pkl-gen-builtins.pks: Likewise.
* libpoke/pkl-promo.c: Likewise.
* libpoke/pkl-asm.pks: Likewise.
* libpoke/std.pk: Likewise.
* libpoke/ios-dev-stream.c: Likewise.
* libpoke/ras: Likewise.
* libpoke/pvm.h: Likewise.
* libpoke/pkl-gen.h: Likewise.
* libpoke/pkl-anal.c: Likewise.
* libpoke/pkl-typify.c: Likewise.
* libpoke/ios-buffer.c: Likewise.
* libpoke/pkl-fold.c: Likewise.
* libpoke/ios-dev-mem.c: Likewise.
* libpoke/pkl-tab.y: Likewise.
* libpoke/pkl-ast.h: Likewise.
* libpoke/pvm.jitter: Likewise.
* libpoke/pkl-gen.c: Likewise.
* libpoke/pvm-val.c: Likewise.
* libpoke/ios.c: Likewise.
* libpoke/pvm-val.h: Likewise.
* libpoke/pkl.c: Likewise.
* pickles/elf-common.pk: Likewise.
* pickles/asn1-ber.pk: Likewise.
* pickles/ios.pk: Likewise.
* pickles/dwarf-pubnames.pk: Likewise.
* pickles/jffs2.pk: Likewise.
* poke/pk-cmd-ios.c: Likewise.
* poke/pk-settings.pk: Likewise.
* poke/poke.pk: Likewise.
* poke/pk-map-parser.h: Likewise.
* poke/poke.c: Likewise.
* poke/pk-cmd-editor.c: Likewise.
* poke/pk-help.pk: Likewise.
* testsuite/poke.repl/repl.exp: Likewise.
* testsuite/poke.std/std.exp: Likewise.
* HACKING: Regenerate.
2022-09-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Do not allow casts
to unions.
* testsuite/poke.pkl/cast-union-diag-1.pk: New test.
* testsuite/poke.pkl/cast-union-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Casting Structs): Note that casts to unions are
not allowed.
2022-09-23 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (with_temp_ios): Removed as DONE.
(casts from integral to array and from array to integral):
Likewise.
(Support for offline method definitions): New enhancement.
2022-09-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ios.pk: Do not use standard types.
2022-09-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/pk-table.pk: Do not use standard types.
2022-09-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/mbr.pk (MBR_CHS): Add computed field `cylinder'.
* testsuite/poke.pickles/mbr-test.pk: Adapt accordingly.
2022-09-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/id3v1.pk: Convert to use computed fields.
* testsuite/poke.pickles/id3v1-test.pk: Adapted accordingly.
2022-09-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Recognize token COMPUTED.
* libpoke/pkl-ast.h (PKL_AST_STRUCT_TYPE_FIELD_COMPUTED_P): Define.
(struct pkl_ast_struct_type_field): New field computed_p.
(struct pkl_ast_type): New field `ncfield' for struct types.
(PKL_AST_TYPE_S_NCFIELD): Define.
* libpoke/pkl-ast.c (pkl_ast_print_1): Print the computed_p
attribute of struct type fields.
(pkl_ast_sizeof_type): Do not count computed fields for the size
of the struct.
(pkl_ast_dup_type): Duplicate computed flag in struct type fields.
(pkl_ast_type_mappable_p): Do not include computed fields in
determining whether a struct type is mappable.
(pkl_ast_type_is_complete): Do not include computed fields in
determining whether a struct type is complete.
(pkl_ast_type_is_complete): Likewise for union types.
(pkl_type_append_to): Append `computed' for computed fields in
type descriptors.
* libpoke/pkl-tab.y: New token COMPUTED.
(struct_type_computed_field): New rule.
(struct_type_elem_list): Add struct_type_computed_field as an
alternative.
* libpoke/pkl-anal.c (pkl_anal2_ps_type_struct): adapt to computed
fields.
* libpoke/pkl-trans.c (pkl_trans1_ps_type_struct): Do not include
computed fields in the nfield count and initialize ncfield.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Check methods
for computed fields.
(pkl_typify1_ps_cons): Do not allow specifying computed fields in
struct constructors.
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Handle computed fields.
(pkl_gen_ps_struct_ref): Likewise.
(pkl_gen_pr_struct_type_field): Do not include computed fields in
PVM struct types.
* libpoke/pkl-gen.pks (struct_constructor): Do not construct
computed fields.
(struct_mapper): Likewise.
(struct_writer): Likewise.
(struct_integrator): Likewise.
(struct_deintegrator): Likewise.
(union_comparator): Likewise.
(struct_comparator): Likewise.
(union_writer): Likewise.
(struct_formater): Likewise.
(struct_printer): Likewise.
(struct_typifier): Likewise.
* libpoke/pkl-rt.pk (Pk_Type): New field fcomputed.
* poke/pk-info.pk (pk_info_type): Display info on computed fields.
* testsuite/poke.pkl/computed-diag-1.pk: New test.
* testsuite/poke.pkl/computed-diag-2.pk: Likewise.
* testsuite/poke.pkl/computed-diag-3.pk: Likewise.
* testsuite/poke.pkl/computed-diag-4.pk: Likewise.
* testsuite/poke.pkl/computed-diag-5.pk: Likewise.
* testsuite/poke.pkl/computed-diag-6.pk: Likewise.
* testsuite/poke.pkl/computed-diag-7.pk: Likewise.
* testsuite/poke.pkl/computed-diag-8.pk: Likewise.
* testsuite/poke.pkl/computed-diag-9.pk: Likewise.
* testsuite/poke.pkl/computed-diag-10.pk: Likewise.
* testsuite/poke.pkl/computed-diag-11.pk: Likewise.
* testsuite/poke.pkl/computed-1.pk: Likewise.
* testsuite/poke.pkl/computed-2.pk: Likewise.
* testsuite/poke.pkl/computed-3.pk: Likewise.
* testsuite/poke.pkl/computed-4.pk: Likewise.
* testsuite/poke.pkl/computed-5.pk: Likewise.
* testsuite/poke.pkl/computed-6.pk: Likewise.
* testsuite/poke.pkl/computed-7.pk: Likewise.
* testsuite/poke.pkl/computed-8.pk: Likewise.
* testsuite/poke.pkl/computed-9.pk: Likewise.
* testsuite/poke.pkl/computed-10.pk: Likewise.
* testsuite/poke.pkl/computed-11.pk: Likewise.
* testsuite/poke.pkl/computed-12.pk: Likewise.
* testsuite/poke.pkl/computed-13.pk: Likewise.
* testsuite/poke.pkl/computed-14.pk: Likewise.
* testsuite/poke.pkl/computed-15.pk: Likewise.
* testsuite/poke.pkl/computed-16.pk: Likewise.
* testsuite/poke.pkl/computed-17.pk: Likewise.
* testsuite/poke.pkl/computed-18.pk: Likewise.
* testsuite/poke.pkl/typeof-26.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Computed Fields): New section.
2022-09-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_DECL_TYPE): Remove.
2022-09-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/elf-32.pk (Elf32_File.get_section_name): New method.
(Elf32_File.get_symbol_name): Likewise.
(Elf32_File.get_sections_by_name): Likewise.
(Elf32_File.get_sections_by_type): Likewise.
(Elf32_File.section_name_p): Likewise.
(Elf32_File.get_string): Likewise.
(Elf32_File.get_group_signature): Likewise.
(Elf32_File.get_group_signatures): Likewise.
(Elf32_File.get_section_group): Likewise.
2022-09-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/elf-64.pk (Elf64_File.get_sections_by_name): Use `apush'.
(Elf64_File.get_sections_by_type): Likewise.
(Elf64_File.get_group_signatures): Likewise.
(Elf64_File.get_section_group): Likewise.
2022-09-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/riscv.pk: New pickle for RISC-V RV32I instruction set.
* pickles/Makefile.am (dist_pickles_DATA): Update.
* etc/hacking.org (Maintainers): Add myself as the maintainer of
the pickle.
* HACKING: Update.
2022-09-17 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (poked_restart): Close all IO spaces before
restarting the daemon.
2022-09-17 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (poked_chan_send): Force Poke to make a copy of
data before putting into the buffer.
2022-09-01 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-lex.l (IS): Add lower-case b to `IS' definition.
(Integer literal rule): Accept lower-case b as a valid suffix.
* doc/learn-poke-language-in-y-minutes.pk: Add a line about integer
suffixes.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* testsuite/poke.pkl/integers-8.pk: New test.
* testsuite/poke.pkl/integers-9.pk: Likewise.
* testsuite/poke.pkl/integers-10.pk: Likewise.
2022-07-25 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump version to 2.4.
* doc/gendocs_template: Likewise.
* NEWS: Add entries for 2.4.
2022-07-20 Jose E. Marchesi <jemarch@gnu.org>
* pickles/mbr.pk (MBR_CHS): Use unnammed type for the `cs' field.
2022-07-20 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map-tab.y (make_map_entry): Set condition_loc.
(tagged_value): Use location of DATA for the tag's location.
* poke/pk-map-parser.h (struct pk_map_parsed_entry): New field
condition_loc.
(PK_MAP_PARSED_ENTRY_CONDITION_LOC): Define.
(PK_MAP_NOLOC): Define.
* poke/pk-map.c (pk_map_load_parsed_map): Use
pk_compile_buffer_with_loc and pk_compile_expression_with_loc.
2022-07-20 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec): Use pk_compile_statement_with_loc
and pk_compile_buffer_with_loc.
2022-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-diag.c (pkl_warning): Use <unknown> for unknown
source/location.
(pkl_error_internal): Likewise.
2022-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-parser.h: Add location info to pkl_parse_buffer.
(struct pkl_parser): Add fields init_line and init_column.
* libpoke/pkl-parser.c (pkl_parse_buffer): Likewise.
(pkl_parse_buffer): Fix initial location to 1:1 instead of 0:0.
* libpoke/pkl.h: Add location info to pkl_execute_buffer.
Add location info to pkl_execute_expression.
Add location info to pkl_execute_statement.
* libpoke/pkl.c (pkl_execute_buffer): Likewise.
(pkl_execute_statement): Likewise.
(pkl_execute_expression): Likewise.
* libpoke/libpoke.h: Prototype for pk_compile_buffer_with_loc.
Prototype for pk_compile_statement_with_loc.
Prototype for pk_compile_expression_with_loc.
* libpoke/libpoke.c (pk_compile_buffer_with_loc): New function.
(pk_compile_buffer): Reimplement in terms of
pk_compile_buffer_with_loc.
(pk_compile_statement_with_loc): New function.
(pk_compile_statement): Reimplement in terms of
pk_compile_statement_with_loc.
(pk_compile_expression_with_loc): New function.
(pk_compile_expression): Reimplement in terms of
pk_compile_expression_with_loc.
* libpoke/pkl-tab.y (%initial-action): Use pkl_parser->init_line
and pkl_parser->init_column to initialize the location
information.
2022-07-19 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Simple Init File): Add `.set pager yes' to the
set of recommended options for new users and explain all the
options a little.
2022-07-19 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-scrabble.pk (Arguments): Move variable declaration out
of loop to avoid extra allocations.
2022-07-19 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (qsort): Add example of a comparator function for
qsort and fix comparator prototype.
2022-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (declaration): Move annotation of function
names to trans1.
* libpoke/pkl-trans.c (pkl_trans1_pr_decl): Annotate declared
function names.
2022-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-parser.h (struct pkl_parser): New field prev_loc.
* libpoke/pkl-parser.c (pkl_parser_init): Initialize
parser->prev_loc.
* libpoke/pkl-lex.l (YY_USER_ACTION): Save a backup of the current
location.
(PK_REJECT): Define.
(RESTORE_LOC): Define.
2022-07-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (pkl_ast_finish_breaks): Remove.
* libpoke/pkl-ast.c (pkl_ast_finish_breaks): Likewise.
(pkl_ast_finish_breaks_1): Likewise.
* libpoke/pkl-tab.y (stmt): Likewise.
* libpoke/pkl-trans.h (struct pkl_trans_escapable_ctx): New struct.
(PKL_TRANS_MAX_COMP_STMT_NEST): New macro.
(struct pkl_trans_payload): Add new fields.
* libpoke/pkl-trans.c (PKL_TRANS_ESCAPABLE): New macro.
(PKL_TRANS_PUSH_ESCAPABLE): Likewise.
(PKL_TRANS_POP_ESCAPABLE): Likewise.
(pkl_trans1_pr_comp_stmt): Add logic to track lexical frames around
`break` and `continue` keywords.
(pkl_trans1_ps_comp_stmt): Likewise.
(pkl_trans1_pr_loop_stmt): Likewise.
(pkl_trans1_ps_loop_stmt): Likewise.
(pkl_trans1_pr_try_stmt_body): Likewise.
(pkl_trans1_ps_try_stmt_body): Likewise.
(pkl_trans1_pr_try_stmt): New handler.
(pkl_trans1_ps_try_stmt): Likewise.
(pkl_trans1_pr_try_stmt_handler): Likewise.
(pkl_trans1_ps_try_stmt_handler): Likewise.
(pkl_trans1_ps_break_stmt): Likewise.
(pkl_trans1_ps_continue_stmt): Likewise.
(pkl_phase_trans1): Register new handlers.
2022-07-17 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* etc/hacking.org (try_stmt): Update the topology.
* HACKING (try_stmt): Update.
* libpoke/pkl-ast.h (enum pkl_ast_code): Add
PKL_AST_TRY_STMT_HANDLER.
(PKL_AST_TRY_STMT_HANDLER_CODE): New macro.
(struct pkl_ast_try_stmt_handler): New struct.
(pkl_ast_make_try_stmt_handler): New function.
(union pkl_ast_node): Add `try_stmt_handler`.
* libpoke/pkl-ast.c (pkl_ast_make_try_stmt_handler): New function.
(pkl_ast_node_free): Add case for TRY_STMT_HANDLER.
(pkl_ast_print_1): Likewise.
(pkl_ast_finish_breaks_1): Likewise.
* libpoke/pkl-tab.y (stmt): Adapt to use
`pkl_ast_make_try_stmt_handler` in try-catch statements.
* libpoke/pkl-pass.c (pkl_do_pass_1): Add case for TRY_STMT_HANDLER.
* libpoke/pkl-gen.c (pkl_gen_ps_try_stmt_handler): New handler.
(pkl_phase_gen): Register new handler.
2022-07-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (struct pkl_ast_var): New field is_indexed.
(struct pkl_ast_indexer): Likewise.
(PKL_AST_VAR_IS_INDEXED): Define.
(PKL_AST_INDEXER_IS_INDEXED): Likewise.
* libpoke/pkl-trans.c (pkl_trans1_ps_var): Annotate is_indexed.
(pkl_trans1_ps_indexer): New handler.
(pkl_phase_trans1): Register new handler.
* libpoke/pkl-gen.c (pkl_gen_ps_var): Avoid remapping arrays when
indexing elements when the array type is complete and can be
mapped.
(pkl_gen_pr_indexer): Ditto for array indexers themselves.
2022-07-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ios.pk (ios_save_bytes): Adapted from poke/pk-save.pk.
(ios_copy_bytes): Adapted from poke/pk-copy.pk.
(ios_dump_bytes): Do not use types from std-types.pk.
* poke/pk-copy.pk (copy): Rewrite in terms of ios_copy_bytes.
* poke/pk-save.pk (save): Rewrite in terms of ios_save_bytes.
* doc/poke.texi (IOS): New chapter.
(ios_dump_bytes): New section.
(ios_copy_bytes): Likewise.
(ios_save_bytes): Likewise.
2022-07-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-extract.pk (extract): Make `to' optional and report the
IOS where the value got extracted.
* doc/poke.texi (extract): Update accordingly.
2022-07-15 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Building with Debugging support): Recommend
CFLAGS="-O0 -g3" for debugging.
2022-07-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Update comments.
* libpoke/pkl-trans.c: Remove obsolete comments.
* etc/hacking.org (exp): New section.
(cond_exp): Likewise.
2022-07-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_pr_comp_stmt): Merge common parts
under a single if statement.
(pkl_trans1_ps_comp_stmt): Likewise.
2022-07-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.h (struct pkl_trans_function_ctx): Define.
* libpoke/pkl-trans.c (pkl_trans_in_functions): Adapt to new
stack.
(PKL_TRANS_FUNCTION_BACK): Delete macro.
(PKL_TRANS_INCR_FUNCTION_BACK): Likewise.
(PKL_TRANS_DECR_FUNCTION_BACK): Likewise.
(PKL_TRANS_DECR_FUNCTION_NDROPS): Likewise.
(PKL_TRANS_DECR_FUNCTION_NPOPES): Likewise.
(PKL_TRANS_FUNCTION_NDROPS): Likewise.
(PKL_TRANS_INCR_FUNCTION_NDROPS): Likewise.
(PKL_TRANS_FUNCTION_NPOPES): Likewise.
(PKL_TRANS_INCR_FUNCTION_NPOPES): Likewise.
Update phase handlers accordingly.
2022-07-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (pkl_ast_finish_returns): Remove.
* libpoke/pkl-ast.c (pkl_ast_finish_returns): Likewise.
(pkl_ast_finish_returns_1): Likewise.
* libpoke/pkl-tab.y (function_specifier): Likewise.
(declaration): Likewise.
* libpoke/pkl-trans.h (struct pkl_trans_payload): Add new fields
`function_ndrops` and `function_npopes`.
* libpoke/pkl-trans.c (PKL_TRANS_FUNCTION_NDROPS): New macro.
(PKL_TRANS_INCR_FUNCTION_NDROPS): Likewise.
(PKL_TRANS_DECR_FUNCTION_NDROPS): Likewise.
(PKL_TRANS_FUNCTION_NPOPES): Likewise.
(PKL_TRANS_INCR_FUNCTION_NPOPES): Likewise.
(PKL_TRANS_DECR_FUNCTION_NPOPES): Likewise.
(PKL_TRANS_PUSH_FUNCTION): Adapt.
(pkl_trans1_pr_comp_stmt): Count ndrops and npopes.
(pkl_trans1_ps_comp_stmt): Likewise.
(pkl_trans1_pr_loop_stmt): Likewise.
(pkl_trans1_ps_loop_stmt): Likewise.
(pkl_trans1_ps_return_stmt): New handler.
(pkl_trans1_pr_try_stmt_body): Likewise.
(pkl_trans1_ps_try_stmt_body): Likewise.
(struct pkl_phase_trans1): Register new handlers.
* libpoke/pkl-gen.c (pkl_gen_ps_return_stmt): Fix comment.
* testsuite/poke.pkl/return-3.pk: New test.
* testsuite/poke.pkl/return-4.pk: Likewise.
* testsuite/poke.pkl/return-5.pk: Likewise.
* testsuite/poke.pkl/return-6.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-07-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (enum pkl_ast_code): Define PKL_AST_TRY_STMT
and PKL_AST_TRY_STMT_BODY, and remove PKL_AST_TRY_UNTIL_STMT and
PKL_AST_TRY_CATCH_STMT.
(PKL_AST_TRY_CATCH_STMT_BODY): Rename from PKL_AST_TRY_CATCH_STMT_CODE.
(struct pkl_ast_try_catch_stmt): Field `code' renamed to `body'.
(PKL_AST_TRY_STMT_KIND_CATCH): Define.
(PKL_AST_TRY_STMT_KIND_UNTIL): Likewise.
(struct pkl_ast_try_catch_stmt_body): New type.
(PKL_AST_TRY_UNTIL_STMT_CODE): Remove.
(PKL_AST_TRY_UNTIL_STMT_EXP): Likewise.
(struct pkl_ast_try_until_stmt): Likewise.
(PKL_AST_TRY_STMT_BODY_CODE): Define.
(PKL_AST_TRY_CATCH_STMT_KIND): Define.
* libpoke/pkl-ast.c (pkl_ast_make_try_until_stmt): Remove.
(pkl_ast_node_free): Adapt to new AST.
(pkl_ast_finish_breaks_1): Likewise.
(pkl_ast_print_1): Likewise.
(pkl_ast_make_try_stmt_body): Define.
(pkl_ast_make_try_stmt): Rename from pkl_ast_make_try_catch_stmt.
* libpoke/pkl-pass.c (pkl_do_pass_1): Adapt to new AST.
* libpoke/pkl-tab.y (stmt): Adapt to new AST.
* libpoke/pkl-typify.c (pkl_typify1_ps_try_stmt): Renamed and
adapted from pkl_typify1_ps_try_catch_stmt.
* libpoke/pkl-gen.c (pkl_gen_pr_try_stmt): Renamed and adapted
from pkl_gen_pr_try_catch_stmt.
(pkl_gen_ps_try_stmt_body): New handler.
(pkl_phase_gen): Install new handler.
* etc/hacking.org (try Statements): New section.
* HACKING: Regenerate.
2022-07-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_FUNC_NFRAMES): Remove.
(PKL_AST_RETURN_STMT_NFRAMES): Likewise.
(struct pkl_ast_func): Remove `nframes` field.
(struct pkl_ast_return_stmt): Likewise.
* libpoke/pkl-ast.c (pkl_ast_finish_returns_1): Remove `nframes` arg.
(pkl_ast_finish_returns): Update.
2022-07-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_pr_decl): Do not pushing current function
to the stack of functions here.
(pkl_trans1_pr_func): Do it here.
(pkl_trans1_ps_decl): Remove handler.
(pkl_phase_trans1): Register new handler.
* testsuite/poke.pkl/lambda-5.pk): Add new test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-07-11 Jose E. Marchesi <jose.marchesi@oracle.com>
* pickles/ctf.pk (ctf_get_dict): Raise an assert instead of
E_inval.
2022-07-10 Jose E. Marchesi <jose.marchesi@oracle.com>
* pickles/ctf-frame.pk: Fix indentation and replace tabs with
whitespaces.
* pickles/ctf-frame-dump.pk: Likewise.
2022-07-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_op_excond): Invert the logic of excond
operator.
* doc/poke.texi (exception predicate): Update to new semantics.
* libpoke/std.pk (with_temp_ios): Likewise.
libpoke/std.pk (with_cur_ios): Likewise.
* pickles/asn1-ber.pk (BER_Data_Value.isdefinite): Likewise.
* pickles/btf-dump.pk (btf_dump_type_vdata): Likewise.
* pickles/ctf-dump.pk (ctf_dump_func): Likewise.
* pickles/diff.pk (diff_structured): Likewise.
* testsuite/poke.pkl/excond-1.pk: Likewise.
* testsuite/poke.pkl/excond-2.pk: Likewise.
* testsuite/poke.pkl/excond-3.pk: Likewise.
* testsuite/poke.pkl/excond-4.pk: Likewise.
* testsuite/poke.std/std-test.pk: Likewise.
2022-07-08 Jose E. Marchesi <jose.marchesi@oracle.com>
* pickles/btf.pk (BTF_Int): Turn `encoding' into a nested integral
struct.
* pickles/btf-dump.pk (btf_dump_int): Update accordingly.
2022-07-08 Jose E. Marchesi <jose.marchesi@oracle.com>
* pickles/btf-dump.pk (btf_dump_var): Use btf_var_linkage_names.
(btf_dump_func): New function.
(btf_dump_type_vdata): Call btf_dump_func whenever appropriate.
* pickles/btf.pk (BTF_VAR_STATIC): Define.
(BTF_VAR_GLOBAL_ALLOCATED): Likewise.
(BTF_VAR_GLOBAL_EXTERN): Likewise.
(BTF_FUNC_STATIC): Likewise.
(BTF_FUNC_GLOBAL): Likewise.
(BTF_FUNC_EXTERN): Likewise.
(btf_var_linkage_names): Likewise.
(btf_func_linkage_names): Likewise.
(BTF_Type.info._print): Print linkage whenever appropriate.
(BTF_Variable): Add pretty-printer.
2022-04-10 Jose E. Marchesi <jemarch@gnu.org>
* pickles/search.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add search.pk.
2022-07-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/search.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add search.pk.
2022-07-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def (PKL_INSN_IOLIST): Define.
* libpoke/pvm.jitter (iolist): New instruction.
* libpoke/pkl-lex.l: Recognize token __PKL_BUILTIN_IOLIST__.
* libpoke/pkl-tab.y: Likewise.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_IOLIST): Define.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Handle
PKL_AST_BUILTIN_IOLIST.
* libpoke/pkl-gen-builtins.pks (builtin_iolist): Define.
* libpoke/pkl-rt.pk (iolist): New builtin.
* testsuite/poke.pkl/iolist-1.pk: New test.
* testsuite/poke.pkl/iolist-2.pk: Likewise.
* testsuite/poke.pkl/iolist-3.pk: Likewise.
* testsuite/poke.pkl/iolist-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (iolist): New section.
2022-06-05 apache2 <apache2@ageinghacker.net>
* libpoke/ios-dev-file.c (ios_dev_file_pread): Avoid slow unneeded
seeks.,
2022-05-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Add an explicative message
for union alternative constraint exceptions.
(struct_constructor): Likewise.
* testsuite/poke.pkl/union-constraint-1.pk: New test.
* testsuite/poke.pkl/union-constraint-2.pk: Likewise.
* testsuite/poke.pkl/union-constraint-3.pk: Likewise.
* testsuite/poke.pkl/union-constraint-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-04-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (Pk_With_Ios_Fn): New type.
(Pk_Temp_Ios_Generator): Likewise.
(with_temp_ios): New function.
(with_cur_ios): Likewise.
* testsuite/poke.std/std-test.pk: Tests for with_temp_ios and
with_cur_ios.
* doc/poke.texi (with_temp_ios): New section.
(with_cur_ios): Likewise.
2022-04-12 Jose E. Marchesi <jemarch@gnu.org>
* pickles/openpgp.pk (PGP_Packet): Remove pretty-printer. Use an
internal UID type and use #<uid:...> marks in its pretty-printer.
2022-04-11 Jose E. Marchesi <jemarch@gnu.org>
2022-04-11 Jose E. Marchesi <jemarch@gnu.org>
* pickles/openpgp.pk (PGP_Packet): Add constraint to check that
the payload size matches with the declared length in the header.
2022-04-11 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Exceptions): Remove mention to E_map_bounds.
(Array Constructors): Update.
(Array maps bounded by number of elements): Likewise.
(Array maps bounded by size): Likewise.
2022-04-11 Jose E. Marchesi <jemarch@gnu.org>
* pickles/diff.pk: Correct handling of boundaries constraint
error.
2022-04-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_constructor): Add explicative message
to E_constraint raised from unsatisfied array boundaries.
(array_mapper): Likewise.
2022-04-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_mapper): Raise PVM_E_CONSTRAINT
instead of PVM_E_MAP_BOUNDS in case of array bound failure.
(array_constructor): Likewise.
* libpoke/libpoke.h (PK_EC_MAP_BOUNDS): Remove.
* libpoke/pkl-rt.pk (E_map_bounds): Likewise.
* libpoke/pvm.h (PVM_E_MAP_BOUNDS): Likewise.
(PVM_E_MAP_BOUNDS_NAME): Likewise.
(PVM_E_MAP_BOUNDS_ESTATUS): Likewise.
* pickles/diff.pk: Adapt accordingly.
* testsuite/poke.pkl/scons-union-12.pk: New test.
* testsuite/poke.pkl/scons-union-13.pk: Likewise.
* testsuite/poke.pkl/scons-union-14.pk: Likewise.
* testsuite/poke.map/maps-unions-14.pk: Likewise.
* testsuite/poke.map/maps-unions-15.pk: Likewise.
* testsuite/poke.map/maps-unions-16.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-04-10 Jose E. Marchesi <jemarch@gnu.org>
* pickles/openpgp.pk (PGP_MPI): The `len' field is big endian.
2022-04-10 Jose E. Marchesi <jemarch@gnu.org>
* pickles/openpgp.pk (PGP_Packet_Header): Do not print a newline
in the pretty-printer.
(PGP_MPI): Likewise.
2022-04-10 Jose E. Marchesi <jemarch@gnu.org>
* pickles/openpgp.pk (PGP_V3_Packet_Length): Use tag logic to get
the union value.
(PGP_V4_Packet_Length): fix units.
(PGP_Packet_Header): Use the right method name.
(PGP_Key_Flags): Add missing semicolon.
(PGP_File): Fix type name for PGP_Packet.
2022-04-09 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.h (pvm_assert): Add more parameters.
(PVM_ASSERT): New macro.
* libpoke/pvm.c (pvm_assert): Replace `assert` with an implementation.
(assert.h): Remove #include.
* libpoke/pvm.jitter (PVM_PRINTI): s/pvm_assert/PVM_ASSERT/.
(PVM_FORMATI): Likewise.
(PVM_FORMATU): Likewise.
(exit): Likewise.
(call): Likewise.
(asettb): Likewise.
(strace): Likewise.
2022-04-09 Jose E. Marchesi <jemarch@gnu.org>
* pickles/openpgp.pk: New file.
2022-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-repl.c: Include ctype.h.
2022-04-08 Jose E. Marchesi <jose.marchesi@oracle.com>
* libpoke/pkl-gen.c (pkl_gen_ps_func): Fix E_no_return location in
lambdas.
2022-04-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Prototype for pkl_ast_format_loc.
* libpoke/pkl-ast.c (pkl_ast_format_loc): New function.
* libpoke/pkl-gen.c (pkl_gen_ps_func): Add function name to
E_no_return exception whenever possible.
* testsuite/poke.pkl/fun-no-return-1.pk: New test.
* testsuite/poke.pkl/fun-no-return-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-04-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Make struct and array constructors primary
syntax entities.
* testsuite/poke.pkl/scons-70.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-04-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-promo.c (pkl_promo_ps_cast): Do not try to promote
regular structs to integral structs.
* testsuite/poke.pkl/cast-int-struct-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-04-04 Jose E. Marchesi <jemarch@gnu.org>
* etc/Makefile.am (dist_lisp_DATA): Do not install poke-mode.
* emacs: Remove.
* etc/poke-mode.el: Remove.
2022-03-31 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke-el.texi: Capitalize etc.
2022-03-31 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-settings-map): Define.
(poke-settings-create-widgets): Use poke-settings-map.
2022-03-31 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-vu-goto-byte): Do not handle current-pos.
(poke-vu-mode): Likewise.
(poke-vu-handle-cmd): Get current-pos from the buffer.
2022-03-31 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update version to 2.3.
* doc/gendocs_template: Likewise.
* NEWS: Entries for 2.3.
2022-03-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Fix
diagnostics in 32-bit.
2022-03-29 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update version to 2.2.
* doc/gendocs_template: Likewise.
* NEWS: Update for 2.2.
2022-03-28 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-maps-cmd-copy-name-as-kill): Define.
(poke-maps-mode-map): Map command above to (kbd "w").
2022-03-22 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-complete-process): Define.
(poke-complete): Likewise.
(poke-complete-handle-cmd): Likewise.
(poke-repl): Depends on poke-complete.
(poke-exit): Take care of *poke-complete*.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (plet_autocomplete): New function.
(PLET_AUTOCMPL_IDENT): New constant.
(PLET_AUTOCMPL_IOS): Likewise.
(__poked_autocmpl_kind): New variable.
(__poked_autocmpl_string): Likewise.
(__poked_autocmpl_p): Likewise.
(__poked_autocmpl_reset): New function.
* poked/poked.c (bufb_append): Add missing const type qualifier.
(poked_autocmpl_send_one): New function to send auto-completion
for a string.
(poked_autocmpl_send): New function to send all requested
auto-completions.
(poked_compile): Process auto-completions requested from Poke.
Remove input channel for auto-completion.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.h (USOCK_CHAN_IN_AUTOCMPL): New macro.
(USOCK_CHAN_OUT_AUTOCMPL): Likewise.
* poked/poked.c (AUTOCMPL_IDENT): New macro.
(AUTOCMPL_IOS): Likewise.
(struct bufb): New struct for byte buffer.
(bufb_init): New function.
(bufb_realloc): Likewise.
(bufb_append): Likewise.
(bufb_free): Likewise.
(poked_compile): New function. Move all compilation logic to this
function.
(main): Add auto-completion channel.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.c (struct _pk_compiler): Add auto completion
machinery data.
(pk_compiler_new_with_flags): s/malloc/calloc/.
(complete_attribute): Remove global state, use `pkc`.
(complete_struct): Likewise.
(complete_decl): Likewise.
(pk_ios_completion_function): Likewise.
2022-03-22 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-repl-end-of-iteration): Echo output in the
minibuffer instead of the repl buffer if no repl mark is found.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (poked_after_eval_hook): Rename to
`poked_after_cmd_hook`.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (vu): Add prefix `plet_`.
(vu_highlight): Likewise.
(treevu_sct): Likewise.
(treevu): Likewise.
(disasm): Likewise.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (__chan_send_p): Add `poked` prefix.
(__chan_send_chan): Likewise.
(__chan_send_buf): Likewise.
(__chan_send_reset): Likewise.
(chan_send): Likewise.
(__err_send): Use `poked_chan_send`.
(poked_ehandler): Likewise.
(treevu_sct): Likewise.
(disasm): Likewise.
* poked/poked.c (poked_buf_send): Update.
(main): Likewise.
2022-03-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (main): Call `__poked_run_after_eval_hooks` even
if the statement is not expression.
2022-03-21 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (poked_init): Remove dead code.
2022-03-21 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (Poked_Hook): New type.
(poked_after_eval_hook): New variable for saving hooks.
(__poked_run_after_eval_hooks): New function.
* poked/poked.c (main): Call `__poked_run_after_eval_hooks` after
compiling statement.
2022-03-21 Jose E. Marchesi <jemarch@gnu.org>
* poke-el/poke-el.texi: New file.
* poke-el/COPYING: Likewise.
* poke-el/README: Likewise.
2022-03-21 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-ios-populate): Reverse list of IOS before
printing.
2022-03-21 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-repl-input-sender): Avoid race condition in
repl handling.
2022-03-18 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-edit-1): Use tree-mode when formatting
element values.
(poke-exit): Handle *poke-edit*.
2022-03-17 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-maps): Define.
(poke-exit): Handle *poke-maps*.
(poke-repl-mode-map): Adds keybind for poke-maps.
(poke-maps-mode): Define.
(poke-maps-mode-map): Likewise.
2022-03-17 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-setting-pretty-print): New variable.
(poke-setting-omode): Likewise.
(poke-settings-create-widgets): New function.
(poke-settings): Likewise.
(poke-exit): Kill buffer *poke-settings*.
2022-03-16 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-vu-cmd-prev-line): Renamed to feature cmd in
the name.
(poke-vu-cmd-page-down): Likewise.
(poke-vu-cmd-page-up): Likewise.
(poke-vu-cmd-goto-byte): Likewise.
(poke-vu-mode): Adjust accordingly.
(poke-vu-goto-byte): New function.
(poke-vu-cmd-goto-byte): Use poke-vu-goto-byte.
2022-03-16 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-vu-refresh): Ask for the right number of
lines, taking the header and modeline into account.
(poke-repl): Do not show banner if repl is already alive.
2022-03-16 Jose E. Marchesi <jemarch@gnu.org>
2022-03-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-stream.c (ios_dev_stream_pread): Fix call to
fread.
2022-03-15 Jose E. Marchesi <jemarch@gnu.org>
* poked/pk-dump-minimal.pk: Print in larger chunks.
2022-03-15 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-make-pokelet-process-new): Get unibyte input
in the pokelet processes.
2022-03-15 Jose E. Marchesi <jemarch@gnu.org>
* poked/pk-dump-minimal.pk: Minimize pokelet commands when dumping
bytes.
2022-03-15 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el: Update version to 2.1.
(poke-repl-cmd-goto-ios): Define.
(poke-repl-mode-map): Likewise.
2022-03-15 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-ios-overlay): Define.
(poke-ios-update-overlay): Likewise.
(poke-ios-mode-map): Register keys for poke-ios-cmd-next and
poke-ios-cmd-prev.
(poke-ios-cmd-next): Define.
(poke-ios-cmd-prev): Likewise.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (openset): Define.
* doc/poke.texi (openset): New section.
* testsuite/poke.pkl/open-set-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Remove checks for json-c and
machine-interface stuff.
* DEPENDENCIES: Remove dependency on json-c.
* poke/pk-mi.h: Likewise.
* poke/pk-mi.c (pk_mi): Likewise.
* poke/pk-mi*.[ch]: Remove.
* poke/poke.c (print_help): Remove --help output for the machine
interface.
(parse_args_1): Do not handle --mi.
(main): Do not enter the MI.
* poke/Makefile.am: Remove MI-related stuff.
* testsuite/Makefile.am: Likewise.
* testsuite/poke.mi-json: Remove directory and tests.
* doc/poke.texi (The Machine-Interface): Remove node.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-env.c (_decl): Do not allow re-defining immutable
declarations.
* libpoke/pkl-rt.pk: Mark declarations as immutable.
* libpoke/pkl-tab.y: Allow IMMUTABLE declarations at the
top-level.
* libpoke/pkl-ast.c (pkl_ast_make_decl): Initialize immutable_p to
0.
(pkl_ast_print_1): Print immutable_p.
* libpoke/pkl-ast.h (PKL_AST_DECL_IMMUTABLE_P): Define.
(struct pkl_ast_decl): New field `immutable_p'.
* libpoke/pkl-tab.y: New token IMMUTABLE.
* libpoke/pkl-lex.l: Handle __IMMUTABLE__.
* testsuite/poke.pkl/immutable-func-1.pk: Likewise.
* testsuite/poke.pkl/immutable-diag-2.pk: Likewise.
* testsuite/poke.pkl/immutable-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-exit): Handle *poke-ios*.
(poke): Create *poke-ios*.
(poke-repl-set-prompt): Fixed to not leave a spurious prompt.
(poke-elval-init-pk): Remove trace.
2022-03-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (__chan_send_chan): Changed to array.
(__chan_send_buf): Likewise.
(__chan_send_reset): Update.
(chan_send): Push data and channel to buffer array.
(__err_send): Remove comment.
* poked/poked.c (poked_buf_send_one): New function to send a single
buffer to a channel.
(poked_buf_send): Changed to support array of buffers.
2022-03-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (poked_init): Define `poked_libpoke_version`
Poke variable.
2022-03-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (struct poked_options): New struct to keep options.
(poked_options): Global variable to keep options.
(poked_options_init): Parse program arguments and fill
`poked_options`.
(poked_help): Show help.
(main): Print socket path in the beginning; be verbose only in
debug mode.
(tif_puts): Print on stdout only in debug mode.
(tif_printf): Likewise.
(poked_init): Print debugging-related info only in debug mode.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-pk): Convey the IO space size through
poke-ios-open.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-repl-default-prompt): Define.
(poke-repl-prompt): Make var.
(poke-pk): Define poke_el_ios_set and install it in the ios_set
hook.
(poke-ios-close): Restore default prompt when there are no more
open IO spaces.
(poke-ios-set): Define.
(poke-repl-set-prompt): Define.
(poke-vu-erase): Define.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (ios_set_hook): New hook.
(_pkl_run_ios_set_hook): New function.
* libpoke/pkl-gen-builtins.pks (builtin_open): Call the ios_set
hook whenever appropriate.
(builtin_set_ios): Likewise.
* testsuite/poke.pkl/ios-hook-set-1.pk: New test.
* testsuite/poke.pkl/ios-hook-set-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (IO Space Hooks): Document ios_set_hook.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-ios-set-ios): Define.
(poke-ios-mode-map): Likewise.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (tabulated-list): Require tabulated-list.
(poke-ios-mode): Define.
(poke-ios-populate): Likewise.
(poke-ios): Likewise.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-ios-list): New variable.
(poke-pk): Define poke_el_ios_open and poke_el_ios_close.
(poke-ios-alist): Define.
(poke-ios-open): Likewise.
(poke-ios-close): Likewise.
(poke): Iniitalize poke-ios-alist.
(poke-exit): Ask before exiting if there are open IO spaces.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-styling-faces): Handle styling classes
"error" and "warning".
(poke-warning-face): Define.
(poke-error-face): Likewise.
(poke_el_banner): Define and invoke at startup.
* .x-sc_unmarked_diagnostics: Add emacs/poke.el.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (IOS_Hook_Open_Fn): New type.
(IOS_Hook_Close_Fn): Likewise.
(ios_open_hook): New variable.
(ios_close_hook): Likewise.
(ios_close_pre_hook): Likewise.
(_pkl_run_ios_open_hook): New function.
(_pkl_run_ios_close_pre_hook): Likewise.
(_pkl_run_ios_close_hook): Likewise.
* libpoke/pkl-gen-builtins.pks (builtin_open): Call functions in
the IOS open hook.
(builtin_close): Call functions in the IOS close and close_pre
hooks.
* testsuite/poke.pkl/ios-hook-open-1.pk: New test.
* testsuite/poke.pkl/ios-hook-open-2.pk: Likewise.
* testsuite/poke.pkl/ios-hook-close-1.pk: Likewise.
* testsuite/poke.pkl/ios-hook-close-pre-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (IO Space Hooks): New section.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.libpoke/decls.c: Do not include unused header
files.
* libpoke/pvm.jitter: Wrap ios_handler.
2022-03-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_IOHANDLER): Define.
* libpoke/pkl-rt.pk (iohandler): New function.
* libpoke/pkl-tab.y: New token BUILTIN_IOHANDLER.
* libpoke/pkl-lex.l: Handle __PKL_BUILTIN_IOHANDLER__.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Handle
PKL_AST_BUILTIN_IOHANDLER.
* libpoke/pkl-insn.def: New instruction PKL_INSN_IOHANDLER.
* libpoke/pvm.jitter (iohandler): New instruction.
* libpoke/pkl-gen-builtins.pks (builtin_iohandler): New macro.
* testsuite/poke.pkl/iohandler-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* doc/poke.texi (iohandler): New section.
2022-03-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-diag.c (pkl_detailed_location): Fix printing
diagnostics for codes in buffers.
2022-03-12 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (poked_ehandler): Remove extra newline.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-pk): Define.
(poke): Evaluate poke-pk at startup.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-elval-process): Define.
(poke-exit): Handle poke-elval.
(poke): Likewise.
(poke-vu-filter): Define.
(poke-elval-state-waiting-for-length): Define.
(poke-elval-state-waiting-for-msg): Likewise.
(poke-elval-state): Likewise.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-vu-output): Define.
(poke-vu-filter): Accumulate output.
(poke-vu): Initialize poke-vu-output.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke): Better window layout.
(poke-out-iter-string): Quote face symbol.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-exit): Simplify.
(poke-out-filter): Remove debug code.
(poke-debug-p): Remove.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-iter-string-face): Define.
(poke-out-iter-string): Likewise.
(poke-out-filter): Insert iterator separator string and update
cursor in all windows showing *poke-out* after iterations.
(poke-out-got-output): Define.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-set-omode): New function.
(poke-set-pretty-print): Likewise.
(poke-vu-next-line): Improve.
(poke-vu-mode): Add a header line with a ruler.
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-styling-faces): Fix faces names.
(poke-out-filter): Move process marker whenever necessary.
(poke-open-file): s/E_generic_io/E-io.
2022-03-11 Jose E. Marchesi <jemarch@gnu.org>
* pickles/diff.pk: Load pk-table.pk.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/pk-dump-minimal.pk (dump): Remove classes.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (VUCMD_FINISH): New macro.
(main): Send VUCMD_FINISH to signal the end-of-vu.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (VUKIND_CLEAR): s/VUKIND_/VUCMD_/.
(VUKIND_APPEND): Likewise.
(VUCMD_HIGHLIGHT): New macro.
(VUCMD_FILTER): Likewise.
(termout_vu_append): Update.
(main): Send VUCMD_FILTER before other vu stuff.
* poked/poked.pk (vu_ios): Remove.
(__vu_rng): Likewise.
(__vu_filter): New variable.
(vu): Add two new args: `filt` and `filts`.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (OUTCMD_ERR): New macro.
* poked/poked.pk (__err_send): New function to report errors.
(poked_ehandler): Change default error handler to use `__err_send`
instead of `print`.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.h (usock_out): Change the function prototype: re-order
`kind` and `chan`; change type of `data` to `const void *`.
* poked/usock.c (usock_out): Likewise.
* poked/poked.c (poked_buf_send): Adapt to new function prototype.
And remove unused variable.
(iteration_send): Adapt to new function prototype.
(main): Likewise.
(tif_puts): Likewise.
(tif_printf): Likewise.
(tif_indent): Likewise.
(tif_class): Likewise.
(tif_class_end): Likewise.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (main): Don't send empty EVAL msgs in the
beginning.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (OUTCMD_EVAL_BEGIN): Removed.
(OUTCMD_EVAL_END): Removed.
(OUTCMD_EVAL): New macro.
(termout_eval): New function.
(main): Print the value of Poke statement using OUTCMD_EVAL.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (OUTKIND_ITER_BEGIN): s/OUTKIND_/OUTCMD_/.
(OUTKIND_TXT): Likewise.
(OUTKIND_ITER_END): Likewise.
(OUTKIND_CLS_BEGIN): Likewise.
(OUTKIND_CLS_END): Likewise.
(OUTKIND_EVAL_BEGIN): Likewise.
(OUTKIND_EVAL_END): Likewise.
(termout_kind): Renamed to `termout_cmdkind`.
(termout_restore): Adapt names.
(termout_vu_append): Likewise.
(iteration_send): Likewise.
(main): Likewise.
(tif_puts): Likewise.
(tif_printf): Likewise.
(tif_indent): Likewise.
(tif_class): Likewise.
(tif_class_end): Likewise.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.h (USOCK_CHAN_OUT_CMD): Removed.
* poked/poked.c (OUTKIND_EVAL_BEGIN): New macro.
(OUTKIND_EVAL_END): Likewise.
(termout_cmd): Removed.
(iteration_send): Removed OUT_CMD chan.
(tif_class): Likewise.
(tif_class_end): Likewise.
(main): Mark begin/end of statement output using EVAL_BEGIN
and EVAL_END.
2022-03-11 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ios.pk: Remove references to the hyperlinks
infrastructure, which is part of poke.
* poke/pk-dump.pk: Adapt accordingly.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (OUTKIND_CLS_BEGIN): New macro.
(OUTKIND_CLS_END): Likewise.
(tif_class): Send class data to pokelets (OUT_OUT and OUT_CMD chans).
(tif_class_end): Likewise.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (chan_send): Remove length prefix. Adding length
prefix is the responsibility of usock library.
* poked/poked.c (poked_buf_send): Fix to not expect length prefix
in Poke array.
* poked/usock.c (usock_out): Fix the prefix and data length.
2022-03-11 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.pk (__Disasm): Change type of `adr` to offset.
(disasm): Likewise.
2022-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (poked_buf_send): Check exception after `pk_call`.
(main): Likewise.
2022-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (termout_chan): Renamed from `out_chan`.
(termout_kind): Renamed from `out_kind`.
(termout_restore): New function to restore to terminal output to
OUT_OUT channel (normal text mode).
(termout_vu_append): New function to change the terminal output to
OUT_VU channel (append mode).
(termout_cmd): New function to change the terminal output to OUT_CMD
channel (normal text mode).
(iteration_send): New function to send iteration number to both
OUT_OUT and OUT_CMD channels.
(iteration_begin): New function to send iteration-begin command.
(iteration_end): New function to end iteration-end command.
(main): Send output of `pk_print_val` to OUT_CMD channel.
* poked/usock.h (USOCK_CHAN_OUT_CMD): New macro.
2022-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (OUTKIND_ID): Remove macro.
(OUTKIND_ITER_BEGIN): New macro.
(OUTKIND_ITER_END): Likewise.
(main): Also signal the end of iteration to the pokelets.
2022-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (poked_init): Handle `POKEDATADIR`, `POKEPICKLESDIR`,
`POKEDAPPDIR` env vars.
* run.in (POKEDAPPDIR): Define.
2022-03-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/poked.c (main): Add `poked_restart` support.
* poked/poked.pk (poked_restart): New function.
(__poked_restart_p): New variable.
2022-03-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Indentation and other visual improvements.
2022-03-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (my_decl_map_fn): Always return PK_NULL as
`value' for type declarations.
* libpoke/libpoke.h: Add description of the arguments got by the
pk_map_decl_fn callback.
* testsuite/poke.libpoke/decls.c: New file.
* testsuite/poke.libpoke/Makefile.am (decls_SOURCES): Define.
(decls_CPPFLAGS): Likewise.
(decls_CFLAGS): Likewise.
(decls_LDADD): Likewise.
(check_PROGRAMS): Add decls.
* testsuite/poke.libpoke/libpoke.exp: Run the decls tests.
2022-03-10 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-64.pk (Elf64_Shdr): sh_entsize is an offset in
bytes, not bits.
* pickles/elf-32.pk (Elf32_Shdr): Likewise.
2022-03-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Clarify that pk_array_type_bound always
returns PK_NULL at the time being.
2022-03-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (eoffset): New function.
* doc/poke.texi (eoffset): New section.
(Values Functions): Likewise.
2022-03-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Define tokens APUSH and APOP, and add rules
for the operators.
* libpoke/pkl-lex.l: Rules for APUSH and APOP tokens.
* libpoke/pkl-ops.def: Define operators PKL_AST_OP_APUSH and
PKL_AST_OP_APOP.
* libpoke/pkl-typify.c (pkl_typify1_ps_op_apush): New handler.
(pkl_typify1_ps_op_apop): Likewise.
(pkl_phase_typify1): Register new handlers.
* libpoke/pkl-promo.c (pkl_promo_ps_op_apush): New handler.
(pkl_phase_promo): Register new handler.
* libpoke/pkl-gen.c (pkl_gen_ps_op_apush): New handler.
(pkl_gen_ps_op_apop): Likewise.
(pkl_phase_gen): Register new handlers.
* testsuite/poke.pkl/apush-diag-1.pk: New test.
* testsuite/poke.pkl/apop-diag-1.pk: Likewise.
* testsuite/poke.pkl/apush-diag-2.pk: Likewise.
* testsuite/poke.pkl/apush-diag-3.pk: Likewise.
* testsuite/poke.pkl/apush-1.pk: Likewise.
* testsuite/poke.pkl/apush-2.pk: Likewise.
* testsuite/poke.pkl/apop-1.pk: Likewise.
* testsuite/poke.pkl/apop-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Arrays as Stacks): New section.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/diff.pk: Document diff_structured.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pickles_DATA): Add diff.pk.
(dist_pickles_DATA): Add pk-table.pk.
* pickles/diff.pk: New file.
* pickles/pk-table.pk: Moved from poke/.
* poke/pk-diff.pk: Factor functionality out to diff_structured and
call it.
* poke/Makefile.am (dist_app_DATA): Remove pk-table.pk.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pickles_DATA): Add ios.pk.
* pickles/ios.pk: New file.
* poke/pk-dump.pk (dump): Factor functionality out to
ios_dump_bytes and call it.
2022-03-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_format): Fix format string
arg suffix when there's a %%.
* testsuite/poke.pkl/format-40.pk: New test.
* testsuite/poke.pkl/format-41.pk: Likewise.
* testsuite/poke.pkl/format-42.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support nested integral structs): Removed as done.
(`load' doesn't load after an error): Likewise.
(Add an elisp MI interface to poke.el): Removed as wont happen.
(Auto-complete value attributes): Removed as done.
(Use json-c instead of tcllib json modules in the GUI): Removed as
wont happen.
(Auto-complete yes|no in commands): Removed as done.
(support references to values in the MI protocol): Removed as wont
happen.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Remove gl-poked/Makefile.
* Makefile.am (ACLOCAL_AMFLAGS): Do not include m4/poked.
(SUBDIRS): Remove gl-poked.
* bootstrap.conf (ACLOCAL_FLAGS): Likewise.
Remove poked_modules.
* poked/Makefile.am (poked_LDADD): Use the gnulib in gl/.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (pk_call): Expose exit_exception in the
interface.
* libpoke/libpoke.h: Change prototype accordingly.
* poke/pk-cmd-help.c (pk_cmd_help): Adapt accordingly.
* poke/pk-cmd-set.c (pk_cmd_set_dump): Likewise.
(pk_cmd_set): Likewise.
(pk_cmd_set): Likewise.
* poke/pk-hserver.c (pk_hserver_get_token): Likewise.
(pk_hserver_token_p): Likewise.
(pk_hserver_cmd): Likewise.
(read_from_client): Likewise.
(pk_hserver_make_hyperlink): Likewise.
* poke/poke.c (poke_handle_exception): Likewise.
* poked/poked.c (poked_buf_send): Likewise.
(main): Likewise.
(poked_free): Likewise.
2022-03-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/leb128.pk (LEB128.value): Really allow up to 64-bit
integers and fix calculation of the return value.
(ULEB128.value): Likewise.
Reported and fixed by bjorn3 in the IRC channel.
2022-02-07 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poked/usock.c (usock_client_step): Handle zero-length payloads.
2022-03-07 Daiki Ueno <ueno@gnu.org>
* pickles/asn1-ber.pk (BER_Identifier): Fix long-form tag number
handling.
(BER_Length): Fix long-form definite length calculation.
2022-03-07 Jose E. Marchesi <jemarch@gnu.org>
* .x-sc_bindtextdomain: Add poked/*.
* .x-sc_prohibit_strncpy: Likewise.
* .x-sc_prohibit_strcmp: New file.
* etc/hacking.org: Add Mohammad-Reza Nabipoor as maintainer of
poked/*.
* poked/usock.c: Do not include signal.h.
2022-03-06 Jose E. Marchesi <jemarch@gnu.org>
* poked/README.md: Remove file.
2022-03-06 Jose E. Marchesi <jemarch@gnu.org>
* poked/Makefile.am: New file.
* poked/poked.c: Import file and integrate.
* poked/poked.pk: Likewise.
* poked/usock.c: Likewise.
* poked/usock.h: Likewise.
* poked/usock-buf.c: Likewise.
* poked/usock-buf.h: Likewise.
* poked/usock-buf-priv.h: Likewise.
* bootstrap.conf (poked_modules): Define.
(buildreq): Create gl-poked.
* Makefile.am (SUBDIRS): Add poked.
* configure.ac: Add poked/Makefile.
2022-03-06 Jose E. Marchesi <jemarch@gnu.org>
* common/pk-utils.c: Do not depend on gettext.
2022-02-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-attrs.pks (attr_ios): Add explicative message in
raised exception.
(attr_size): Likewise.
(attr_offset): Likewise.
(attr_eoffset): Likewise.
(attr_esize): Likewise.
(attr_ename): Likewise.
(attr_elem): Likewise.
2022-02-26 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/array-type-diag-2.pk: New test.
* libpoke/pkl-anal.c (pkl_anal1_ps_type_array): New handler.
(pkl_phase_anal1): Install handler.
2022-02-26 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk: s/initially/currently command help string.
2022-02-24 Jose E. Marchesi <jemarch@gnu.org>
* maps/Makefile.am: Revert last change.
* poke/poke.c (initialize): Put maps back in pkgdatadir.
* poke/pk-map.pk: Likewise.
2022-02-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/Makefile.am (appdir): Define.
(dist_app_DATA): Rename from dist_pkgdata_DATA.
* doc/Makefile.am: Install poke's docfiles in appdir.
* etc/Makefile.am: Likewise.
* maps/Makefile.am (mapsdir): Likewise.
* libpoke/pkl-rt.pk: Do not set picklesdir.
* poke/poke.h: Extern for poke_appdir.
* poke/poke.c (poke_appdir): New variable.
(initialize): Honor POKEAPPDIR and set poke_appdir, then
set load_path.
* run.in (POKEAPPDIR): Define.
* testsuite/Makefile.am: Likewise.
2022-02-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-diff.pk (sdiff): Improve support for non-byte values.
* testsuite/poke.cmd/sdiff-12.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Make sure the
constructed array value has a writer.
* testsuite/poke.map/ass-map-26.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-02-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-diff.pk: Factor a bit.
2022-02-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-diff.pk (sdiff): Try to emit thunk lines for composite
values in which non-byte elements were found.
(sdiff_addrem): Likewise.
* testsuite/poke.cmd/sdiff-9.pk: New test.
* testsuite/poke.cmd/sdiff-10.pk: Likewise.
* testsuite/poke.cmd/sdiff-11.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.pk (Pk_Table_Printer): New type.
(Pk_Table): New field `printer'.
(pk_table_default_printer): New function.
(Pk_Table.print_table): Use the printer.
2022-02-20 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (sdiff): Sketch of section.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-diff.pk.
* poke/pk-diff.pk: New file.
* poke/pk-cmd.pk: Load pk-diff.pk.
* etc/poke-dark.css (.diff-plus): New class.
(.diff-minus): Likewise.
(.diff-thunk-header): Likewise.
* etc/poke-bright.css (.diff-minus): Likewise.
(.diff-minus): Likewise.
(.diff-thunk-header): Likewise.
* testsuite/poke.cmd/sdiff-1.pk: New test.
* testsuite/poke.cmd/sdiff-2.pk: Likewise.
* testsuite/poke.cmd/sdiff-3.pk: Likewise.
* testsuite/poke.cmd/sdiff-4.pk: Likewise.
* testsuite/poke.cmd/sdiff-5.pk: Likewise.
* testsuite/poke.cmd/sdiff-6.pk: Likewise.
* testsuite/poke.cmd/sdiff-7.pk: Likewise.
* testsuite/poke.cmd/sdiff-8.pk: Likewise.
* testsuite/poke.repl/repl.exp: Update test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Fix precedence of EXCOND.
2022-02-18 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-64.pk: Fix IOS in in-method mappings.
2022-02-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (dump): Fix start of ASCII dump when :from is
used.
* testsuite/poke.cmd/dump-13.pk (pk_dump_ascii): New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-02-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_mem): Create uniquely named memory IOS
if no name is specified in .mem.
2022-02-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (print_help): Do not use pk-term.
(pk_print_version): Likewise.
(parse_args_2): Likewise.
(pk_fatal): Likewise.
(parse_args_1): Handle HELP_ARG and VERSION_ARG here.
(parse_args_2): ... instead of here.
2022-02-15 Jose E. Marchesi <jemarch@gnu.org>
* gui/: Remove.
* bootstrap.conf (gui_modules): Remove.
(bootstrap_post_import_hook): Do not create gl-guil.
(ACLOCAL_FLAGS): Do not include m4/gui.
* configure.ac: Do not call gui_EARLY.
Do not call gui_INIT.
Remove Tcl/Tk checks.
* run.in: Do not set gui-related paths.
* DEPENDENCIES: Remove section on Tcl and Tk.
* .gitignore: Remove gui-related entries.
* Makefile.am (ACLOCAL_AMFLAGS): Do not include m4/gui.
(SUBDIRS): Remove gui and gl-gui directories.
2022-02-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Prototype for pk_type_name.
* libpoke/pk-val.c (pk_type_name): New function.
2022-02-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-save.pk: Do not capitalize summary in help entry.
* poke/pk-extract.pk: Likewise.
* poke/pk-copy.pk: Likewise.
* poke/pk-scrabble.pk: Likewise.
2022-02-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-attrs.def: Remove PKL_AST_ATTR_ALIGNMENT.
* libpoke/pkl-gen.c (pkl_gen_ps_op_attr): Do not handle the
'alignment attribute.
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Likewise.
* testsuite/poke.repl/repl.exp: Update tests.
2022-02-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Emit
compilation-time errors for some attributes.
* testsuite/poke.pkl/attr-offset-diag-4.pk: New test.
* testsuite/poke.pkl/attr-ename-diag-1.pk: Likewise.
* testsuite/poke.pkl/attr-esize-diag-1.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-diag-1.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-5.pk: Remove test.
* testsuite/poke.pkl/attr-esize-5.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-5.pk: Likewise.
2022-02-14 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Integer Attributes): Update accordingly.
(Offset Attributes): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Allow using 'length
in any kind of value.
* testsuite/poke.pkl/attr-length-12.pk: New test.
* testsuite/poke.pkl/attr-length-13.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-attrs.pks (attr_elem): Raise E_elem if the
referred element is an absent field.
* testsuite/poke.pkl/attr-elem-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-attrs.pks (attr_ename): Do not print . before [
in array element names.
(attr_esize): Support absent fields in structs.
* testsuite/poke.pkl/attr-esize-6.pk: New test.
* testsuite/poke.pkl/attr-esize-7.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-1.pk: Update test.
* testsuite/poke.pkl/attr-ename-arr-3.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-attrs.def: New attribute PKL_AST_ATTR_ELEM.
* libpoke/pkl-anal.c (pkl_anal1_ps_op_attr): Handle ELEM
attribute.
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Likewise.
* libpoke/pkl-promo.c (pkl_promo_ps_op_attr): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_op_attr): Likewise.
* libpoke/pkl-gen-attrs.pks (attr_elem): New macro.
* testsuite/poke.pkl/attr-diag-5.pk: New test.
* testsuite/poke.pkl/attr-diag-6.pk: Likewise.
* testsuite/poke.pkl/attr-elem-3.pk: Likewise.
* testsuite/poke.pkl/attr-elem-2.pk: Likewise.
* testsuite/poke.pkl/attr-elem-1.pk: Likewise.
* testsuite/poke.pkl/attr-elem-4.pk: Likewise.
* doc/poke.texi (Array Attributes): Document 'elem.
(Struct Attributes): Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-attrs.def: New attributes EOFFSET, ESIZE and ENAME.
* libpoke/pkl-ast.c (pkl_ast_make_binary_exp): New function.
* libpoke/pkl-tab.y: Rule for attributes with one argument.
* libpoke/pkl-ast.h (struct pkl_ast_exp): Allow three operands.
* libpoke/pkl-pass.c (pkl_do_pass_1): Traverse all expression
operands.
* libpoke/pkl-trans.c (pkl_trans1_ps_op_attr): Handle binary
attributes.
* libpoke/pkl-anal.c (pkl_anal1_ps_op_attr): New handler.
(pkl_phase_anal1): Register handler.
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Handle new
attributes.
* libpoke/pkl-promo.c (pkl_promo_ps_op_attr): New handler.
(pkl_phase_promo): Register handler.
* libpoke/pkl-gen.c (pkl_gen_ps_op_attr): Handle EOFFSET, ESIZE
and ENAME.
* libpoke/pvm.jitter (tyisa): New instruction.
(srefin): Likewise.
* libpoke/pkl-insn.def: Define PKL_INSN_TYISA.
Define PKL_INSN_SREFIN.
* libpoke/pkl-gen-attrs.pks (attr_eoffset): New macro.
(attr_eoffset): Likewise.
(attr_ename): Likewise.
* testsuite/poke.pkl/attr-diag-2.pk: New test.
* testsuite/poke.pkl/attr-diag-3.pk: Likewise.
* testsuite/poke.pkl/attr-diag-4.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-5.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-4.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-3.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-2.pk: Likewise.
* testsuite/poke.pkl/attr-eoffset-1.pk: Likewise.
* testsuite/poke.pkl/attr-esize-5.pk: Likewise.
* testsuite/poke.pkl/attr-esize-4.pk: Likewise.
* testsuite/poke.pkl/attr-esize-3.pk: Likewise.
* testsuite/poke.pkl/attr-esize-2.pk: Likewise.
* testsuite/poke.pkl/attr-esize-1.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-6.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-5.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-4.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-3.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-2.pk: Likewise.
* testsuite/poke.pkl/attr-ename-arr-1.pk: Likewise.
* testsuite/poke.pkl/attr-ename-union-1.pk: Likewise.
* testsuite/poke.pkl/attr-ename-struct-1.pk: Likewise.
* testsuite/poke.pkl/attr-ename-struct-2.pk: Likewise.
* testsuite/poke.pkl/attr-ename-union-2.pk: Likewise.
* doc/poke.texi (Array Attributes): Document new attributes for
arrays.
(Struct Attributes): Ditto for structs.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-09 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-ios.c (pk_open_proc_maps): Use PRIx64 instead of %lx.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Use PRIu64
instead of %lu.
2022-02-08 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.libpoke/term-if.h (pk_term_end_class): Return 1.
2022-02-07 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump version to 2.1.
* NEWS: Likewise.
* doc/gendocs_template: Likewise.
2022-02-07 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_sub): Use PRI* macros instead of
explicit %-tags.
(pk_cmd_proc): Likewise.
2022-02-06 Bruno Haible <bruno@clisp.org>
Jose E. Marchesi <jemarch@gnu.org>
Avoid undefined behaviour on signed integer.
* libpoke/pvm-val.h (PVM_MAKE_INT): Cast to unsigned integer before
shifting.
* libpoke/pvm.jitter (PVM_NEG_SIGNED): Likewise.
(PVM_DIV_SIGNED): Likewise.
(PVM_MOD_SIGNED): Likewise.
* libpoke/pkl-fold.c (OP_UNARY_II): Likewise.
(OP_BINARY_III): Likewise.
2022-02-06 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump version to 2.0.92.
* NEWS: Update.
2022-02-05 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_type_is_complete): Fix assertion.
2022-02-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Prototype for pvm_ref_set_struct_cstr.
* libpoke/libpoke.h: Prototype for pk_struct_ref_set_field_value.
* libpoke/pk-val.c (pk_struct_ref_set_field_value): New function.
* libpoke/pvm-val.c (pvm_ref_set_struct_cstr): Likewise.
* testsuite/poke.libpoke/values.c
(test_pk_struct_ref_set_field_value): New function.
(main): Call it.
2022-02-05 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (PREP_REGEXP_PAYLOAD): Avoid using `regexp'
uninitialized.
* poke/pk-cmd-ios.c (pk_cmd_sub): Use PRIx64 instead of %lx.
(print_info_ios): Likewise.
(print_info_ios): Likewise.
2022-02-05 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Add the `getsockname' gnulib
module.
* poke/pk-hserver.c (pk_hserver_start): Cast the pointer to
`struct sockaddr_in' to a pointer to a `strut sockaddr_in' before
passing it to getsockname. This avoids compiler warnings in some
platforms.
2022-02-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (verify_exit_status): Avoid using
lassign.
2022-02-05 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (print_var_decl): Pass a `match' argument to
regexec.
(print_fun_decl): Likewise.
(print_type_decl): Likewise.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-set.c (yesno_completion_function): New function.
(set_error_on_warning_cmd): Use yesno_completion_function.
(pk_cmd_set_init): Likewise for boolean settings in the registry.
* testsuite/poke.repl/repl.exp (tab-completion-bool-setting-1):
New test.
(tab-completion-bool-setting-2): Likewise.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (pk_completion_function): Handle ' before .
* testsuite/poke.repl/repl.exp (tab-completion-attr-and-field-1):
New test.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-repl.c (pk_repl): Customize the readline completer
routine.
* libpoke/libpoke.c (pk_completion_function): Call
complete_attribute whenever appropriate.
(complete_attribute): New function.
(complete_decl): Likewise.
* testsuite/poke.repl/repl.exp (tab-completion-attribute-1): New
test.
(tab-completion-attribute-2): Likewise.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk: Document the :ios argument.
* doc/poke.texi (dump): Mention :ios in the synopsis.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Remove.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Change version to 2.0.91.
* NEWS: Likewise.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Change version to 2.0.90.
* NEWS: Add entries for 2.0.90.
2022-02-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (parse_args_2): Remove unused variable.
2022-02-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (libpoke_la_SOURCES): Add
pkl-gen-attrs.{pks,pkc}.
(MOSTLYCLEANFILES): Add pkl-gen-attrs.pkc.tmp.
(BUILT_SOURCES): Add pkl-gen-attrs.pkc.
* libpoke/pkl-gen-attrs.pks: New file.
* libpoke/pkl-gen.c: Include pkl-gen-attrs.pkc.
(pkl_gen_ps_op_attr): Use RAS macros.
* testsuite/poke.pkl/attr-size-22.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-02-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_op_attr): Dereference node
property after making sure it's valid.
2022-02-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_op_attr): Dereference node
property after making sure it's valid.
* testsuite/poke.pkl/adda-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-02-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.c (pvm_run): exit_exception is mandatory.
* libpoke/pvm.h: Reflect this in docstring.
* poke/pk-map.c (pk_map_load_parsed_map): Pass exit_exception to
pk_compile_buffer and pk_compile_expression.
* poke/pk-mi.c (pk_mi_dispatch_msg): Likewise.
* libpoke/pkl.c (pkl_execute_statement): Do not replace the
compiler's environment if executing the code resulted in an
unhandled exception.
(pkl_execute_buffer): Likewise.
(pkl_execute_file): Likewise.
(pkl_execute_expression): Likewise.
(pkl_load_rt): Pass exit_exception to pkl_execute_file.
(LOAD_STD): Likewise.
(pkl_load): Likewise.
* libpoke/libpoke.c (pk_call): Likewise.
* testsuite/poke.libpoke/foreign-iod.c (main): Likewise.
(TEST_IO): Likewise.
(main): Likewise.
* testsuite/poke.libpoke/values.c (testcase_pk_val_equal_p):
Likewise.
* testsuite/poke.mi-json/mi-json.c (compile_initial_poke_code):
Likewise.
(compile_poke_expression): Likewise.
2022-02-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_sizeof_type): Add case for complete
unions.
* testsuite/poke.pkl/sizeof-14.pk: New test.
* testsuite/poke.pkl/sizeof-15.pk: Likewise.
* testsuite/poke.pkl/sizeof-16.pk: Likewise.
* testsuite/poke.pkl/sizeof-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-02-02 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_rockdabootism_missing_space): Remove syntax-check
rule.
2022-02-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Generate array
bounders in advance for array struct fields; these may be required
for casts if the user provided array literals as initialization in
the constructor.
* libpoke/pkl-ast.c (pkl_ast_array_type_remove_bounders): Delete
function.
* libpoke/pkl-ast.h: ... and its prototype.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Adapt subpassing into array
bounder. Set mapper_depth and constructor_depth before invoking
RAS_FUNCTION_ARRAY_MAPPER and RAS_FUNCTION_ARRAY_CONSTRUCTOR
respectively.
(pkl_gen_pr_func): Add assert.
(pkl_gen_pr_func_arg): Do not remove installed array bounders.
(pkl_gen_pr_cast): Likewise.
(pkl_gen_pr_type_array): Likewise.
* testsuite/poke.pkl/ass-12.pk: New test.
* testsuite/poke.pkl/ass-13.pk: Likewise.
* testsuite/poke.pkl/ass-14.pk: Likewise.
* testsuite/poke.pkl/ass-15.pk: Likewise.
* testsuite/poke.pkl/ass-16.pk: Likewise.
* testsuite/poke.pkl/ass-17.pk: Likewise.
* testsuite/poke.pkl/scons-68.pk: Likewise.
* testsuite/poke.pkl/scons-69.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* man/Makefile.am: Do not build manpage if cross-compiling.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Make --disable-gui the default.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Define the Automake conditional CROSS_COMPILING.
* doc/Makefile.am (poke-settings.texi): Rule to use when
cross-compiling.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (pk_vprintf): Use pk_puts.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* man/Makefile.am (poke.1): Revert last change.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* man/Makefile.am (poke.1): Add -q to poke invocation.
* doc/Makefile.am (poke-settings.texi): Likewise.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_call_node_handlers): Do not continue
applying handlers to rewritten nodes, unless the rewritten node is
explicitly restarted by the phase handler that created it.
2022-02-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.h: NOte that changing PKL_PASS_NODE is
possible, but only in post-order handlers.
* libpoke/pkl-pass.c (pkl_do_pass_1): Add assertion to make sure
pre-order handlers do not replace the node being processed.
2022-01-31 Alfred M. Szmidt <ams@gnu.org>
* doc/gen-pvm-insns.sh: Try not to use hard coded location for
bash.
* doc/Makefile.am (pvm-insns.texi): Don't create file if the
command to create it failed.
(poke.text): Remove redundant mv/rm.
2022-01-30 Bruno Haible <bruno@clisp.org>
Update the pager automatically when the window height changes.
* bootstrap.conf (gnulib_modules): Add sys_ioctl.
* poke/pk-term.c: Include <signal.h>, <sys/ioctl.h>.
(screen_lines, screen_cols): Mark as volatile.
(update_screen_dimensions, sigwinch_handler): New functions.
(orig_sigwinch_action): New variable.
(install_sigwinch_handler, uninstall_sigwinch_handler): New functions.
(pk_term_init): Make sure to get the screen dimensions. Invoke
install_sigwinch_handler.
(pk_term_shutdown): Invoke uninstall_sigwinch_handler.
2022-01-30 Bruno Haible <bruno@clisp.org>
Prefer terminfo over termcap when both are available.
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00183.html>
* gnulib: Update to newest.
* bootstrap.conf (gnulib_modules): Use terminfo, terminfo-h instead of
termcap, termcap-h.
* poke/pk-term.c: Include terminfo.h instead of termcap.h.
(pk_term_init): Use the terminfo API if possible. Use the termcap API
only as second choice.
(pk_puts_paged): Don't test HAVE_TERMCAP.
* poke/Makefile.am (poke_LDADD): Use LTLIBTERMINFO instead of
LTLIBTERMCAP.
2022-01-30 Bruno Haible <bruno@clisp.org>
doc: Don't leave a broken .texi file around.
* doc/Makefile.am (poke-settings.texi): Don't create poke-settings.texi
if the command to create it failed.
(MOSTLYCLEANFILES): Update.
2022-01-30 Sergio Durigan Junior <sergiodj@sergiodj.net>
* poke/Makefile.am (dist_pkgdata_DATA): Always install
pk-hserver.pk.
2022-01-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (erase_line_str): New variable.
(pk_term_init): Set erase_line_str to the terminal capability
"ed".
2022-01-30 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import the termcap and
termcap-h gnulib modules.
* configure.ac: Remove checks for termcap, since the gnulib module
provides a better one.
* poke/Makefile.am (poke_LDADD): Add LTLIBTERMCAP.
* poke/pk-term.c (pk_term_init): Use termcap only if HAVE_TERMCAP.
2022-01-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (pk_term_init): Do not error when TERM is not
set.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (pager_inhibited_p): New variable.
(pk_term_start_pager): Reset pager_inhibited_p.
(pk_puts_paged): Handle `q' in pager.
(pk_puts_paged): Style --More--.
* etc/poke-dark.css (.pager-more): New class.
* etc/poke-bright.css (.pager-more): Likewise.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk: Add setting for `pager'.
* poke/poke.h: Remove poke_pager_p.
* poke/poke.c: Likewise.
* poke/pk-cmd-set.c (pk_cmd_set_pager): Delete.
(pk_cmd_set_init): Remove pager setting.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac (HAVE_HSERVER): Search for `tgetnum' first in
libtermcap and then in libncurses.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Add `termios'.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-set.c (pk_cmd_set_pager): New function.
(set_pager_cmd): New variable.
(pk_cmd_set_init): Add set_pager command.
* poke/pk-repl.c (pk_repl): Use pager (conditionally) when
executing commands in the repl.
* poke/pk-settings.pk: Setting for `pager'.
* poke/pk-term.c (screen_lines): New variable.
(screen_cols): Likewise.
(pager_active_p): Likewise.
(nlines): Likewise.
(pk_term_init): Initialize terminal dimensions.
(pk_term_start_pager): New function.
(pk_term_stop_pager): Likewise.
(pk_puts_paged): Likewise.
(pk_puts): Call pk_puts_paged when necessary.
(pk_printf): Output via pk_puts.
* poke/poke.c: New global poke_pager_p.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (parse_args_2): Really restore proper behavior with
-l and unhandled exceptions.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (parse_args_2): Restore proper behavior with -l and
unhandled exceptions.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.h: Prototype for pk_cmd_completion_function.
* poke/pk-cmd.c: Fix pk_cmd_find and export
pk_cmd_completion_function.
* poke/pk-repl.c: Adapt to new pk_cmd_find.
* poke/pk-cmd-def.c: Fix auto-complete.
* poke/pk-cmd-editor.c: Likewise.
* poke/pk-cmd-help.c: Likewise.
* poke/pk-cmd-info.c: Likewise.
* poke/pk-cmd-ios.c: Likewise.
* poke/pk-cmd-map.c: Likewise.
* poke/pk-cmd-misc.c: Likewise.
* poke/pk-cmd-set.c: Likewise.
* poke/pk-cmd-vm.c: Likewise.
* testsuite/poke.repl/repl.exp: Few more auto-completion tests.
2022-01-29 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.mi-json/mi-json.c (test_json_file): When libjson
is not modern enough, report the test as `untested' and not as
`unresolved'.
2022-01-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_trimmer): Restart the pass
on creation of new AST node.
* testsuite/poke.pkl/arrays-17.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans2_ps_op_attr):
s/assert/PKL_PASS_DONE/.
* testsuite/poke.pkl/typeof-25.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* etc/poke.rec (Unions can be completed): Remove (done).
(.info type TYPENAME): Remove (done).
2022-01-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd-misc.c (pk_cmd_jmd): Add new quote.
2022-01-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.h (PVM_EXCEPTIONS): New macro.
* libpoke/pvm.jitter (wrapped-globals): Add `pvm_exception_names`.
(PVM_RAISE_DFL): Use `pvm_exception_names` instead of string
literals.
(late-c): Define `pvm_exception_names`.
2022-01-27 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Set date and version for 2.0 news.
* configure.ac: Change version number to 2.0.
* doc/gendocs_template: Adapt to 2.0.
2022-01-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (iogetb): Mark as `non-relocatable` because
of / and %.
(formati): Likewise.
(formatiu): Likewise.
(formatl): Likewise.
(formatlu): Likewise.
(divi): Likewise.
(diviu): Likewise.
(divl): Likewise.
(divlu): Likewise.
(modi): Likewise.
(modiu): Likewise.
(modl): Likewise.
(modlu): Likewise.
* etc/pvm-wraps-static-whitelist: Update.
2022-01-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-functions): Add missing functions.
(wrapped-globals): Add `libpoke_term_if`.
(PVM_FORMATI): s/assert/pvm_assert/.
(PVM_FORMATL): Likewise.
(late-c): Define new function wrappers.
(exit): s/assert/pvm_assert/.
(call): Likewise.
(eqs): s/STREQ/pvm_strcmp/.
(nes): s/STRNEQ/pvm_strcmp/.
(lts): s/strcmp/pvm_strcmp/.
(gts): Likewise.
(ges): Likewise.
(les): Likewise.
(sconc): s/${F}/pvm_${F}/.
(strset): Likewise.
(muls): Likewise.
(asettb): Likewise.
(strace): s/assert/pvm_assert/.
(sleep): s/nanosleep/pvm_nanosleep/.
* etc/pvm-wraps-static-whitelist: Update.
2022-01-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (PVM_RAISE_DIRECT): Use
`PVM_STATE_RUNTIME_FIELD` accessor.
(PVM_CALL): Likewise.
(return): Likewise.
(pushf): Likewise.
(popf): Likewise.
(pushvar): Likewise.
(pushtopvar): Likewise.
(popvar): Likewise.
(regvar): Likewise.
(pec): Likewise.
(pushhi): Likewise.
(pushlo): Likewise.
(write): Likewise.
(peekdi): Likewise.
(peekdiu): Likewise.
(peekdl): Likewise.
(peekdlu): Likewise.
(pokedi): Likewise.
(pokediu): Likewise.
(pokedl): Likewise.
(pokedlu): Likewise.
(pushe): Likewise.
2022-01-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-globals): Add pvm_literal_*.
(PVM_RAISE_DIRECT): Use `pvm_literal_code`.
(PVM_PEEK): Use `pvm_literal_enomem`.
(PVM_PRINTI): Use `pvm_literal_empty` and `pvm_literal_c`.
(PVM_PRINTL): Likewise.
(PVM_FORMATI): Likewise.
(PVM_FORMATL): Likewise.
(late-c): Define pvm_literal_* variables/constants.
(popob): Use `pvm_literal_inval_obase`.
(popom): Likewise.
(pushtopvar): Use `pvm_literal_no_toplevel_var`.
(endhl): Use `pvm_literal_nohyperlink`.
(endsc): Use `pvm_literal_invalid_class`.
(ains): Use `pvm_literal_eindex`.
(map): Use `pvm_literal_notmappable`.
(reloc): Likewise.
(ureloc): Likewise.
(peeks): Use `pvm_literal_enomem`.
(pushe): Use `pvm_literal_code`.
(strace): Use `pvm_literal_newline`.
* etc/pvm-wraps-static-whitelist: Add pvm_literal_*.
2022-01-27 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Wrapping globals): Clarify the role of
etc/pvm-wraps-whitelist and etc/pvm-wraps-static-whitelist.
2022-01-26 Jose E. Marchesi <jemarch@gnu.org>
* pvm-wraps-static-whitelist: New file.
* cfg.mk (sc_pvm_wrappers): Use etc/pvm-wraps-static-whitelist.
2022-01-26 Jan Seeger <jan.seeger@thenybble.de>
* pickles/elf-common.pk (elf_hash): New function.
2022-01-26 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (String Formatting): New section.
2022-01-26 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_pvm_wrappers): Use symbol whitelist.
* etc/pvm-wraps-whitelist: New file.
* etc/hacking.org (Wrapping globals): New section.
2022-01-26 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_pvm_wrappers): New rule.
2022-01-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_type_append_to): Avoid redundant comma in
function type strings.
2022-01-25 Jose E. Marchesi <jose.marchesi@oracle.com>
* libpoke/ios-dev-file.c (ios_dev_file_open): Do not create files
if no flags are specified.
2022-01-25 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (What not to use in Jitter instructions): New
section.
2022-01-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.pk (Pk_Table): New field max_column_size;
* poke/pk-cmd-def.c (pk_cmd_info_type): Call exception handler for
pk_compile_statement.
* libpoke/pkl-rt.pk: New fields `nfields' and `ftypes'.
Rename `fields' to `fnames'.
* libpoke/pkl-gen.pks (struct_typifier): Adapt accordingly.
* testsuite/poke.pkl/typeof-struct-1.pk: Update test.
* testsuite/poke.pkl/typeof-struct-2.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-3.pk: Likewise.
* testsuite/poke.pkl/typeof-structs-4.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-1.pk: Update test.
* testsuite/poke.pkl/typeof-struct-2.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-3.pk: Likewise.
* testsuite/poke.pkl/typeof-structs-4.pk: Likewise.
2022-01-25 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_type_append_to): Print `union' for
unions, and not `struct'.
2022-01-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec): Likewise.
* poke/pk-cmd-def.c (pk_cmd_info_type): Likewise.
* poke/pk-cmd-ios.c (pk_cmd_load_file): Likewise.
* poke/pk-cmd-vm.c (pk_cmd_vm_disas_fun): Likewise.
* poke/poke.h: Prototype for poke_handle_exception.
* poke/poke.c (poke_handle_exception): New function.
(parse_args_2): Use poke_handle_exception.
2022-01-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (print_type_decl): Honour HAVE_HSERVER.
2022-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd-set.c (pk_cmd_set): Use `PRId64` instead of `ld`.
2022-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd-def.c (PREP_REGEXP_PAYLOAD): Compare the string pointer
with NULL, not '\0'.
2022-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* common/pk-utils.h (pk_print_binary): Add new param `use_suffix_p`.
(pk_format_binary): Likewise.
* common/pk-utils.c (pk_print_binary): Likewise.
(pk_format_binary): Likewise.
* libpoke/pvm-val.c (pvm_print_val_1): Update `pk_print_binary` usage.
* libpoke/pvm.jitter (PVM_PRINTI): Likewise.
(PVM_PRINTL): Likewise.
(PVM_FORMATI): Likewise.
(PVM_FORMATL): Likewise.
* testsuite/poke.pkl/format-1.pk: Update test to reflect new behavior.
* testsuite/poke.pkl/printf-binary-5.pk: New test.
* testsuite/poke.pkl/printf-binary-6.pk: Likewise.
* testsuite/poke.pkl/printf-binary-7.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Make `sizeof' and `typeof' calls primaries.
2022-01-24 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-sub.c (ios_dev_sub_handler_normalize): Fix error
reporting.
2022-01-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.pk: New field `indent'.
(Pk_Table.print_table): Use `indent'.
2022-01-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Update copyright year.
2022-01-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_pr_func): Add the name of the
function to its type.
* testsuite/poke.pkl/typeof-23.pk: New test.
* testsuite/poke.pkl/typeof-24.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-env.c (_decl): Allow re-registering types.
* libpoke/pkl-tab.y (load_module): Allow loading the same module
more than once.
* libpoke/pkl.c (pkl_add_module): Do not add module to the list if
it is already loaded.
* testsuite/poke.pkl/load-3.pk: Remove test.
* testsuite/Makefile.am (EXTRA_DIST): Remove test load-3.pk.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/poke.texi (Casting Arrays): Add documentation for
array integrators.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans2_ps_op_attr): New phase for
computing attributes of complete type at compile-time.
(struct pkl_phase pkl_phase_trans2): Register new phase.
* testsuite/poke.map/map-size-2.pk: New test.
* testsuite/poke.map/map-size-3.pk: Likewise.
* testsuite/poke.map/maps-structs-pinned-3.pk: Likewise.
* testsuite/poke.pkl/attr-length-10.pk: Likewise.
* testsuite/poke.pkl/attr-length-11.pk: Likewise.
* testsuite/poke.pkl/attr-size-15.pk: Likewise.
* testsuite/poke.pkl/attr-size-16.pk: Likewise.
* testsuite/poke.pkl/attr-size-17.pk: Likewise.
* testsuite/poke.pkl/attr-size-18.pk: Likewise.
* testsuite/poke.pkl/attr-size-19.pk: Likewise.
* testsuite/poke.pkl/attr-size-20.pk: Likewise.
* testsuite/poke.pkl/attr-size-21.pk: Likewise.
* testsuite/poke.pkl/attr-unit-2.pk: Likewise.
* testsuite/poke.pkl/attr-unit-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_AAA_ADD): New macro for constant
folding ADD of array literals.
(PKL_PHASE_HANDLER_BIN_ARITH_ADD): New macro for folding ADD.
(PKL_PHASE_HANDLER_BIN_ARITH_SUB): New macro for folding SUB.
* libpoke/pkl-ast.h (pkl_ast_array_initializers_concat): New
function to concat two array literals.
* libpoke/pkl-ast.c (pkl_ast_array_initializers_concat): Likewise.
* testsuite/poke.pkl/arrays-16.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (pkl_ast_struct_type_field): Add `size` field.
(PKL_AST_STRUCT_TYPE_FIELD_SIZE): New accessor macro.
* libpoke/pkl-ast.c (pkl_ast_dup_type): Add support for `size`
field.
(pkl_ast_node_free): Likewise.
(pkl_ast_print_1): Likewise.
(pkl_ast_sizeof_type): Fix to the right thing for pinned structs,
arrays with offset bounds, structs with labels.
(pkl_ast_type_is_complete): Fix the logic for structs. Add support
for unions. Fix the logic for arrays to support offsets as bounds
as well as check for completeness of element type.
* libpoke/pkl-pass.c (pkl_do_pass_1): Add support for `size` field.
* libpoke/pkl-trans.c (pkl_trans2_ps_struct_type_field): New
phase to calculate the size of fields of struct if they are complete.
(struct pkl_phase_trans2): Register new phase.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_make_offset): An offset value
is literal if the magnitude and unit are also literals.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct): Postpone type
completion decision to `pkl_typify2_ps_type` phase.
2022-01-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_funcall): When the arg
doesn't have a name, uses the arg index in error reporting.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (typifier_deintegrator_wrapper): New
function.
(struct_typifier): Use it.
* testsuite/poke.pkl/typeof-20.pk: Update test.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (typifier_writer_wrapper): New function.
(typifier_any_any_wrapper): Likewise.
(typifier_any_any_int_wrapper): Likewise.
(array_typifier): Use the wrappers.
(struct_typifier): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Generate struct typifier
after the other closures have been compiled.
* testsuite/poke.pkl/typeof-11.pk: New test.
* testsuite/poke.pkl/typeof-12.pk: Likewise.
* testsuite/poke.pkl/typeof-13.pk: Likewise.
* testsuite/poke.pkl/typeof-14.pk: Likewise.
* testsuite/poke.pkl/typeof-15.pk: Likewise.
* testsuite/poke.pkl/typeof-16.pk: Likewise.
* testsuite/poke.pkl/typeof-17.pk: Likewise.
* testsuite/poke.pkl/typeof-18.pk: Likewise.
* testsuite/poke.pkl/typeof-19.pk: Likewise.
* testsuite/poke.pkl/typeof-20.pk: Likewise.
* testsuite/poke.pkl/typeof-21.pk: Likewise.
* testsuite/poke.pkl/typeof-22.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_formater): Avoid a segmentation
fault when compiling formatters for anonymous fields.
* testsuite/poke.pkl/format-39.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Compile formaters and
printers for named array and struct types.
* testsuite/poke.pkl/printf-38.pk: New test.
* testsuite/poke.pkl/printf-39.pk: Likewise.
* testsuite/poke.pkl/format-37.pk: Likewise.
* testsuite/poke.pkl/format-38.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Document RAS_COMP_ENV and RAS_COMPILER and use them.
* libpoke/pkl-gen.c (RAS_COMP_ENV): define.
(RAS_COMPILER): Likewise.
* libpoke/pkl-gen.h (struct pkl_gen_payload): New field `env'.
(pkl_gen_init_payload): Install `env' in the GEN payload.
* libpoke/pkl-asm.c (pkl_asm_call): Get an `env' argument.
* libpoke/pkl.c (rest_of_compilation): Get an `env' argument.
(pkl_execute_buffer): Pass `env' to rest_of_compilation.
(pkl_execute_statement): Likewise.
(pkl_compile_expression): Likewise.
(pkl_execute_expression): Likewise.
(pkl_execute_file): Likewise.
* libpoke/pk-rt-2.pk: Remove file.
* libpoke/pkl-rt.k: Rename from pkl-rt-1.pk
* libpoke/Makefile.am (dist_pkgdata_DATA): Adapt accordingly.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (pk_compile_file): Fix indentation.
* libpoke/pkl.c (pkl_execute_file): Return an error in case of
memory exhaustion.
(pkl_execute_expression): Likewise.
(pkl_compile_expression): Likewise.
(pkl_execute_statement): Likewise.
(pkl_execute_buffer): Likewise.
2022-01-23 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Add entries for 1.90.
2022-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt-1.pk (Pk_Type): Add closures for array and struct
types.
* libpoke/pkl-gen.pks (struct_typifier): Install struct closures.
(array_typifier): Likewise.
2022-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt-1.pk (Pk_Type): Use optional fields to have a
flat structure.
* poke/pk-info.pk (pk_info_type): Adjust accordingly.
* libpoke/pkl-gen.pks (integral_typifier): Likewise.
(offset_typifier): Likewise.
(array_typifier): Likewise.
(struct_typifier): Likewise.
* testsuite/poke.pkl/typeof-structs-4.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-3.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-2.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-1.pk: Likewise.
* testsuite/poke.pkl/typeof-offset-3.pk: Likewise.
* testsuite/poke.pkl/typeof-offset-2.pk: Likewise.
* testsuite/poke.pkl/typeof-offset-1.pk: Likewise.
* testsuite/poke.pkl/typeof-int-2.pk: Likewise.
* testsuite/poke.pkl/typeof-int-1.pk: Likewise.
* testsuite/poke.pkl/typeof-array-2.pk: Likewise.
* testsuite/poke.pkl/typeof-array-1.pk: Likewise.
2022-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (union_comparator): New function.
* libpoke/pkl-gen.c: Install union comparators instead of struct
comparators whenever appropriate.
* testsuite/poke.pkl/eq-unions-1.pk: New test.
* testsuite/poke.pkl/eq-unions-7.pk: Likewise.
* testsuite/poke.pkl/eq-unions-6.pk: Likewise.
* testsuite/poke.pkl/eq-unions-5.pk: Likewise.
* testsuite/poke.pkl/eq-unions-4.pk: Likewise.
* testsuite/poke.pkl/neq-unions-1.pk: Likewise.
* testsuite/poke.pkl/eq-unions-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk: Move pk_exception_handler from pk-repl.pk.
* poke/Makefile.am (dist_pkgdata_DATA): Remove pk-repl.pk.
2022-01-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_execute_statement): Do not return an error if
an exception is raised.
(pkl_execute_expression): Likewise.
(pkl_execute_buffer): Likewise.
* poke/pk-repl.pk: New file.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-repl.pk.
* poke/poke.pk: Load pk-repl.pk.
* libpoke/pkl-asm.c (pkl_asm_finish): Do not call the default
exception handler.
* poke/pk-cmd.c (pk_cmd_exec): Call pk_exception_handler whenever
necessary.
(pk_cmd_exec): Pass an exit_status to pk_print_val.
* libpoke/pvm.jitter (pvm_literal_printer): Adapt accordingly.
(pvm_literal_printer_lo): Likewise.
(strace): Likewise.
* libpoke/libpoke.c (pk_print_val): Add argument exit_exception.
* libpoke/pvm-val.c (pvm_print_val): Likewise.
(pvm_print_val_1): Likewise.
(PVM_PRINT_VAL_1): Likewise.
(pvm_call_pretty_printer): Likewise.
* libpoke/pvm-val.c (pvm_print_val_with_params): Likewise.
* libpoke/pvm.c (pvm_call_closure): Likewise.
* poke/pk-table.c (pk_table_print): Likewise.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (info_type_cmd): Define.
(pk_cmd_info_type): New function.
* poke/pk-cmd-info.c: (info_cmds): Add info_type_cmd.
* poke/pk-info.pk: New file.
* poke/poke.pk: Load pk-info.pk.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-info.pk.
* doc/poke.texi (info command): Document .info type NAME.
* poke/pk-help.pk: Likewise.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (info_types_cmd): Accept an optional regexp as
an argument for .info types.
(info_var_cmd): Likewise.
(info_fun_cmd): Likewise.
(struct pk_info_payload): New type.
* poke/pk-help.pk: Update help for .info
{types,variables,functions}.
* doc/poke.texi (info command): Update doc.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Allow casts from
string to string.
* testsuite/poke.pkl/typeof-10.pk: New test.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt-2.pk: Define PK_TYPE_* values.
(Pk_Type): New struct type.
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_TYPIFIER): Define.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Initialize the
struct typifier to NULL.
* libpoke/pkl-env.h: Prototype for pkl_env_lookup_type and
pkl_env_lookup_var.
* libpoke/pkl-env.c (pkl_env_lookup_type): New function.
(pkl_env_lookup_var): Likewise.
* libpoke/pkl-ops.def: New unary operator SIZEOF.
* libpoke/pkl-tab.y: New token TYPEOF.
(expression): Rule for typeof.
* libpoke/pkl-lex.l: Handle token TYPEOF.
* libpoke/pkl-typify.c (pkl_typify1_pr_op_typeof): New handler.
(pkl_phase_typify1): Register handler.
* libpoke/pkl-gen.h (PKL_GEN_CTX_IN_TYPIFIER): Define.
* libpoke/pkl-gen.c (pkl_phase_gen_or_typeof): New handler.
(pkl_phase_gen): Register handler.
(pkl_gen_ps_type_integral): Handle IN_TYPIFIER.
(pkl_gen_pr_type_offset): Likewise.
(pkl_gen_ps_type_string): Likewise.
(pkl_gen_pr_type_struct): Likewise.
(pkl_gen_ps_type_any): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_pr_decl): Compile typifier closures for declared struct
types.
* libpoke/pkl-gen.pks (integral_typifier): New macro.
(offset_typifier): Likewise.
(string_typifier): Likewise.
(array_typifier): Likewise.
(common_typifier): Likewise.
(struct_typifier): New function.
* testsuite/poke.pkl/typeof-1.pk: New test.
* testsuite/poke.pkl/typeof-9.pk: Likewise.
* testsuite/poke.pkl/typeof-8.pk: Likewise.
* testsuite/poke.pkl/typeof-7.pk: Likewise.
* testsuite/poke.pkl/typeof-6.pk: Likewise.
* testsuite/poke.pkl/typeof-5.pk: Likewise.
* testsuite/poke.pkl/typeof-4.pk: Likewise.
* testsuite/poke.pkl/typeof-2.pk: Likewise.
* testsuite/poke.pkl/typeof-3.pk: Likewise.
* testsuite/poke.pkl/typeof-offset-3.pk: Likewise.
* testsuite/poke.pkl/typeof-offset-2.pk: Likewise.
* testsuite/poke.pkl/typeof-offset-1.pk: Likewise.
* testsuite/poke.pkl/typeof-int-1.pk: Likewise.
* testsuite/poke.pkl/typeof-int-2.pk: Likewise.
* testsuite/poke.pkl/typeof-array-2.pk: Likewise.
* testsuite/poke.pkl/typeof-array-1.pk: Likewise.
* testsuite/poke.pkl/typeof-structs-4.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-3.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-2.pk: Likewise.
* testsuite/poke.pkl/typeof-struct-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Check that every .function has a prolog
instruction.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-dark.css: Renamed from poke-default.css.
* etc/poke-bright.css: New file.
* etc/Makefile.am (dist_pkgdata_DATA): Rename poke-dar.css and add
poke-bright.css.
* poke/poke.c (print_help): Add --help output for --style-dark and
--style-bright.
* poke/pk-term.c (pk_term_init): Use poke-dark.css or
poke-bright.css depending on the default setting.
* doc/poke.texi (Invoking poke): Document --style-dark and
--style-bright.
2022-01-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/cast-any-to-function-diag-1.pk: Update
expected error.
* testsuite/poke.pkl/cast-void-diag-1.pk: Likewise.
* testsuite/poke.pkl/cast-struct-diag-3.pk: Likewise.
* testsuite/poke.pkl/cast-struct-diag-2.pk: Likewise.
* testsuite/poke.pkl/cast-struct-diag-1.pk: Likewise.
* testsuite/poke.pkl/cast-str-diag-1.pk: Likewise.
* testsuite/poke.pkl/cast-diag-9.pk: New test.
* testsuite/poke.pkl/cast-diag-10.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cond_exp): Fix diagnostics.
* testsuite/poke.pkl/cond-exp-diag-1.pk: Update expected error.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/if-diag-3.pk: Likewise.
* testsuite/poke.pkl/if-diag-2.pk: Likewise.
* testsuite/poke.pkl/if-diag-1.pk: Update expected error.
* libpoke/pkl-typify.c (pkl_typify1_ps_if_stmt): Fix diagnostics.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Fix
diagnostics.
* testsuite/poke.pkl/label-diag-1.pk: Update expected error.
* testsuite/poke.pkl/optcond-1-diag.pk: Likewise.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_try_catch_stmt): Fix
diagnostics.
* testsuite/poke.pkl/try-catch-diag-4.pk: Update expected error.
* testsuite/poke.pkl/try-catch-diag-5.pk: Likewise.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_try_until_stmt): Fix
diagnostics.
* testsuite/poke.pkl/try-until-diag-1.pk: Update expected error.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_print_stmt): Fix
diagnostics.
* testsuite/poke.pkl/print-diag-1.pk: Update expected error.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_format): Improve
diagnostics.
* testsuite/poke.pkl/printf-diag-18.pk: Adapt expected error.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_loop_stmt): Improve
diagnostics.
(pkl_typify1_ps_loop_stmt_iterator): Likewise.
* testsuite/poke.pkl/for-diag-1.pk: Update expected error.
* testsuite/poke.pkl/for-diag-2.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_incrdecr): Improve
diagnostics.
* testsuite/poke.pkl/postincr-diag-1.pk: Update expected error.
* testsuite/poke.pkl/postincr-diag-3.pk: Likewise.
* testsuite/poke.pkl/postincr-diag-2.pk: Likewise.
* testsuite/poke.pkl/postincr-diag-4.pk: Likewise.
* testsuite/poke.pkl/preincr-diag-2.pk: Likewise.
* testsuite/poke.pkl/preincr-diag-1.pk: Likewise.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_map): Improve diagnostics.
* testsuite/poke.pkl/map-diag-6.pk: New test.
* testsuite/poke.pkl/map-ios-diag-1.pk: Update expected error.
* testsuite/poke.pkl/map-ios-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Improve
diagnostics.
* testsuite/poke.pkl/int-struct-type-diag-16.pk: New test.
* testsuite/poke.pkl/int-struct-type-diag-17.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-14.pk: Update test.
* testsuite/poke.pkl/int-struct-type-diag-12.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-8.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-9.pk: Likewise.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_ref): Improve
diagnostics.
* testsuite/poke.pkl/struct-ref-diag-1.pk: Update expected error.
* testsuite/poke.pkl/struct-ref-diag-2.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_indexer): Improve
diagnostics.
* testsuite/poke.pkl/arrays-index-diag-4.pk: New test.
* testsuite/poke.pkl/arrays-index-diag-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_trimmer): Improve
diagnostics.
* testsuite/poke.pkl/trim-diag-1.pk: Adapt expected test.
* testsuite/poke.pkl/trim-diag-5.pk: Likewise.
* testsuite/poke.pkl/trim-diag-4.pk: Likewise.
* testsuite/poke.pkl/trim-diag-3.pk: Likewise.
* testsuite/poke.pkl/trim-diag-2.pk: Likewise.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_funcall): Improve
diagnostics.
* testsuite/poke.pkl/funcall-diag-5.pk: Update expected error.
* testsuite/poke.pkl/funcall-diag-6.pk: New test.
* testsuite/poke.pkl/funcall-diag-7.pk: Likewise.
* testsuite/poke.pkl/funcall-diag-8.pk (foo): Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_array): Improve
diagnostics.
* testsuite/poke.pkl/array-bound-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Fix location of struct type labels.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Improve
diagnostic.
* testsuite/poke.pkl/label-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal1_ps_type_struct): Make diagnostic
error self-explicative without location.
(pkl_anal1_ps_funcall): Turn error into ICE.
(pkl_anal1_ps_cons): Likewise.
* testsuite/poke.pkl/cast-diag-2.pk: Fix test.
* testsuite/poke.pkl/trim-diag-1.pk: Likewise.
* testsuite/poke.pkl/trim-diag-2.pk: Likewise.
* testsuite/poke.pkl/trim-diag-3.pk: Likewise.
* testsuite/poke.pkl/offset-diag-1.pk: New test.
* testsuite/poke.pkl/return-diag-3.pk: Likewise.
* testsuite/poke.pkl/return-diag-4.pk: Likewise.
* testsuite/poke.pkl/gt-integers-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-offsets-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-strings-diag-1.pk: Likewise.
* testsuite/poke.pkl/eq-structs-diag-2.pk: Likewise.
* testsuite/poke.pkl/gt-structs-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-functions-diag-2.pk: Likewise.
* testsuite/poke.pkl/eq-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-diag-3.pk: Likewise.
* testsuite/poke.pkl/cast-diag-8.pk: Likewise.
* testsuite/poke.pkl/add-strings-diag-1.pk: Likewise.
* testsuite/poke.pkl/div-diag-2.pk: Likewise.
* testsuite/poke.pkl/bconc-diag-3.pk: Likewise.
* testsuite/poke.pkl/array-diag-1.pk: Likewise.
* testsuite/poke.pkl/index-diag-1.pk: Likewise.
* testsuite/poke.pkl/index-diag-2.pk: Likewise.
* testsuite/poke.pkl/funcall-diag-5.pk: Likewise.
* testsuite/poke.pkl/struct-ref-diag-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-20 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Maintenance): Note that jitter's no-threading
doesn't work with gcov.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_bconc): Fix diagnostics.
* testsuite/poke.pkl/bconc-diag-1.pk: Adapt expected error.
* testsuite/poke.pkl/bconc-diag-2.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps-op_in): Fix diagnostics.
* testsuite/poke.pkl/in-diag-3.pk: Adapt expected error.
* testsuite/poke.pkl/in-diag-1.pk: Likewise.
* testsuite/poke.pkl/in-diag-2.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_bin): New handler.
(pkl_phase_typify1): Use new handler for IOS, XOR, BAND, SUB, DIV,
CEILDIV, MOD and ADD.
(TYPIFY_BIN): Remove.
* testsuite/poke.pkl/add-arrays-diag-1.pk: Adapt expected error.
* testsuite/poke.pkl/cdiv-integers-diag-2.pk: Likewise.
* testsuite/poke.pkl/add-diag-1.pk: Likewise.
* testsuite/poke.pkl/add-arrays-diag-3.pk: Likewise.
* testsuite/poke.pkl/add-arrays-diag-2.pk: Likewise.
* testsuite/poke.pkl/div-offsets-diag-3.pk: New test.
* testsuite/poke.pkl/mod-offsets-diag-2.pk: Likewise.
* testsuite/poke.pkl/sub-diag-2.pk: Likewise.
* testsuite/poke.pkl/sub-diag-1.pk: Likewise.
* testsuite/poke.pkl/band-diag-2.pk: Likewise.
* testsuite/poke.pkl/band-diag-1.pk: Likewise.
* testsuite/poke.pkl/xor-diag-2.pk: Likewise.
* testsuite/poke.pkl/ior-diag-1.pk: Likewise.
* testsuite/poke.pkl/add-arrays-diag-4.pk: Likewise.
* testsuite/poke.pkl/add-diag-2.pk: Likewise.
* testsuite/poke.pkl/div-diag-1.pk: Likewise.
* testsuite/poke.pkl/add-diag-3.pk: Likewise.
* testsuite/poke.pkl/add-offsets-diag-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Prototype for pkl_type_integral_promote.
* libpoke/pkl-ast.c (pkl_type_integral_promote): New function.
* libpoke/pkl-typify.c (pkl_typify1_ps_mul): Fix diagnostics.
* testsuite/poke.pkl/mul-diag-1.pk: Renamed from
mul-diag-strings-1.pk.
* testsuite/poke.pkl/mul-diag-2.pk: New test.
* testsuite/poke.pkl/mul-diag-3.pk: Likewise.
* testsuite/poke.pkl/mul-diag-4.pk: Likewise.
* testsuite/poke.pkl/mul-diag-5.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_bshift_pow): Fix
diagnostics.
* testsuite/poke.pkl/pow-diag-1.pk: Adapt expected error.
* testsuite/poke.pkl/pow-diag-2.pk: Likewise.
* testsuite/poke.pkl/sr-diag-1.pk: Likewise.
* testsuite/poke.pkl/sr-diag-2.pk: Likewise.
* testsuite/poke.pkl/sl-diag-4.pk: Likewise.
* testsuite/poke.pkl/sl-diag-5.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Fix diagnostics.
* testsuite/poke.pkl/cast-struct-diag-1.pk: Adapt expected error.
* testsuite/poke.pkl/cast-struct-diag-2.pk: Likewise.
* testsuite/poke.pkl/cast-struct-diag-3.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_neg_pos_bnot): Rename from
pkl_typify1_ps_first_operand.
(pkl_phase_typify1): Adapt accordingly.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_first_operand): Do not
handle UNMAP.
(pkl_tipify1_ps_op_unmap): Fix diagnostics.
* testsuite/poke.pkl/unmap-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_first_operand): Fix
diagnostics.
* testsuite/poke.pkl/bnot-diag-1.pk: Adapt expected error.
* testsuite/poke.pkl/neg-diag-1.pk: Likewise.
* testsuite/poke.pkl/pos-diag-1.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_boolean): Fix
diagnostics.
* testsuite/poke.pkl/and-diag-1.pk: Adapt test.
* testsuite/poke.pkl/and-diag-2.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (primary): Add location information for
lambdas.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (INVALID_FIRST_OPERAND): Define.
(INVALID_SECOND_OPERAND): Likewise.
(pkl_typify1_ps_op_rela): Fix diagnostics.
* testsuite/poke.pkl/eq-any-diag-1.pk: Adapt expected error.
* testsuite/poke.pkl/neq-any-diag-1.pk: Likewise.
* testsuite/poke.pkl/lt-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/lt-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/le-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/le-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/ge-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/ge-arrays-diag-1.pk: Likewise.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_not): Fix diagnostics.
* testsuite/poke.pkl/not-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-19 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Disallow
labels in unions.
* doc/poke.texi (Unions): Update.
* testsuite/poke.pkl/union-diag-9.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (openproc): New function.
* doc/poke.texi (openproc): New section.
2022-01-18 Luca Saiu <positron@gnu.org>
* bootstrap.conf (bootstrap_post_import_hook): Use the specified
--gnulib-srcdir for bootstrapping Jitter as well: redefine
GNULIB_SRCDIR to be an absolute path, then cd to the Jitter source
directory and pass Gnulib's absolute path to Jitter's bootstrap
script; do not rely on a hardwired --gnulib-srcdir=../gnulib .
(bootstrap_post_import_hook): Add missing quotations when
expanding GNULIB_SRCDIR and JITTER_SRCDIR.
* etc/hacking.org: Documentation: describe --jitter-srcdir=... in
a correct context, also passing --gnulib-srcdir=... as required.
2022-01-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Disallow
labels in pinned structs.
* doc/poke.texi (Pinned Structs): Update.
* testsuite/poke.pkl/scons-label-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-18 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Disallow
pinned unions.
* doc/poke.texi (Unions): Update.
* testsuite/poke.pkl/pinned-union-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-18 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-require): Refer to etc/hacking.org
instead of HACKING.
2022-01-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-diag.c (pkl_warning): Honor pkl_quiet_p for warning location.
(pkl_warning): Do not handle
pkl_error_on_warning here.
* libpoke/pkl-anal.c (pkl_anal2_ps_struct_type_field): Do it here.
(pkl_anal2_ps_type_struct): And here.
* testsuite/poke.cmd/set-error-on-warning.pk: Do not test error
case here.
* testsuite/poke.cmd/set-error-on-warning-diag.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-scrabble.pk (scrabble): Move variable declaration up to
avoid allocation overhead in loop.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Simple Configuration): Renamed from Getting
Started.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Setting up Hyperlinks): New chapter.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-default.css (.setting-integer): New class.
(.setting-string): Likewise.
(.setting-boolean): Likewise.
* poke/pk-settings.pk (pk_settings_dump): Add styling to the
setting values.
Add a table header.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk (pk_settings_dump): Emit a
Toggling... message in hyperlink actions.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk: Add documentation for the `endian' setting.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* doc/settings-to-texi.pk: New file.
* doc/Makefile.am (poke_TEXINFOS): Add poke-settings.texi.
(poke-settings.texi): Rule to enerate poke-settings.texi.
(MAINTAINERCLEANFILES): Add poke-settings.texi.
(EXTRA_DIST): Likewise.
* doc/poke.texi (set command): Include poke-settings.texi.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk (pk_settings_dump): Avoid allocating a
local.
Reorder setting entries.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk (pk_settings_dump): Do not quote the values
of string setting values.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk (pk_settings_dump): Add [toggle] button for
boolean settings.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Initialize the value of pk_hserver_p.
* poke/poke.pk (pk_hserver_p): Define.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.pk (Pk_Table.print_table): Do not emit fill
characters for the last columns in the table.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-set.c (pk_cmd_set_dump): Make an hyperlink for
error-on-warning.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.pk: New file.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-table.pk.
* poke/pk-settings.pk (pk_settings_dump): Use pk_table.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (pk_map_alien_token_handler): Remove spurious
trace.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_pr_loop_stmt): New handler.
(pkl_phase_trans1): Register handler.
(pkl_trans1_ps_loop_stmt): for-loops with decl heads also
introduce a lexical scope.
* testsuite/poke.pkl/struct-method-18.pk: New test.
* testsuite/poke.pkl/struct-method-19.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk: Support a synopsis entry for "settings" help
entries.
* poke/pk-settings.pk: Set the synopsis of help entries to
`usage'.
Make `setter' to return a boolean.
2022-01-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk: Document .set without arguments.
2022-01-16 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-bin2poke.in: Handle command-line argument --var/-v.
2022-01-16 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-strings.in: Add emacs local variables.
* utils/pk-bin2poke.in: Likewise.
2022-01-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-stream.c (ios_dev_stream_pread): Fix handling of
errors and EOF in buffer write-back.
* libpoke/ios-buffer.c (ios_buffer_allocate_new_chunk): Use IOD_OK
instead of 0.
(ios_buffer_pread): Likewise.
(ios_buffer_pwrite): Likewise.
(ios_buffer_forget_till): Likewise.
2022-01-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/lib/poke.exp (tests_pattern): New variable.
(tests_pattern_pk): Likewise.
* testsuite/poke.cmd/cmd.exp: Use `tests_pattern`.
* testsuite/poke.map/map.exp: Likewise.
* testsuite/poke.pickles/pickles.exp: Likewise.
* testsuite/poke.pkl/pkl.exp: Likewise.
* testsuite/poke.pktest/pktest.exp: Likewise.
* testsuite/poke.std/std.exp: Likewise.
* testsuite/poke.time/time.exp: Likewise.
* etc/hacking.org (Run selected tests): New section.
2022-01-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev.h (struct ios_dev_if): Move comments to
libpoke.h.
* libpoke/libpoke.h (struct ios_iod_if): Add comments moved
from ios-dev.h
2022-01-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (pk_array_elem_value): Rename from
pk_array_elem_val.
* libpoke/pk-val.c (pk_array_elem_value): Likewise.
* poke/pk-cmd-set.c (pk_cmd_set_init): Update accordingly.
* poke/pk-mi-json.c (pk_val_to_json_array): Likewise.
* poke/pk-ios.c (pk_open_file): Likewise.
2022-01-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (PK_VAL_TYPE): Define.
* libpoke/pk-val.c (pk_val_kind): Return PK_VAL_TYPE for types.
2022-01-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (PK_TYPE_UNKNOWN): Rename from PK_UNKNOWN.
(PK_TYPE_INT): Likewise.
(PK_TYPE_UINT): Likewise.
(PK_TYPE_STRING): Likewise.
(PK_TYPE_OFFSET): Likewise.
(PK_TYPE_ARRAY): Likewise.
(PK_TYPE_STRUCT): Likewise.
(PK_TYPE_CLOSURE): Likewise.
(PK_TYPE_ANY): Likewise.
(PK_VAL_INT): Define.
(PK_VAL_UINT): Likewise.
(PK_VAL_STRING): Likewise.
(PK_VAL_OFFSET): Likewise.
(PK_VAL_ARRAY): Likewise.
(PK_VAL_STRUCT): Likewise.
(PK_VAL_CLOSURE): Likewise.
Prototype for pk_val_kind.
* libpoke/pk-val.c (pk_val_kind): New function.
(pk_type_code): Adapt to use PK_TYPE_* values.
* poke/pk-ios.c (pk_open_file): Adapt accordingly.
* poke/pk-map.c (pk_map_load_parsed_map): Likewise.
(pk_map_resolve_map): Likewise.
* poke/pk-mi-msg.c: Likewise.
* poke/pk-mi-msg.def: Likewise.
* poke/pk-mi-json.c: Likewise.
2022-01-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Field Labels): Update section taking into account
integral structs.
2022-01-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/poke-cmd-misc.c (pk_cmd_jmd): New quote.
2022-01-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.h (pvm_run): Add new arg for exception.
* libpoke/pvm.c (pvm_run): Report exception.
(pvm_call_closure): Fix pvm_run invocation.
(PVM_STATE_EXCEPTION_VALUE): New macro.
* libpoke/pkl.h (pkl_execute_file): Add new arg for exception.
(pkl_execute_buffer): Likewise.
(pkl_execute_expression): Likewise.
(pkl_execute_statement): Likewise.
* libpoke/pkl.c (pkl_execute_file): Likewise.
(pkl_execute_buffer): Likewise.
(pkl_execute_expression): Likewise.
(pkl_execute_statement): Likewise.
* libpoke/libpoke.h (pk_file_compile): Likewise.
(pk_compile_buffer): Likewise.
(pk_compile_statement): Likewise.
(pk_compile_expression): Likewise.
* libpoke/libpoke.c (pk_file_compile): Likewise.
(pk_compile_buffer): Likewise.
(pk_compile_statement): Likewise.
(pk_compile_expression): Likewise.
(pk_call): Fix pvm_run invocation.
* libpoke/pvm.jitter (state-struct-backing-c): Add new field.
(popexite): Add new instruction.
* libpoke/pkl-insn.def: Likewise.
* libpoke/pkl-rt-1.pk (_pkl_exception_handler): Change return value
to `Exception` from `int<32>`.
* libpoke/pkl-asm.c (pkl_asm_finish): Update to report exception.
* poke/pk-cmd-ios.c (pk_cmd_load_file): Fix comment.
* poke/pk-map.c (pk_map_load_parsed_map): Likewise.
* poke/poke.c (parse_args_2): Update to use exception value.
* libpoke/std.pk (exit): Set `name` field.
2022-01-13 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (PK_EC_*): Add macros for standard exception
codes.
* libpoke/pkl-rt-1.pk: Update comment to mention libpoke.h.
* libpoke/pvm.h: Likewise.
2022-01-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-diag.c (pkl_detailed_location): Normalize tabs to
spaces in the source location line to avoid displacements.
2022-01-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_typeof): If given a type value, return
the value.
* libpoke/pvm.jitter (typof): Change documentation accordingly.
* libpoke/libpoke.h (pk_typeof): Likewise.
* testsuite/poke.libpoke/values.c (test_pk_typeof): New function.
(main): Call test_pk_typeof.
2022-01-11 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-vm.c (pk_cmd_vm_disas_fun): Likewise.
* libpoke/pkl.c (pkl_execute_buffer): Get an argument exit_status.
(pkl_execute_statement): Likewise.
(pkl_execute_expression): Likewise.
* libpoke/libpoke.c (pk_compile_buffer): Likewise.
(pk_compile_statement): Likewise.
(pk_compile_expression): Likewise.
* libpoke/pkl.h: Adjust function prototypes accordingly.
* libpoke/libpoke.h: Likewise.
* poke/pk-cmd.c (pk_cmd_exec): Pass additional arguments to
pk_compile_{buffer,statement}.
* testsuite/poke.libpoke/values.c (testcase_pk_val_equal_p): Likewise.
* testsuite/poke.libpoke/foreign-iod.c (main): Likewise.
(TEST_IO): Likewise.
(main): Likewise.
* poke/pk-mi.c (pk_mi_dispatch_msg): Likewise.
* poke/pk-map.c (pk_map_load_parsed_map): Likewise.
(pk_map_load_parsed_map): Likewise.
(pk_map_load_parsed_map): Likewise.
* testsuite/poke.mi-json/mi-json.c (compile_initial_poke_code): LIkewise.
(compile_poke_expression): Likewise.
2022-01-08 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-bin2poke.in: New file.
* utils/Makefile.am (pk-bin2poke): New rule.
(EXTRA_DIST): Add pk-bin2poke.
(bin_SCRIPTS): Likewise.
2022-01-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (pkl_ast_type_integrable_p): New function.
(struct pkl_ast_type): Add field for array integrator closure.
(PKL_AST_TYPE_A_INTEGRATOR): New accessor macro.
* libpoke/pkl-ast.c (pkl_ast_make_array_type): Add integrator field.
(pkl_ast_type_integrable_p): New function.
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Handle cast from
array to integer.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Add array integrator.
(pkl_gen_pr_cast): Likewise.
(pkl_gen_pr_type_array): Likewise.
* libpoke/pkl-gen.pks (array_integrator): Add implementation of
array integrator.
* testsuite/poke.pkl/array-integ-1.pk: New test.
* testsuite/poke.pkl/array-integ-1.pk: Likewise.
* testsuite/poke.pkl/array-integ-2.pk: Likewise.
* testsuite/poke.pkl/array-integ-3.pk: Likewise.
* testsuite/poke.pkl/array-integ-4.pk: Likewise.
* testsuite/poke.pkl/array-integ-5.pk: Likewise.
* testsuite/poke.pkl/array-integ-6.pk: Likewise.
* testsuite/poke.pkl/array-integ-7.pk: Likewise.
* testsuite/poke.pkl/array-integ-8.pk: Likewise.
* testsuite/poke.pkl/array-integ-9.pk: Likewise.
* testsuite/poke.pkl/array-integ-10.pk: Likewise.
* testsuite/poke.pkl/array-integ-11.pk: Likewise.
* testsuite/poke.pkl/array-integ-12.pk: Likewise.
* testsuite/poke.pkl/array-integ-13.pk: Likewise.
* testsuite/poke.pkl/array-integ-14.pk: Likewise.
* testsuite/poke.pkl/array-integ-15.pk: Likewise.
* testsuite/poke.pkl/array-integ-16.pk: Likewise.
* testsuite/poke.pkl/array-integ-17.pk: Likewise.
* testsuite/poke.pkl/array-integ-18.pk: Likewise.
* testsuite/poke.pkl/array-integ-19.pk: Likewise.
* testsuite/poke.pkl/array-integ-20.pk: Likewise.
* testsuite/poke.pkl/array-integ-21.pk: Likewise.
* testsuite/poke.pkl/array-integ-22.pk: Likewise.
* testsuite/poke.pkl/array-integ-23.pk: Likewise.
* testsuite/poke.pkl/array-integ-24.pk: Likewise.
* testsuite/poke.pkl/array-integ-25.pk: Likewise.
* testsuite/poke.pkl/array-integ-26.pk: Likewise.
* testsuite/poke.pkl/array-integ-27.pk: Likewise.
* testsuite/poke.pkl/array-integ-28.pk: Likewise.
* testsuite/poke.pkl/array-integ-29.pk: Likewise.
* testsuite/poke.pkl/array-integ-30.pk: Likewise.
* testsuite/poke.pkl/array-integ-31.pk: Likewise.
* testsuite/poke.pkl/array-integ-32.pk: Likewise.
* testsuite/poke.pkl/array-integ-33.pk: Likewise.
* testsuite/poke.pkl/array-integ-34.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (struct_field_inserter): Use `zero_extend_64`.
(struct_deintegrator): Likewise.
2022-01-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (zero_extend_64): Add new macro.
2022-01-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm-val.c (pvm_print_val_1): Add `0x` prefix to
`{,u}long_fmt`.
* testsuite/poke.pkl/bconc-4.pk: Fix the test.
2022-01-08 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-insn.def (PKL_INSN_LUTOLU): Fix to use `lutolu`
insn.
* poke.pkl/cast-integers-18.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2022-01-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_inserter): Use 64-bit
arithmetic.
* testsuite/poke.pkl/deint-struct-12.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Prototype for pkl_ast_sizeof_integral_type.
* libpoke/pkl-ast.c (pkl_ast_sizeof_integral_type): New function.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Allow
integral structs nested in other integral structs.
* libpoke/pkl-gen.h (PKL_GEN_CTX_IN_INTEGRATOR): Define.
(PKL_GEN_CTX_IN_DEINTEGRATOR): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Use a dedicated context
when compiling struct type integrators.
(pkl_gen_pr_cast): Likewise.
(pkl_gen_pr_type_struct): Add in_integrator and in_deintegrator
cases.
* libpoke/pkl-gen.pks (struct_field_extractor): Support nested
integral structs.
(struct_field_inserter): Likewise.
(struct_writer): Likewise.
(struct_integrator): Likewise.
(deint_extract_field_value): Likewise.
(struct_deintegrator): Likewise.
* testsuite/poke.pkl/int-struct-type-diag-9.pk: Rewrite test.
* testsuite/poke.pkl/int-struct-type-diag-15.pk: New test.
* testsuite/poke.pkl/int-struct-3.pk: Likewise.
* testsuite/poke.pkl/int-struct-4.pk: Likewise.
* testsuite/poke.map/maps-int-structs-29.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-5.pk: Likewise.
* testsuite/poke.pkl/deint-struct-10.pk: Likewise.
* testsuite/poke.pkl/deint-struct-11.pk: Likewise.
* testsuite/poke.map/ass-map-24.pk: Likewise.
* testsuite/poke.map/asss-map-25.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add missing test.
2022-01-05 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk: Set INDENT_SOURCES to the empty string.
2022-01-05 Jose E. Marchesi <jemarch@gnu.org>
* gui/poke-gui.c (load_script): Do not use alloca.
* bootstrap.conf (gui_modules): Do not use the gnulib alloca
module.
2022-01-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Compile printer and
formater closures conditionally but install environment
unconditionally.
* testsuite/poke.pkl/printf-37.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Compile type closures
conditionally but install environment unconditionally.
(LMAP): Likewise.
(pkl_gen_pr_array): Likewise.
(pkl_gen_pr_struct): Likewise.
* testsuite/poke.map/maps-structs-19.pk: Likewise.
* testsuite/poke.map/nsmap-6.pk: Likewise.
* testsuite/poke.pkl/scons-65.pk: New test.
* testsuite/poke.pkl/scons-66.pk: Likewise.
* testsuite/poke.pkl/scons-67.pk: Likewise.
* testsuite/poke.map/write-structs-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-04 David Faust <david.faust@oracle.com>
* testsuite/poke.pickles/btf-test.pk: New test.
2022-01-04 David Faust <david.faust@oracle.com>
* pickles/btf.pk (BTF_Header): Adjust constraint on magic number
to properly set endianness as needed.
2022-01-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Do not install a
writer closure in the AST type nodes for anonymous structs.
2022-01-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c: Remove obsolete comments. The GEN contexts
are now exclusive so the ordering of conditional clauses doesn't
matter anymore.
2022-01-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (union_writer): New function.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Compile an union writer for
unions.
(pkl_gen_pr_type_struct): Likewise.
(LMAP): Likewise.
* testsuite/poke.map/write-unions-1.pk: New test.
* testsuite/poke.map/write-unions-2.pk: Likewise.
* testsuite/poke.map/write-unions-3.pk: Likewise.
* testsuite/poke.map/ass-map-23.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2022-01-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_mapper): Fix backing up of GEN
endianness.
(struct_field_writer): Likewise.
2022-01-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/btf-dump.pk (btf_dump_type_vdata): Use EXCOND operator.
* pickles/ctf-dump.pk (ctf_dump_vlen_data): Likewise.
2022-01-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_inserter): Remove comment.
* etc/poke.rec (Support for optional fields in integral structs):
Remove as not applicable.
2022-01-02 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Allow splitting lines in RAS with \ at EOL):
Remove as done.
2022-01-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: New rule to join continuation lines separated with
\.
* libpoke/pkl-gen.pks (struct_field_extractor): Split long lines.
(struct_mapper): Likewise.
(deint_extract_field_value): Likewise.
(struct_deintegrator): Likewise.
2022-01-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (field_location_str): New macro.
(check_struct_field_constraint): Use field_location_str.
(struct_field_mapper): Add location error message when EOF is
raised while mapping.
* testsuite/poke.map/maps-structs-eof-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2022-01-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_load_file): Handle return value of
pk_file_readable the proper way.
2022-01-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk (pk_help): Print synopsis only if it is actually
present.
2021-12-31 Jose E. Marchesi <jemarch@gnu.org>
* DEV-NEWS: Remove file.
* etc/hacking.org: Remove section on recording noteworthy
development changes.
* HACKING: Regenerate.
2021-12-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.c (pkl_asm_for_loop): Do not create an extra
unused label and use label2.
(pkl_asm_for_endloop): Use label2 instead of label3.
2021-12-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-parser.c (YYSTYPE): Remove XXX mark.
(YYLTYPE): Likewise.
2021-12-31 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Integral Structs): Add some text.
2021-12-31 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support for struct deintegrators): Remove as done.
2021-12-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_DEINTEGRATOR): Define.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Increase the
number of closures to 8.
(pkl_ast_make_struct_type): Initialize deintegrator to PVM_NULL.
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Allow casts from
integral types to integral structs.
* libpoke/pkl-promo.c (pkl_promo_ps_cast): New handler.
(pkl_phase_promo): Install handler.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Compile deintegrator
closures for named struct types.
* libpoke/pkl-gen.pks (struct_deintegrator): New function.
(deint_extract_field_value): New macro.
(struct_constructor): Do not check for constraint errors if
`be_strict' is set to false.
* testsuite/poke.pkl/deint-struct-1.pk: New test.
* testsuite/poke.pkl/deint-struct-2.pk: Likewise.
* testsuite/poke.pkl/deint-struct-3.pk: Likewise.
* testsuite/poke.pkl/deint-struct-4.pk: Likewise.
* testsuite/poke.pkl/deint-struct-5.pk: Likewise.
* testsuite/poke.pkl/deint-struct-6.pk: Likewise.
* testsuite/poke.pkl/deint-struct-7.pk: Likewise.
* testsuite/poke.pkl/deint-struct-8.pk: Likewise.
* testsuite/poke.pkl/deint-struct-9.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Casting Structs): Note that it is possible to
cast an integral value to an integral struct.
2021-12-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/btf.pk (BTF_Type): s/enum/_enum/.
* pickles/ctf.pk (CTF_Type): Likewise.
* pickles/btf-dump.pk (btf_dump_type_vdata): Likewise.
* pickles/ctf-dump.pk (ctf_dump_vlen_data): Likewise.
2021-12-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Recognize `enum' as a reserved word.
2021-12-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Support IOS_ENDIAN_LSB and IOS_ENDIAN_MSB as
instruction values (v).
2021-12-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (state-struct-backing-c): Remove `canary` field.
Add `canary_{,return,exception}stack` fields.
(state-initialization-c): Init new fields.
(canary): Install canaries for stacks.
(exit): Add assertions for stack canaries.
(strace): s/canary/canary_stack/.
2021-12-27 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_op_excond): Add missing `pope` insn.
2021-12-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (struct pkl_ast_return_stmt): Add new field
`npopes` (number of `pope`s).
(PKL_AST_RETURN_STMT_NPOPES): New macro.
* libpoke/pkl-ast.c (pkl_ast_finish_returns_1): Add new arg `npopes`
to count the `pope`s.
(pkl_ast_finish_returns): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_return_stmt): Insert necessary `pope`
instruction(s).
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_make_signed_integral): Return PK_NULL if
an invalid `size' argument is provided.
(pvm_make_unsigned_integral): Likewise.
* libpoke/pvm.h: Document that these functions return PK_NULL in
case an invalid size is provided.
* libpoke/pk-val.c (pk_make_uint): Use pvm_make_unsigned_integral.
(pk_make_int): Use pvm_make_signed_integral.
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk (argp_parse): Remove dots after non-sentences in
the default help summaries.
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/asn1-ber.pk (BER_Data_Value): Use the ?! operator in the
is_indefinite method.
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h (pvm_make_signed_integral): New prototype.
(pvm_make_unsigned_integral): Likewise.
* libpoke/pvm-val.c (pvm_make_signed_integral): New function.
(pvm_make_unsigned_integral): Likewise.
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Define PKL_INSN_SSETI.
* libpoke/pvm.jitter (sseti): New instruction.
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (ssetc): Renamed from sseti.
* libpoke/pkl-asm.c (pkl_asm_insn_ssetc): Likewise.
(pkl_asm_insn): Likewise.
* libpoke/pkl-insn.def: Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Likewise.
2021-12-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ops.def: Entry for PKL_AST_OP_EXCOND.
* libpoke/pkl-lex.l: Recognize `?!' as EXCOND.
* libpoke/pkl-tab.y (EXCOND): New token.
(expression): Add rule for EXCOND.
* libpoke/pkl-typify.c (pkl_phase_typify1): Install handler.
(pkl_typify1_ps_op_excond): New handler.
* libpoke/pkl-gen.c (pkl_gen_pr_op_excond): New handler.
(pkl_phase_gen): Install handler.
* testsuite/poke.pkl/excond-diag-1.pk: New test.
* testsuite/poke.pkl/excond-1.pk: Likewise.
* testsuite/poke.pkl/excond-2.pk: Likewise.
* testsuite/poke.pkl/excond-3.pk: Likewise.
* testsuite/poke.pkl/excond-4.pk: Likewise.
* testsuite/poke.pkl/excond-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* etc/poke.rec (Exception predicate operator !?): Remove as done.
* doc/poke.texi (exception-predicate): New section.
2021-12-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Fix docstring for the instruction `pushe'.
2021-12-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen-builtins.pks: New file.
* libpoke/Makefile.am (libpoke_la_SOURCES): Add
pkl-gen-builtins.pks and pkl-gen-builtins.pkc.
(MOSTLYCLEANFILES): Add pkl-gen-builtins.pkc.tmp.
(BUILT_SOURCES): Add pkl-gen-builtins.pkc.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Use the RAS
implementations of the compiler built-ins.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/asn1-ber.pk (BER_Identifier): Add integrity checks for
`encoding'.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/asn1-ber.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add asn1-ber.pk.
2021-12-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/ios-dev-file.c (ios_dev_file_open): Add new param `data`.
* libpoke/ios-dev-mem.c (ios_dev_mem_open): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_open): Likewise.
* libpoke/ios-dev-proc.c (ios_dev_proc_open): Likewise.
* libpoke/ios-dev-stream.c (ios_dev_stream_open): Likewise.
* libpoke/ios-dev-zero.c (ios_dev_zero_open): Likewise.
* libpoke/ios-dev-sub.c (ios_dev_sub_open): Likewise.
* libpoke/ios-dev.h (struct ios_dev_if): Change `open` to accept new
`data` param. Add new field `data`.
* libpoke/libpoke.h (struct pk_iod_if): Likewise.
* libpoke/ios.c (ios_open): Call `open` with IOD-specific data.
* testsuite/poke.libpoke/foreign-iod.c (iod_op): Add new field
`data`.
(iod_open): Add new param `data`. Report success through `error`.
(iod_if): Add user data.
(USER_DATA): New constant.
(main): Add test for user data.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Casting Arrays): New section.
* etc/poke.rec (Document array casts in the manual): Removed as
done.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_pr_func): Do not set location
information in generated type.
* libpoke/pkl-anal.c (pkl_anal1_pr_func): Fix checking for vararg
arguments.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_array): Emit an error instead
of an ICE in case of a non-constant index in array initializer.
* libpoke/pkl-anal.c (pkl_anal2_ps_array): Remove.
(pkl_phase_anal2): Update accordingly.
* testsuite/poke.pkl/arrays-initializer-diag-1.pk: New test.
* testsuite/poke.pkl/arrays-initializer-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_sizeof_type): Do not add location
info to internally generated AST nodes.
* libpoke/pkl-fold.c (OP_UNARY_OO): Likewise.
(OP_BINARY_OOO): Likewise.
(OP_BINARY_OIO): Likewise.
(pkl_fold_ps_cast): Likewise.
(pkl_fold_ps_indexer): Likewise.
* libpoke/pkl-promo.c (pkl_promo_ps_type_array): Likewise.
(pkl_promo_ps_array_initializer): Likewise.
(pkl_promo_ps_map): Likewise.
* libpoke/pkl-trans.c (pkl_trans1_ps_offset): Likewise
(pkl_trans1_ps_trimmer): Likewise.
(pkl_trans1_ps_format): Likewise.
(pkl_trans1_ps_array): Likewise.
(pkl_trans2_ps_type_offset): Likewise.
(pkl_trans3_ps_op_sizeof): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_op_not): Likewise.
(pkl_typify1_ps_op_boolean): Likewise.
(pkl_typify1_ps_isa): Likewise.
(TYPIFY_BIN): Likewise.
(CASE_OFFSET): Likewise.
(CASE_OFFSET): Likewise.
(pkl_typify1_ps_bshift_pow): Likewise.
(pkl_typify1_ps_mul): Likewise.
(pkl_typify1_ps_op_in): Likewise.
(pkl_typify1_ps_op_bconc): Likewise.
(pkl_typify1_ps_op_sizeof): Likewise.
(pkl_typify1_ps_offset): Likewise.
(pkl_typify1_ps_array): Likewise.
(pkl_typify1_ps_trimmer): Likewise.
(pkl_typify1_ps_indexer): Likewise.
(pkl_typify1_ps_struct): Likewise.
(pkl_typify1_pr_func): Likewise.
(pkl_typify1_ps_loop_stmt_iterator): Likewise.
(pkl_typify1_ps_attr): Likewise.
* etc/poke.rec (remove unneeded locs in the passes/phases):
Removed as done.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Pass the declaration's pk_value in callback
pk_map_decl_fn): Removed as done.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (.set with no arguments should give a summary of
all options): Removed as done.
2021-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_type_is_complete): Support constant
labels in completed structs.
(pkl_ast_sizeof_type): Take into account constant labels in
structs.
* testsuite/poke.pkl/offsets-14.pk: New test.
* testsuite/poke.pkl/offsets-15.pk: Likewise.
* testsuite/poke.pkl/offsets-16.pk: Likewise.
* testsuite/poke.pkl/offsets-diag-1.pk: Adjust.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* etc/poke.rec (Consider struct types as complete if all labels
are literal): Remove as done.
2021-12-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-common.pk (elf_pretty_print_section_flags): New
function.
(Elf_SegmentFlags): New type.
(Elf_Ident): Likewise.
* pickles/elf-64.pk (Elf64_SectionFlags): Use
elf_pretty_print_section_flags.
(Elf64_SegmentFlags): Remove.
(elf64_Ehdr): Use Elf_Ident.
* pickles/elf-32.pk (Elf32_SectionFlags): New type.
(Elf32_Shdr): Likewise.
(Elf32_Phdr): Likewise.
(Elf32_Ehdr): Likewise.
(Elf32_File): Likewise.
2021-12-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-common.pk (Elf_Note): New type.
* pickles/elf-64.pk (Elf64_Note): Delete.
* pickles/elf-32.pk (Elf32_Note): Likewise.
2021-12-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-common.pk (elf_compress_algorithm_p): New function.
* pickles/elf-32.pk (Elf32_Chdr): Use elf_compress_algorithm_p in
constraint.
* pickles/elf-64.pk (El64_Chdr): Likewise.
2021-12-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-64.pk (Elf64_Note): Add field _type.
(Elf64_Chdr): Add constraint and comments.
* pickles/elf-32.pk (Elf32_Note): New type.
(Elf32_Chdr): Likewise.
2021-12-22 Luca Saiu <positron@gnu.org>
* configure.ac (AC_JITTER_SUBPACKAGE): Rename to
JITTER_JITTER_SUBPACKAGE, following the macro renaming in Jitter.
* etc/hacking.org: Documentation.
* HACKING: Regenerate documentation.
2021-12-21 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf-32.pk (Elf32_Sym): New type.
* pickles/elf-common.pk (Elf_Sym_Info): Likewise.
(Elf_Sym_Other_Info): Likewise.
* pickles/elf-64.pk (Elf64_Sym): Use Elf_Sym_Info and
Elf_Sym_Other_Info.
2021-12-21 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf64.pk: New file.
* pickles/elf32.pk: Likewise.
* pickles/elf-common.pk: Likewise.
* pickles/elf.pk: Move contents to elf-common.pk and elf64.pk and
load these pickles.
* pickles/Makefile.am (dist_pickles_DATA): Add elf-64.pk,
elf-32.pk and elf-common.pk.
2021-12-21 Jose E. Marchesi <jemarch@termi>
* libpoke/pkl-gen.c (PKL_GEN_PUSH_SET_CONTEXT): Define.
Use PKL_GEN_PUSH_SET_CONTEXT instead of pairs of PUSH_CONTEXT and
SET_CONTEXT.
* libpoke/pkl-gen.pks: Likewise.
2021-12-21 Jose E. Marchesi <jemarch@termi>,
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Use PKL_GEN_PUSH_CONTEXT
instead of PKL_GEN_DUP_CONTEXT.
(LMAP): Likewise.
(pkl_gen_pr_ass_stmt): Likewise.
(pkl_gen_pr_print_stmt): Likewise.
(pkl_gen_pr_funcall): Likewise.
(pkl_gen_pr_func): Likewise.
(pkl_gen_pr_func_arg): Likewise.
(pkl_gen_ps_isa): Likewise.
(pkl_gen_pr_cast): Likewise.
(pkl_gen_ps_cons): Likewise.
(pkl_gen_pr_map): Likewise.
(pkl_gen_pr_array): Likewise.
(pkl_gen_pr_type_function): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_pr_type_struct): Likewise.
(PKL_GEN_DUP_CONTEXT): Remove.
* libpoke/ras: Update comment to use GEN_PUSH_CONTEXT.
2021-12-19 Jose E. Marchesi <jemarch@termi>
* doc/poke.texi (Optional Fields): Explain how optional fields are
always constructed/mapped.
2021-12-15 David Faust <david.faust@oracle.com>
* pickles/btf-ext.pk: New pickle.
* pickles/Makefile.am: Add it to dist_pickles_DATA.
2021-12-15 David Faust <david.faust@oracle.com>
* pickles/btf.pk (BTF_KIND_FLOAT): New kind.
(BTF_KIND_DECL_TAG): Likewise.
(BTF_KIND_TYPE_TAG): Likewise.
(BTF_DECL_TAG_SELF): New.
(BTF_Decl_Tag): New type.
(BTF_Type): Update `info` bits usage to accommodate new type
kinds. BTF_KIND_DATASEC uses `size` variant of `attrs`. Add
`decl_tag` variant to `data`.
2021-12-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cond_exp): Specify expected
type in error message.
* testsuite/poke.pkl/cond-exp-diag-2.pk: Adjust to new error message.
* testsuite/poke.pkl/cond-exp-diag-3.pk: Likewise.
2021-12-10 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Building with Debugging support): Clarify how
to build jitter with a debugging-friendly dispatch.
* HACKING: Regenerate.
2021-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_format): Add support for `%%`
in format string of `printf` and `format`.
* doc/poke.texi (printf): Update.
* testsuite/poke.pkl/printf-36.pk: New test.
* testsuite/poke.pkl/format-36.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-12-04 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h (pk_map_decl_fn): Add new param (`pk_val value`).
* libpoke/libpoke.c (my_decl_map_fn): Lookup var name in runtime env.
(pk_decl_map): Pass runtime env to the callback.
* poke/pk-cmd-def.c (print_var_decl): Add new param.
(print_fun_decl): Likewise.
(print_type_decl): Likewise.
2021-12-03 Jordan Yelloz <jordan@yelloz.me>
* libpoke/std.pk (atoi): Added code that extracts any single leading '+'
or '-', decides a polarity of the number to parse, and shifts over the
input string by 1 character if necessary before parsing the digits.
* testsuite/poke.std/std-test.pk: Added tests for new behaviors.
2021-12-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec_1): Update `cmd_name` after finding
the sub-command.
* testsuite/poke.cmd/set-obase-6.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-12-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec_1): Introduce a new predicate
`run_default_handler_p`. Now if user calls commands (which has
sub-commands) with no arguments, it'll try to call the top-level
handler (if there's one) instead of showing the usage string.
If there's no top-level handler, the usage string will be shown.
* poke/pk-cmd-set.c (pk_cmd_set_dump): New function to dump all
settings.
(set_cmd): Use `pk_cmd_set_dump`, and remove usage string.
* poke/pk-settings.pk (pk_settings_dump): New helper function.
* doc/poke.texi (set command): Update.
2021-12-02 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump poke version to 1.4.
* NEWS: Add entries for 1.4.
2021-12-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans2_ps_incrdecr): Substitute an
assert with an ICE.
2021-12-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_format): Fix assertion.
2021-12-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt-1.pk (_pkl_escape_string): Add special cases for
tab (\t), new-line ('\n'), double-quote ('"') and backslash ('\\').
* testsuite/poke.pkl/format-30.pk: New test.
* testsuite/poke.pkl/format-31.pk: Likewise.
* testsuite/poke.pkl/format-32.pk: Likewise.
* testsuite/poke.pkl/format-33.pk: Likewise.
* testsuite/poke.pkl/format-34.pk: Likewise.
* testsuite/poke.pkl/format-35.pk: Likewise.
2021-12-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (strace): Re-implement using
`JITTER_AT_DEPTH_STACK`.
2021-12-02 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec: Triage.
2021-12-01 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (1.1): Add release.
(1.2): Likewise.
(1.3): Likewise.
2021-12-01 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support %< and %> in different printf.
E_sc_underflow): Item removed, as it is no longer necessary due to
begin_sc and end_sc.
(Support for referring to current offset in struct types): Removed
as done.
2021-12-01 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (set command): Remove mention of a limit that is
no longer applicable.
2021-12-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_constructor): Generate the correct
PVM type for the constructed array.
* libpoke/pkl-gen.c (pkl_gen_pr_funcall): Likewise for the array
of anys containing the varargs.
(pkl_gen_ps_comp_stmt): Likewise for the array returned/consumed
by the term_get_{bg}color builtins.
* libpoke/pvm.jitter (asettb): Add an assertion to detect future
occurrences of this problem.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (common_int_types): New variable.
(pvm_make_integral_type_1): New function.
(pvm_make_integral_type): Rewrite to cache integral types.
(pvm_val_initialize): Initialize common integral types and
register GC roots for them.
(pvm_val_finalize): De-register GC roots for common integral
types.
* libpoke/pvm.c (pvm_shutdown): Call pvm_val_finalize not
pvm_val_initialize!
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.c (pvm_shutdown): Call pvm_val_finalize instead of
pvm_val_initialize.
2021-11-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/pktest.pk (pktest_run): Report location and message of
failed assertion (if available) in output.
* testsuite/poke.pktest/pktest-5.pk: Update accordingly.
* testsuite/poke.pktest/pktest-7.pk: Likewise.
* testsuite/poke.pktest/pktest-11.pk: Likewise.
* testsuite/poke.pktest/pktest-12.pk: Likewise.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_array_set): Avoid calculating the size of
the remaining elements of the array.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/assert-4.pk: Update to new assertion
exception fields.
* testsuite/poke.pkl/assert-diag-1.pk: Likewise.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (check_struct_field_constraint): Use
`location' and `msg' fields of Exception.
* testsuite/poke.map/maps-structs-constraints-2.pk: Update
accordingly.
* testsuite/poke.pkl/scons-constraints-2.pk: Likewise.
* testsuite/poke.pkl/scons-constraints-1.pk: Likewise.
* testsuite/poke.map/maps-structs-constraints-3.pk: Likewise.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt-2.pk (_pkl_assert): Use the `location' and `msg'
fields of Exception.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_make_exception): Likewise.
* libpoke/pkl-asm.c (pkl_asm_new): Adapt caller accordingly.
* libpoke/pvm.jitter (PVM_RAISE): Likewise.
* libpoke/pkl-gen.c: Likewise.
* libpoke/ras: Likewise.
* libpoke/pkl-rt-1.pk (Exception): New fields `location' and
`msg'.
(_pkl_exception_handler): Handle `location' and `msg'.
2021-11-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/poke.pkl/format-21.pk: Replace `Exception` with locally
defined type `E`.
* testsuite/poke.pkl/format-22.pk: Likewise.
* testsuite/poke.pkl/format-23.pk: Likewise.
* testsuite/poke.pkl/format-24.pk: Likewise.
* testsuite/poke.pkl/format-25.pk: Likewise.
* testsuite/poke.pkl/format-26.pk: Likewise.
* testsuite/poke.pkl/format-27.pk: Likewise.
* testsuite/poke.pkl/format-28.pk: Likewise.
2021-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt-1.pk (Exception): Rename field `msg' to `name'.
(_pkl_exception_handler): Update accordingly.
* libpoke/pkl-rt-2.pk (_pkl_assert): Likewise.
* libpoke/pvm-val.c (pvm_make_exception): Likewise.
* libpoke/pvm.h (PVM_E_*_NAME): Rename from PVM_E_*_MSG.
* libpoke/ras: Use PVM_E_*_NAME instead of PVM_E_*_MSG.
* libpoke/pvm.jitter (PVM_RAISE_DFL): Likewise.
* libpoke/pkl-gen.c: Likewise.
* libpoke/pkl-asm.c (pkl_asm_new): Likewise.
* pickles/pktest.pk (pktest_run): Use `name' instead of `msg'.
* pickles/argp.pk: Likewise.
* pickles/id3v1.pk: Likewise.
* pickles/jffs2.pk: Likewise.
* libpoke/pkl-gen.pks (check_struct_field_constraint): Likewise.
* testsuite/poke.pkl/format-21.pk: Update expected pattern.
* testsuite/poke.pkl/format-26.pk: Likewise.
* testsuite/poke.pkl/format-25.pk: Likewise.
* testsuite/poke.pkl/format-24.pk: Likewise.
* testsuite/poke.pkl/format-23.pk: Likewise.
* testsuite/poke.pkl/format-22.pk: Likewise.
* testsuite/poke.pkl/scons-constraints-2.pk: Likewise.
* testsuite/poke.pkl/scons-constraints-1.pk: Likewise.
* testsuite/poke.pkl/assert-4.pk: Likewise.
* testsuite/poke.map/maps-structs-constraints-2.pk: Likewise.
* testsuite/poke.map/maps-structs-constraints-3.pk: Likewise.
* testsuite/poke.pkl/continue-for-3.pk: Likewise.
* testsuite/poke.pkl/raise-6.pk: Likewise.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-scrabble.pk (pk_scrabble_from): New variable.
(pk_scrabble_size): Likewise.
(pk_scrabble_from_pattern): Likewise.
(pk_scrabble_ent_size): Likewise.
(scrabble): Use the variables above as default values for
arguments.
Use actual default values for help string.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-copy.pk (copy): Actually use pk_copy_from and
pk_copy_size as default values for the arguments.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-save.pk (pk_save_from): New variable.
(pk_save_size): Likewise.
(pk_save_append): Likewise.
(pk_save_verbose): Likewise.
Use actual default values for help string.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-copy.pk (pk_copy_size): New variable.
(pk_copy_from): Likewise.
Use actual default values for help string.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk: Format the help string for the `dump' command
to reflect actual default values for the arguments.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c (pk_array_set_elem_boffset): Remove unused
function.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (exit): Moved from pkl-rt-1.pk.
2021-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_type_append_to): Generate syntactically
correct types for functions.
* libpoke/pkl-typify.c (pkl_typify1_ps_funcall): Clarify error
message.
2021-11-28 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.mi-json/mi-json.c (J_UND): Define.
(test_val_to_json): Return J_UND if json_object_equal is not
available.
(test_json_file): Mark test as `unresolved' whenever appropriate.
* poke/pk-mi-json.c (pk_json_object_object_add): Fix return value.
2021-11-26 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi-json.c (pk_json_object_object_add): Define.
(JSON_OBJECT_OBJECT_ADD): Use pk_json_object_object_add.
(collect_msg_arg): Likewise.
(pk_mi_msg_to_json_object): Likewise.
2021-11-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* pickles/pktest.pk (PkTest): Use logical implication operator.
2021-11-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/learn-poke-language-in-y-minutes.pk
(Logical implication operator): Add new section.
(format): Likewise.
(Signed Arithmetic Overflow Detection): Add a newline to `print`.
2021-11-19 Kostas Chasialis <koschasialis@gmail.com>
* etc/pk-mi-json-schema.json (JSON Schema): Refactored the JSON schema.
* libpoke/libpoke.h (pk_sizeof): Function declaration.
* libpoke/pk-val.c (pk_sizeof): Function definition.
* poke/pk-mi-json.c (pk_val_to_json): New function.
(pk_type_to_json): Likewise.
(pk_type_to_json_integral): Likewise.
(pk_type_to_json_string): Likewise.
(pk_type_to_json_offset): Likewise.
(pk_type_to_json_struct): Likewise.
(pk_type_to_json_array): Likewise.
(pk_type_to_json_any): Likewise.
(pk_type_to_json_null): Likewise.
(pk_val_to_json_int): Likewise.
(pk_val_to_json_uint): Likewise.
(pk_val_to_json_string): Likewise.
(pk_val_to_json_offset): Likewise.
(pk_val_to_json_struct): Likewise.
(pk_val_to_json_array): Likewise.
(pk_val_to_json_any): Likewise.
(pk_val_to_json_map): Likewise.
(json_to_pk_val): Likewise.
(json_to_pk_type): Likewise.
(json_to_pk_type_integral): Likewise.
(json_to_pk_type_offset): Likewise.
(json_to_pk_type_struct): Likewise.
(json_to_pk_type_array): Likewise.
(json_to_pk_val_int): Likewise.
(json_to_pk_val_uint): Likewise.
(json_to_pk_val_string): Likewise.
(json_to_pk_val_offset): Likewise.
(json_to_pk_val_struct): Likewise.
(json_to_pk_val_array): Likewise.
(json_to_pk_val_any): Likewise.
(pexpect_aelem): Likewise.
(collect_json_arg): Adapted accordingly.
* testsuite/Makefile.am (EXTRA_DIST): Added new tests.
* testsuite/poke.mi-json/mi-json.c (test_val_to_json): Adapted to new
changes.
(test_json_to_val): Likewise.
(test_json_pk_val): Deleted function.
(test_json_pk_int): Likewise.
(test_json_pk_uint): Likewise.
(test_json_pk_string): Likewise.
(test_json_pk_offset): Likewise.
(test_json_pk_sct): Likewise.
(test_json_pk_array): Likewise.
(test_json_pk_null): Likewise.
* testsuite/poke.mi-json/pk_array.json: Deleted test.
* testsuite/poke.mi-json/pk_array_bounded.json: New test.
* testsuite/poke.mi-json/pk_array_bounded_offset.json: Likewise.
* testsuite/poke.mi-json/pk_array_unbounded.json: Likewise.
* testsuite/poke.mi-json/pk_int.json: Adapted test to JSON schema changes.
* testsuite/poke.mi-json/pk_offset.json: Likewise.
* testsuite/poke.mi-json/pk_offset_uint.json: Likewise.
* testsuite/poke.mi-json/pk_sct.json: Likewise.
* testsuite/poke.mi-json/pk_sct_empty.json: Likewise.
* testsuite/poke.mi-json/pk_sct_empty_mapped.json: Likewise.
* testsuite/poke.mi-json/pk_string.json: Likewise.
* testsuite/poke.mi-json/pk_uint.json: Likewise.
* testsuite/poke.mi-json/pk_int_fail.json: New test.
* testsuite/poke.mi-json/pk_uint_fail.json: Likewise.
* testsuite/poke.mi-json/pk_string_fail.json: Likewise.
* testsuite/poke.mi-json/pk_offset_fail.json: Likewise.
* testsuite/poke.mi-json/pk_offset_uint_fail.json: Likewise.
* testsuite/poke.mi-json/pk_sct_fail.json: Likewise.
* testsuite/poke.mi-json/pk_array_bounded_fail.json: Likewise.
* testsuite/poke.mi-json/pk_array_bounded_offset_fail.json: Likewise.
2021-11-10 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-tab.y (pkl_make_assertion): Change the invocation of
`_pkl_assert` to pass FILENAME, LINE and COLUMN as separate arguments
instead of passing as a pre-formated string.
* libpoke/pkl.c (pkl_load_rt): New function to load runtime library.
(pkl_new): Load `pkl-rt-1.pk` and `pkl-rt-2.pk` runtime libraries.
* libpoke/pkl-rt.pk: Rename to `libpoke/pkl-rt-1`.
(_pkl_assert): Remove.
* libpoke/pkl-rt-1.pk: New file.
* libpoke/pkl-rt-2.pk: New file. New implementation of `_pkl_assert`
which uses `format` to report FILENAME, LINE and COLUMN.
* libpoke/Makefile.am (dist_pkgdata_DATA): Update
* etc/hacking.org: Rename `pkl-rt.pk` to what's appropriate.
* HACKING: Likewise.
* doc/learn-poke-language-in-y-minutes.pk: Likewise.
* libpoke/pvm.h: Likewise.
* libpoke/pvm-val.c: Likewise.
* libpoke/ras: Likewise.
2021-11-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_print_stmt): Fix error location.
* testsuite/poke.pkl/print-diag-1.pk: New file.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-09-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk: Adapt to new syntax for field initial values.
2021-09-17 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* testsuite/poke.map/ass-map-21.pk: New test.
* testsuite/poke.map/ass-map-22.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-09-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pk-val.c: Include `assert.h`.
(pk_val_offset): Use `PVM_VAL_MAPPED_P` instead
of checking `PVM_VAL_OFFSET` against `PVM_NULL`.
2021-09-16 Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
* doc/poke.texi (Poking a SBM Image): Fix typo.
2021-09-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_map): Use `PUSHIOS` instruction to
get the current IOS, instead of using `PVM_NULL`.
And also remove the old (incorrect) comment.
2021-09-10 Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
* doc/poke.texi (Weird Integers): Fix typo.
2021-09-02 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-mi-json.c (MI Messages): Use "kind" instead of "type" for
messages.
(pk_mi_msg_to_json_object): Likewise.
(pk_mi_json_object_to_msg): Likewise.
2021-08-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/libpoke.h: Fix the comment of `pk_call`.
2021-08-30 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_type_integral): Fix argument of
MKTYI instruction to be signed integer.
* libpoke/pvm-val.c (pvm_make_exception): Fix args of
`pvm_make_integral_type` invocation.
* libpoke/pvm.jitter (time): Likewise.
2021-08-26 Kostas Chasialis <koschasialis@gmail.com>
* etc/hacking.org: Email change.
* HACKING: Likewise.
2021-08-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-mi-msg.c (pk_mi_make_resp): Prevents `errmsg` to be `NULL`.
(pk_mi_set_arg): Fix the assertion.
* poke/pk-mi-msg.def (INVREQ): Add new arg (`errmsg`).
* poke/pk-mi.c (pk_mi_send_invalid_msg): New function to report error
of invalid messages to the client.
(pk_mi_process_frame_msg): Use `pk_mi_send_invalid_msg`.
(pk_mi_dispatch_msg): Add error reporting functionality for invalid
messages.
2021-08-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* poke/pk-mi-json.h (pk_mi_json_to_msg): Add new arg (`errmsg`).
* poke/pk-mi-json.c (pk_mi_json_to_msg): Re-write JSON parsing to
be more declarative. Also reports error message(s).
* poke/pk-mi.c (pk_mi_process_frame_msg): Update.
* testsuite/poke.mi-json/mi-json.c (test_json_to_msg): Likewise.
2021-08-03 Kostas Chasialis <sdi1600195@di.uoa.gr>
* poke/pk-mi.c (pk_mi_dispatch_msg): Added PRINTV request.
* doc/poke.texi (MI Requests-Responses): Added PRINTV in both.
2021-08-03 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* etc/poke.rec (support references to values in the MI protocol):
Add notes about GC.
(`format' support): Removed as done.
(Fix GC roots in AST nodes): Likewise.
2021-08-03 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (support references to values in the MI protocol):
New entry.
2021-08-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Add missing doc for pk_compile_expression.
2021-07-12 Fangrui Song <i@maskray.me>
* doc/poke.texi: Fix a couple of code errors in examples.
2021-07-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Make cast error
messages more helpful.
2021-07-04 Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
* doc/poke.texi (Decode-Compute-Encode): Fix `double_number`
function: s/int/unsigned char/ for bytes.
2021-06-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* common/pk-utils.h (pk_format_binary): New function declaration.
* common/pk-utils.c (pk_format_binary): New function definition.
* libpoke/pkl-lex.l (format): Recognize `format`.
* libpoke/pkl-ast.h (PKL_AST_FORMAT): Define.
(PKL_AST_FORMAT_ARG): Likewise.
(PKL_AST_TYPE_A_FORMATER): Likewise.
(PKL_AST_TYPE_S_FORMATER): Likewise.
(PKL_AST_FORMAT_FMT): Likewise.
(PKL_AST_FORMAT_TYPES): Likewise.
(PKL_AST_FORMAT_ARGS): Likewise.
(PKL_AST_FORMAT_NARGS): Likewise.
(PKL_AST_FORMAT_PREFIX): Likewise.
(PKL_AST_FORMAT_FMT_PROCESSED_P): Likewise.
(struct pkl_ast_format): New struct.
(pkl_ast_make_format): New function declaration.
(PKL_AST_FORMAT_ARG_EXP): Define.
(PKL_AST_FORMAT_ARG_BASE): Likewise.
(PKL_AST_FORMAT_ARG_SUFFIX): Likewise.
(PKL_AST_FORMAT_ARG_BEGIN_SC): Likewise.
(PKL_AST_FORMAT_ARG_END_SC): Likewise.
(PKL_AST_FORMAT_ARG_VALUE_P): Likewise.
(PKL_AST_FORMAT_ARG_FORMAT_MODE): Likewise.
(PKL_AST_FORMAT_ARG_FORMAT_DEPTH): Likewise.
(PKL_AST_FORMAT_MODE_FLAT): Likewise.
(PKL_AST_FORMAT_MODE_TREE): Likewise.
(struct pkl_ast_format_arg): New struct.
(pkl_ast_make_format_arg): New function declaration.
(struct pkl_ast_print_stmt): Delegate all format processing to a
PKL_AST_FORMAT node.
(pkl_ast_make_print_stmt): Change API.
(PKL_AST_PRINT_STMT_FMT): Remove.
(PKL_AST_PRINT_STMT_TYPES): Likewise.
(PKL_AST_PRINT_STMT_ARGS): Likewise.
(PKL_AST_PRINT_STMT_NARGS): Likewise.
(PKL_AST_PRINT_STMT_PREFIX): Likewise.
(PKL_AST_PRINT_STMT_FMT_PROCESSED_P): Likewise.
(PKL_AST_PRINT_STMT_ARG): Likewise.
(struct pkl_ast_print_stmt_arg): Likewise.
(PKL_AST_PRINT_STMT_ARG_EXP): Likewise.
(PKL_AST_PRINT_STMT_ARG_BASE): Likewise.
(PKL_AST_PRINT_STMT_ARG_SUFFIX): Likewise.
(PKL_AST_PRINT_STMT_ARG_BEGIN_SC): Likewise.
(PKL_AST_PRINT_STMT_ARG_END_SC): Likewise.
(PKL_AST_PRINT_STMT_ARG_VALUE_P): Likewise.
(PKL_AST_PRINT_STMT_ARG_PRINT_MODE): Likewise.
(PKL_AST_PRINT_STMT_ARG_PRINT_DEPTH): Likewise.
(PKL_AST_PRINT_MODE_FLAT): Likewise.
(PKL_AST_PRINT_MODE_TREE): Likewise.
(pkl_ast_make_print_stmt_arg): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_array_type): Add formater closure.
(pkl_ast_make_struct_type): Add formater closure.
(pkl_ast_make_format): New function definition.
(pkl_ast_make_format_arg): Likewise.
(pkl_ast_node_free): Handle `PKL_AST_FORMAT` and `PKL_AST_FORMAT_ARG`.
Remove `PKL_AST_PRINT_STMT_ARG` case. Revise `PKL_AST_PRINT_STMT` case.
(pkl_ast_print_1): Likewise.
(pkl_ast_make_print_stmt): Revise.
(pkl_ast_make_print_stmt_arg): Remove.
* libpoke/pkl-tab.y: Define token `FORMAT`.
(primary): Add `format` support.
(format_arg): New rule.
(format_arg_list): Likewise.
(print_stmt_arg_list): Remove.
* libpoke/pvm.jitter (wrapped-functions): Add `snprintf`.
(PVM_FORMATI): Define.
(PVM_FORMATL): Likewise.
(formati): New instruction.
(formatiu): Likewise.
(formatl): Likewise.
(formatlu): Likewise.
(push-drop-to-nop): New rule.
* libpoke/pkl-insn.def: Add `format{i,iu,l,lu}` instructions. Add
`format` macro instruction.
And also add previously defined instructions: `drop2`, `drop3`, `nip3`.
* libpoke/pkl-asm.c (pkl_asm_insn_format): New function definition.
(pkl_asm_insn): Add support for format macro instruction.
* libpoke/pkl-pass.c (pkl_do_pass_1): Handle `PKL_AST_FORMAT_ARG`
and `PKL_AST_FORMAT`. Remove `PKL_AST_PRINT_STMT_ARG`. Revise
`PKL_AST_PRINT_STMT`.
* libpoke/pkl-trans.c (pkl_trans1_ps_format): New phase.
(pkl_trans1_ps_print_stmt): Remove.
(pkl_phase_trans1): Revise.
* libpoke/pkl-typify.c (pkl_typify1_ps_format): New phase.
(pkl_typify1_ps_print_stmt): Revise.
(pkl_phase_typify1): Register new phase.
* libpoke/pkl-promo.c (pkl_promo_ps_format): New phase.
(pkl_promo_ps_print_stmt): Remove.
(pkl_phase_promo): Revise.
* libpoke/pkl-gen.h (PKL_GEN_CTX_IN_FORMATER): Define.
* libpoke/pkl-gen.c (pkl_gen_pr_format): Generate code for `format`.
(pkl_phase_gen): Register new phase.
(pkl_gen_pr_type_offset): Add formater context.
(pkl_gen_ps_type_integral): Likewise.
(pkl_gen_pr_type_function): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_ps_type_string): Likewise.
(pkl_gen_pr_type_struct): Likewise.
* libpoke/pkl-rt.pk (_pkl_strcat3): New function.
(_pkl_indentation): Likewise.
(_pkl_format_int_suffix): Likewise.
(_pkl_reduce_string_array): Likewise.
* libpoke/pkl-gen.pks (format_int_suffix): New RAS macro.
(integral_formater): Likewise.
(offset_formater): Likewise.
(string_formater): Likewise.
(format_boffset): Likewise.
(array_formater): New RAS function.
(struct_formater): Likewise.
* testsuite/poke.pkl/format-1.pk: New test.
* testsuite/poke.pkl/format-2.pk: Likewise.
* testsuite/poke.pkl/format-3.pk: Likewise.
* testsuite/poke.pkl/format-4.pk: Likewise.
* testsuite/poke.pkl/format-5.pk: Likewise.
* testsuite/poke.pkl/format-6.pk: Likewise.
* testsuite/poke.pkl/format-7.pk: Likewise.
* testsuite/poke.pkl/format-8.pk: Likewise.
* testsuite/poke.pkl/format-9.pk: Likewise.
* testsuite/poke.pkl/format-10.pk: Likewise.
* testsuite/poke.pkl/format-11.pk: Likewise.
* testsuite/poke.pkl/format-12.pk: Likewise.
* testsuite/poke.pkl/format-13.pk: Likewise.
* testsuite/poke.pkl/format-14.pk: Likewise.
* testsuite/poke.pkl/format-15.pk: Likewise.
* testsuite/poke.pkl/format-16.pk: Likewise.
* testsuite/poke.pkl/format-17.pk: Likewise.
* testsuite/poke.pkl/format-18.pk: Likewise.
* testsuite/poke.pkl/format-19.pk: Likewise.
* testsuite/poke.pkl/format-20.pk: Likewise.
* testsuite/poke.pkl/format-21.pk: Likewise.
* testsuite/poke.pkl/format-22.pk: Likewise.
* testsuite/poke.pkl/format-23.pk: Likewise.
* testsuite/poke.pkl/format-24.pk: Likewise.
* testsuite/poke.pkl/format-25.pk: Likewise.
* testsuite/poke.pkl/format-26.pk: Likewise.
* testsuite/poke.pkl/format-27.pk: Likewise.
* testsuite/poke.pkl/format-28.pk: Likewise.
* testsuite/poke.pkl/format-29.pk: Likewise.
* testsuite/poke.pkl/format-diag-1.pk: Likewise.
* testsuite/poke.pkl/reduce-array-1.pk: Likewise.
* testsuite/poke.pkl/reduce-array-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-06-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_function): Add comment.
(pkl_gen_pr_type_array): Save computed closure for printer in
AST node.
(pkl_gen_pr_type_struct): Likewise.
* libpoke/pkl-gen.pks (print_boffset): Use escape sequence in string
literal to make RAS happy.
(struct_printer): s/struct_type/@struct_type/.
2021-06-06 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (sprops): Add instruction for
"string property style", but with no implementation.
(sproph): Add instruction for "string property hyperlink", but with
no implementation.
(spropc): Add instruction for "string property clear", but with no
implementation.
* libpoke/pkl-insn.def: Add new instructions.
2021-06-05 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update for 1.3.
* NEWS: Likewise.
* doc/gendocs_template: Likewise.
2021-05-31 Luca Saiu <positron@gnu.org>
* cfg.mk (gl_public_submodule_commit): Define as empty. Update
comment.
2021-05-31 Luca Saiu <positron@gnu.org>
* cfg.mk (submodule-checks): Override setting in maint.mk, fixing
a distcheck failure.
2021-05-26 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (wrapped-functions): Add std string functions.
2021-05-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): s/uint<64>/ulong<64>.
* libpoke/pvm-val.c (pvm_make_int): Add assertion for `size` argument.
(pvm_make_uint): Likewise.
(pvm_make_long): Likewise.
(pvm_make_ulong): Likewise.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (_pkl_escape_string): New function.
* libpoke/pkl-gen.pks (string_printer): Use `_pkl_escape_string` to
print valid string literals (replace non-printable characters with
escape sequence).
* testsuite/poke.pkl/printf-value-18.pk: New test.
* testsuite/poke.pkl/printf-value-19.pk: Likewise.
* testsuite/poke.pkl/printf-value-20.pk: Likewise.
* testsuite/poke.pkl/printf-value-21.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (strset): New instruction.
(wrapped-functions): Add `memcpy`.
* libpoke/pkl-insn.def (STRSET): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Emit code.
* libpoke/pkl-lex.l: Recognize `BUILTIN_UNSAFE_STRING_SET`.
* libpoke/pkl-tab.y: Define token `BUILTIN_UNSAFE_STRING_SET`.
(comp_stmt): New rule.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_UNSAFE_STRING_SET): Define.
* libpoke/pkl-rt.pk (__pkl_unsafe_string_set): New function.
* testsuite/poke.pkl/unsafe-string-set-1.pk: New test.
* testsuite/poke.pkl/unsafe-string-set-2.pk: Likewise.
* testsuite/poke.pkl/unsafe-string-set-3.pk: Likewise.
* testsuite/poke.pkl/unsafe-string-set-4.pk: Likewise.
* testsuite/poke.pkl/unsafe-string-set-5.pk: Likewise.
* testsuite/poke.pkl/unsafe-string-set-diag-1.pk: Likewise.
* testsuite/poke.pkl/unsafe-string-set-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (return): s/jitter_int/jitter_uint/.
(popf): s/JITTER_ARGN0/JITTER_ARGU0/.
(sconc): Remove useless `#undef F`.
(bnzi): Fix type s/bzni/bnzi/.
(substr): Fix doc.
(ains): Likewise.
(indent): Fix typo.
(mka): Remove redundant array offset initialization.
* libpoke/ras (BEGIN): Use `\"` instead of `\\\"`.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (_pkl_unit_name): Fix typo. s/gigi/gibi/
(_pkl_unit_gibibit): Likewise.
(_pkl_unit_gibibyte): Likewise.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (sconc): Replace `pvm_make_string` with
`pvm_make_string_nodup`.
(ctos): Likewise.
(substr): Likewise.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.h (pvm_make_string_nodup): New function declaration.
* libpoke/pvm-val.c (pvm_make_string_nodup): New function definition.
* libpoke/pvm.jitter: Do not include `xalloc.h`.
(muls): Use `pvm_alloc` instead of `xmalloc`.
* etc/poke.rec (The `muls' instruction in pvm.jitter calls xmalloc):
Remove as done.
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* doc/learn-poke-in-y-minutes.pk (Struct Field Initializers): Update
the example according to the recent change in behavior of field
initializers.
2021-05-21 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* AUTHORS: Change my email address to gnu account.
* etc/poke.rec: Likewise.
* etc/hacking.org: Likewise.
* HACKING: Likewise.
2021-05-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (LMAP): Simplify code, and re-compile writers
for anonymous struct types as well as array types.
* libpoke/pkl-gen.pks (struct_writer): Use @type_struct instead of
type_struct.
2021-05-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (check_struct_field_constraint): Use
PKL_GEN_PUSH_CONTEXT instead of DUP_CONTEXT + CLEAR_CONTEXT. It
is more robust.
(array_writer): Likewise.
(array_bounder): Likewise.
(handle_struct_field_label): Likewise.
(handle_struct_field_constraints): Likewise.
(struct_mapper): Likewise.
(struct_constructor): Likewise.
(struct_field_writer): Likewise.
(struct_writer): Likewise.
(struct_integrator): Likewise.
(complex_lmap): Likewise.
* testsuite/poke.pkl/scons-constraints-3.pk: New test.
* testsuite/poke.map/maps-structs-constraints-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-05-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Fix vars_registered with
declarations in struct types.
(struct_constructor): Likewise.
* testsuite/poke.pkl/optcond-21.pk: New test.
* testsuite/poke.map/map-optcond-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-05-10 Kostas Chasialis <sdi1600195@di.uoa.gr>
* poke/pk-mi-msg.c (struct pk_mi_msg): Added num_args field.
(pk_mi_allocate_msg_args): Update num_args field.
2021-05-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (LOAD_STD): Renamed from LOAD_RT.
2021-05-10 Jose E. Marchesi <jemarch@gnu.org>,
* libpoke/libpoke.c (pk_compiler_new_with_flags): Rename from
pk_compiler_new.
(pk_compiler_new): Define.
* libpoke/libpoke.h: Prototype for pk_compiler_new_with_flags.
(PK_F_NOSTDTYPES): Define.
* libpoke/pkl.h: Add `flags' argument to pkl_new.
(PKL_F_NOSTDTYPES): Define.
* libpoke/std-types.pk: New file.
* libpoke/Makefile.am (dist_pkgdata_DATA): Add std-types.pk.
* libpoke/std.pk: Do not use standard types.
* libpoke/pkl.c (pkl_new): Load std-types.pk
(pkl_new): Get a `flags' argument and do not define standard types
if PKL_F_NOSTDTYPES is specified.
2021-05-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: New token OFFSET.
(primary): OFFSET is a primary.
* libpoke/pkl-lex.l: Handle offsets in alien tokens.
* libpoke/libpoke.h (struct pk_alien_token): Add support for
offset tokens and string tokens.
(PK_ALIEN_TOKEN_OFFSET): Define.
(PK_ALIEN_TOKEN_STRING): Likewise.
* libpoke/pkl.h (struct pkl_alien_token): Add support for offset
tokens and string tokens.
(PKL_ALIEN_TOKEN_OFFSET): Define.
(PKL_ALIEN_TOKEN_STRING): Likewise.
2021-05-08 Jose E. Marchesi <jemarch@gnu.org>,
* libpoke/libpoke.c (pk_register_iod): Allow replacing the foreign
IO device.
2021-05-08 Jose E. Marchesi <jemarch@gnu.org>,
* poke/pk-map.c: New variable alien_token.
(pk_map_alien_token_handler): Adapt to new interface.
* libpoke/libpoke.h (struct pk_alien_token): Define.
(PK_ALIEN_TOKEN_NOTOKEN): Likewise.
(PK_ALIEN_TOKEN_IDENTIFIER): Likewise.
(PK_ALIEN_TOKEN_INTEGER): Likewise.
(pk_alien_token_handler_fn): Return an alien token struct.
* libpoke/pkl.h (struct pkl_alien_token): Likewise.
(PKL_ALIEN_TOKEN_NOTOKEN): Likewise.
(PKL_ALIEN_TOKEN_IDENTIFIER): Likewise.
(PKL_ALIEN_TOKEN_INTEGER): Likewise.
* libpoke/pkl-lex.l: Handle better alien tokens.
2021-05-08 Jose E. Marchesi <jemarch@gnu.org>,
* libpoke/ios-dev.h (struct ios_dev_if): Make the get_if_name hook
to return a const char pointer.
* libpoke/ios.c (ios_get_dev_if_name): Return a constant char
pointer.
* libpoke/ios.h: Likewise.
* testsuite/poke.libpoke/foreign-iod.c (iod_get_if_name): Likewise.
* libpoke/libpoke.h (struct pk_iod_if): Likewise.
* libpoke/libpoke.c (pk_ios_get_dev_if_name): Likewise.
* libpoke/ios-dev-zero.c (ios_dev_zero_get_if_name): Likewise.
* libpoke/ios-dev-sub.c (ios_dev_sub_get_if_name): Likewise.
* libpoke/ios-dev-stream.c (ios_dev_stream_get_dev_if_name): Likewise.
* libpoke/ios-dev-proc.c (ios_dev_proc_get_if_name): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_get_if_name): Likewise.
* libpoke/ios-dev-mem.c (ios_dev_mem_get_if_name): Likewise.
* libpoke/ios-dev-file.c (ios_dev_file_get_if_name): Likewise.
2021-05-08 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.libpoke/foreign-iod.c: Do not include assert.h.
2021-05-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Make the header C++ compliant.
* libpoke/libpoke.c: Vandalize accordingly :(
2021-05-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (struct pk_ios_if): New type.
* libpoke/ios.c (ios_register_foreign_iod): New function.
(ios_foreign_iod): Likewise.
(ios_open): Acknowledge the foreign IO device.
* libpoke/libpoke.c (pk_register_iod): Likewise.
* testsuite/poke.libpoke/foreign-iod.c: New file.
* testsuite/poke.libpoke/Makefile.am (check_PROGRAMS): Add
foreign-iod.
(foreign_iod_SOURCES): New rule.
(foreign_iod_CPPFLAGS): Likewise.
(foreign_iod_CFLAGS): Likewise.
(foreign_iod_LDADD): Likewise.
* testsuite/poke.libpoke/libpoke.exp: Execute foreign-iod test.
2021-05-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Remove spurious
commented insn.
2021-05-06 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk (Poke_HelpEntry): Add fields `predicate and
`synopsis'.
* poke/poke.c (initialize): Initialize the value of have_libnbd_p.
* poke/poke.pk: Define pk_have_libnbd_p.
* poke/pk-save.pk: Likewise.
* poke/pk-extract.pk: Likewise.
* poke/pk-copy.pk: Likewise.
* poke/pk-dump.pk: remove dot at the end of the summary.
* poke/pk-help.pk (pk_help): Print summary lines for dot-commands.
Add help topics for dot-commands.
2021-05-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Use
check_struct_field_constraint.
* testsuite/poke.pkl/scons-constraints-1.pk: New test.
* testsuite/poke.pkl/scons-constraints-2.pk: Likewise.
* testsuite/poke.pktest/pktest-12.pk: Update test.
2021-05-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_printer): Skip absent fields.
* testsuite/poke.pkl/printf-value-16.pk: New test.
* testsuite/poke.pkl/printf-value-17.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-05-05 Luca Saiu <positron@gnu.org>
* libpoke/ras: Comments.
* libpoke/pvm.jitter: Comments.
2021-05-05 Luca Saiu <positron@gnu.org>
* libpoke/pvm.jitter (canary, exit, pushend, popend, pushob, popob)
(pushom, poppm, pushoo, popoo, pushoi, popoi, pushod, popod)
(pushoac, popoac, pushopp, popopp, strace): Rename
JITTER_STATE_BACKING_FIELD and JITTER_STATE_RUNTIME_FIELD into
PVM_STATE_BACKING_FIELD and PVM_STATE_RUNTIME_FIELD, following
Jitter incompatible change.
* libpoke/pvm.c (PVM_STATE_RESULT_VALUE, PVM_STATE_EXIT_CODE)
(PVM_STATE_VM, PVM_STATE_ENV, PVM_STATE_ENDIAN, PVM_STATE_NENC)
(PVM_STATE_PRETTY_PRINT, PVM_STATE_OMODE, PVM_STATE_OBASE)
(PVM_STATE_OMAPS, PVM_STATE_ODEPTH, PVM_STATE_OINDENT)
(PVM_STATE_OACUTOFF): Redefine macros using new Jitter-generated
macros PVM_STATE_RUNTIME_FIELD and PVM_STATE_BACKING_FIELD.
(pvm_initialize_state): Change implementation, again using
PVM_STATE_RUNTIME_FIELD and PVM_STATE_BACKING_FIELD.
(pvm_call_closure): Likewise.
2021-05-05 Luca Saiu <positron@gnu.org>
* poke/pk-cmd-set.c (pk_cmd_set_init): Change xmalloc argument,
making the allocated size correct.
2021-05-03 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-structs-constraints-2.pk: New test.
* testsuite/poke.map/maps-structs-constraints-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-05-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (handle_struct_field_constraints): Pass
@struct_type to check_struct_field_constraint.
(check_struct_field_constraint): Add TYPE.FIELD information to the
E_constraint exceptions.
2021-05-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am: use DISTCLEANFILES for the files generated
by AX_CREATE_PKGCONFIG_INFO, not MOSTLYCLEANFILES.
2021-05-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (generate-vm-files): New rule.
(pvm-vm.h): Likewise.
(pvm-vm1.c): Likewise.
(pvm-vm2.c): Likewise.
2021-05-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (MAINTAINERCLEANFILES): Add jitterc
generated files and add $(srcdir) prefix to lex and bison
generated files.
* poke/Makefile.am (MAINTAINERCLEANFILES): Likewise.
* DEV-NEWS: Add note about this.
2021-05-02 Jose E. Marchesi <jemarch@gnu.org>
* README: Add instructions on how to offer software to the GNU
Project.
2021-05-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (yyreport_syntax_error): Fix memory leak.
* libpoke/ios.c (ios_open): Avoid freeing an uninitialized
pointer.
(ios_read_string): Fix handling of errors from ios_read_uint.
* libpoke/ios-dev-sub.c (ios_dev_sub_open): Handle ENOMEM.
* libpoke/ios-dev-proc.c (ios_dev_proc_open): Likewise.
2021-05-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk: New field `usage'.
Add `usage' fields to predefined settings.
* poke/pk-cmd-set.c (pk_cmd_set_init): Use usage messages from
settings.
2021-04-30 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Do not check for tcl/tk if --disable-gui is
specified at configure time.
2021-04-28 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (Pk_Dump_Offset): New type.
(pk_dump_offsets): New variable.
(pk_dump_get_offset): New function.
(pk_dump_set_offset): Likewise.
(dump): Use the pk_dump_offsets registry for default offsets when
`from' is not specified.
2021-04-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Avoid "leaking" slots in
the exceptions stack.
(struct_field_mapper): Likewise.
2021-04-22 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pvm-alloc.h (pvm_alloc_uncollectable): New function decl.
(pvm_free_uncollectable): Likewise.
* libpoke/pvm-alloc.c (pvm_alloc_uncollectable): New function def.
(pvm_free_uncollectable): Likewise.
* libpoke/pkl-ast.h (struct pkl_ast_type): For both arrays and
structs, replace the PVM closure fields with pointer to `pvm_val`.
(PKL_AST_TYPE_A_CLOSURES): Re-define accordingly.
(PKL_AST_TYPE_A_MAPPER): Likewise.
(PKL_AST_TYPE_A_WRITER): Likewise.
(PKL_AST_TYPE_A_BOUNDER): Likewise.
(PKL_AST_TYPE_A_CONSTRUCTOR): Likewise.
(PKL_AST_TYPE_A_PRINTER): Likewise.
(PKL_AST_TYPE_S_CLOSURES): Likewise.
(PKL_AST_TYPE_S_MAPPER): Likewise.
(PKL_AST_TYPE_S_WRITER): Likewise.
(PKL_AST_TYPE_S_CONSTRUCTOR): Likewise.
(PKL_AST_TYPE_S_PRINTER): Likewise.
(PKL_AST_TYPE_S_COMPARATOR): Likewise.
(PKL_AST_TYPE_S_INTEGRATOR): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_array_type): Initialize the
`closures` field with a pointer to uncollectable memory. Remove
the `pvm_alloc_add_gc_roots` function calls.
(pkl_ast_make_struct_type): Likewise.
(pkl_ast_node_free): Free the uncollectable memory for arrays and
structs.
2021-04-18 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Bump poke version to 1.2.
* doc/gendocs_template: Likewise.
* NEWS: Add entry for 1.2.
2021-04-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_op_impl): New handler.
(pkl_phase_gen): Register handler.
* testsuite/poke.pkl/impl-1.pk: New test.
* testsuite/poke.pkl/impl-2.pk: Likewise.
* testsuite/poke.pkl/impl-3.pk: Likewise.
* testsuite/poke.pkl/impl-4.pk: Likewise.
* testsuite/poke.pkl/impl-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Boolean Operators): Mention the => operator.
2021-04-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ops.def: Add entry for IMPL.
* libpoke/pkl-tab.y: New token IMPL.
(expression): Add rule for the IMPL operator.
* libpoke/pkl-lex.l: Recognize the token =>.
* libpoke/pkl-typify.c (pkl_phase_typify1): Handle OP_IMPL nodes
with pkl_typify1_ps_op_boolean.
* libpoke/pkl-promo.c (pkl_phase_promo): Handle OP_IMPL nodes with
pkl_promo_ps_op_binary.
* testsuite/poke.pkl/impl-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/field-init-diag-6.pk: New test.
* testsuite/poke.pkl/field-init-diag-7.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-04-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (field_cons_init): New type in %union.
(struct_type_field_constraint_and_init): Return a field_cons_init.
(struct_type_field): Adjust rule accordingly.
* testsuite/poke.pkl/field-init-2.pk: Likewise.
* testsuite/poke.pkl/eq-structs-9.pk: Likewise.
* testsuite/poke.map/maps-structs-init-1.pk: Likewise.
* testsuite/poke.map/maps-structs-init-2.pk: Likewise.
* testsuite/poke.map/maps-int-structs-20.pk: Adapt test.
* testsuite/poke.pkl/field-init-diag-5.pk: New test.
* testsuite/poke.pkl/field-init-13.pk: Likewise.
* testsuite/poke.map/maps-structs-init-3.pk: Likewise.
* pickles/bmp.pk (BMP_Header): Use == instead of = in type.
* pickles/bpf.pk (BPF_Insn_Regs): Likewise.
* pickles/cpio.pk (CPIO_Old_Header): Likewise.
* pickles/ctf.pk (CTF_Preamble): Likewise.
* pickles/elf.pk (Elf64_Ehdr): Likewise.
* pickles/id3v1.pk (ID3V1_Tag): Likewise.
* pickles/id3v2.pk (ID3V2_Hdr): Likewise.
* pickles/jffs2.pk (JFFS2_Dirent): Likewise.
(JFFS2_Inode): Likewise.
(JFFS2_XAttr): Likewise.
(JFFS2_XRef): Likewise.
(JFFS2_Sum_Dirent): Likewise.
(JFFS2_Sum_XAttr): Likewise.
(JFFS2_Sum_XRef): Likewise.
(JFFS2_Summary): Likewise.
* pickles/mbr.pk (MBR): Likewise.
* pickles/ustar.pk (USTAR_Sector): Likewise.
* doc/poke.texi (Field Initializers): Document the syntax in field
initializers.
2021-04-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Rule for `== EXPRESSION' in struct field
types, and modify semantics of `= EXPRESSION'.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Do not allow casting
`any' to a function type.
* testsuite/poke.pkl/cast-any-to-function-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* etc/poke.rec (support casts from `any' to function types): New
task.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk (Poke_HelpEntry): Add constraint to make sure
the summary doesn't span for multiple lines.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el (poke-mode-syntax-table): Fix syntax of //
comments.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk: Define pk_doc_viewer.
* poke/poke.c: Remove global poke_doc_viewer.
(initialize): Do not initialize poke_doc_viewer.
(pk_var_string): New function.
* poke/pk-cmd-misc.c (pk_cmd_doc): Use pk_var_string instead of
poke_doc_viewer.
* poke/pk-settings.pk: Add setting for doc-viewer.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-set.c (pk_cmd_set): New function.
(pk_cmd_set_int): Likewise.
(pk_cmd_set_bool_str): Likewise.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec_1): Set argv[0] to a string argument
containing the dot-command name.
* poke/pk-cmd-help.c (pk_cmd_help): Likewise.
* poke/pk-cmd-editor.c (pk_cmd_editor): Adjust accordingly.
* poke/pk-cmd-vm.c (pk_cmd_vm_disas_exp): Likewise.
(pk_cmd_vm_disas_fun): Likewise.
* poke/pk-cmd-set.c (pk_cmd_set_obase): Likewise.
(pk_cmd_set_endian): Likewise.
(pk_cmd_set_nenc): Likewise.
(pk_cmd_set_auto_map): Likewise.
(pk_cmd_set_prompt_maps): Likewise.
(pk_cmd_set_pretty_print): Likewise.
(pk_cmd_set_oacutoff): Likewise.
(pk_cmd_set_odepth): Likewise.
(pk_cmd_set_oindent): Likewise.
(pk_cmd_set_omaps): Likewise.
(pk_cmd_set_omode): Likewise.
(pk_cmd_set_error_on_warning): Likewise.
(pk_cmd_set_doc_viewer): Likewise.
* poke/pk-cmd-misc.c (pk_cmd_exit): Likewise.
(pk_cmd_doc): Likewise.
(pk_cmd_jmd): Likewise.
* poke/pk-cmd-map.c (pk_cmd_map_create): Likewise.
(pk_cmd_map_remove): Likewise.
(pk_cmd_map_show): Likewise.
(pk_cmd_map_entry_add): Likewise.
(pk_cmd_map_entry_remove): Likewise.
(pk_cmd_map_load): Likewise.
(pk_cmd_info_maps): Likewise.
* poke/pk-cmd-ios.c (pk_cmd_ios): Likewise.
(pk_cmd_sub): Likewise.
(pk_cmd_proc): Likewise.
(pk_cmd_file): Likewise.
(pk_cmd_close): Likewise.
(pk_cmd_info_ios): Likewise.
(pk_cmd_load_file): Likewise.
(pk_cmd_source_file): Likewise.
(pk_cmd_mem): Likewise.
(pk_cmd_nbd): Likewise.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Prototype for pk_struct_ref_field_value.
* libpoke/pk-val.c (pk_struct_ref_field_value): New function.
* poke/pk-cmd-set.c (pk_cmd_set_init): New function.
(pk_cmd_set_int): New function.
(pk_cmd_set_bool_str): Likewise.
* poke/pk-cmd.c (pk_cmd_init): Call pk_cmd_set_init.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk: Add settings oacutoff, odepth, oindent,
omaps, omode.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (@code{vm_oacutoff}): New section.
(@code{vm_set_oacutoff}): Likewise.
(@code{vm_odepth}): Likewise.
(@code{vm_oindent}): Likewise.
(@code{vm_set_oindent}): Likewise.
(@code{vm_omaps}): Likewise.
(@code{vm_set_omaps}): Likewise.
(@code{vm_omode}): Likewise.
* libpoke/pkl-tab.y: New tokens.
* libpoke/pkl-lex.l: Handle new tokens.
* libpoke/pkl-rt.pk: Define new built-ins.
* libpoke/pkl-gen.c: Generate code for new built-ins.
* testsuite/poke.pkl/vm-oacutoff-1.pk: New test.
* testsuite/poke.pkl/vm-set-oacutoff-1.pk: Likewise.
* testsuite/poke.pkl/vm-odepth-1.pk: Likewise.
* testsuite/poke.pkl/vm-set-odepth-1.pk: Likewise.
* testsuite/poke.pkl/vm-oindent-1.pk: Likewise.
* testsuite/poke.pkl/vm-set-oindent-1.pk: Likewise.
* testsuite/poke.pkl/vm-omaps-1.pk: Likewise.
* testsuite/poke.pkl/vm-set-omaps-1.pk: Likewise.
* testsuite/poke.pkl/vm-omode-1.pk: Likewise.
* testsuite/poke.pkl/vm-set-omode-1.pk: Likewise.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk: Simplify handling of boolean settings.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_prompt_maps_p): New global.
* poke/pk-settings.pk: Setting for prompt-maps.
2021-04-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.h: Remove global poke_auto_map_p.
* poke/poke.c: Rename poke_auto_map_p to poke_default_auto_map_p.
(initialize): Set the default value of poke_auto_map_p.
(pk_auto_map_p): New function.
* poke/pk-cmd-set.c (pk_cmd_set_auto_map): Use the new functions
instead of referring to the global.
* poke/pk-ios.c (pk_open_file): Likewise.
* poke/pk-map.pk: Declare poke_auto_map_p.
* poke/pk-settings.pk: Add new global setting auto-map.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk (Poke_Setting_Registry): New method `add'.
Use the method to create entries.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-help.pk: New file.
* poke/pk-map.pk: Likewise.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-help.pk and
pk-map.pk
* poke/poke.pk: Move definitions to the new files and load them.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_host_endian): New variable.
(pk_network_endian): Likewise.
* poke/poke.c (initialize): Initialize the values of
pk_host_endian and pk_network_endian.
* poke/pk-settings.pk (Poke_Setting_Registry): add the `endian'
global setting.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: New tokens BUILTIN_VM_OPPRINT and
BUILTIN_VM_SET_OPPRINT.
(builtin): Add rules for them.
* libpoke/pkl-lex.l: Recognize new tokens.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_VM_OPPRINT): Define.
(PKL_AST_BUILTIN_VM_SET_OPPRINT): Likewise.
* libpoke/pkl-rt.pk (vm_opprint): New function.
(vm_set_opprint): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for new
builtins.
* poke/pk-settings.pk: Use new builtins.
* libpoke/pvm.jitter: Move pretty-print from the runtime state to
the backing state.
* libpoke/pvm.c (PVM_STATE_OPPRINT): Redefine accordingly.
* testsuite/poke.pkl/vm-opprint-1.pk: New test.
* testsuite/poke.pkl/vm-set-opprint-1.pk: Likewise.
* doc/poke.texi (VM): New section.
(pk_opprint): New subsection.
(pk_set_opprint: Likewise.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: New tokens BUILTIN_VM_OBASE and
BUILTIN_VM_SET_OBASE.
(builtin): Add rules for them.
* libpoke/pkl-lex.l: Recognize new tokens.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_VM_OBASE): Define.
(PKL_AST_BUILTIN_VM_SET_OBASE): Likewise.
* libpoke/pkl-rt.pk (vm_obase): New function.
(vm_set_obase): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for new
builtins.
* poke/pk-settings.pk: Use new builtins.
* libpoke/pvm.jitter: Move obase from the runtime state to the
backing state.
* libpoke/pvm.c (PVM_STATE_OBASE): Redefine accordingly.
* testsuite/poke.pkl/vm-obase-1.pk: New test.
* testsuite/poke.pkl/vm-set-obase-1.pk: Likewise.
* testsuite/poke.pkl/vm-set-obase-diag-1.pk: Likewise.
* doc/poke.texi (VM): New section.
(pk_obase): New subsection.
(pk_set_obase): Likewise.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-settings.pk: New file.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-settings.pk
* poke/poke.pk: Load pk-settings.pk.
(pk_help): Print summary of available "settings" help topics.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (popob): Use jitter macros instead of pvm
calls to access the runtime state.
(pushend): Likewise.
(popend): Likewise.
(pushob): Likewise.
(pushom): Likewise.
(popom): Likewise.
(pushoo): Likewise.
(popoo): Likewise.
(pushoi): Likewise.
(popoi): Likewise.
(pushod): Likewise.
(popod): Likewise.
(popoac): Likewise.
(pushopp): Likewise.
(popopp): Likewise.
2021-04-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_rela): Handle function
arguments.
* libpoke/pkl-promo.c (pkl_promo_ps_op_rela): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_op_rela): Likewise.
* libpoke/pkl-insn.def: New instructions PKL_INSN_EQC and
PKL_INSN_NEC.
* libpoke/pvm.jitter (eqc): New instruction.
(nec): Likewise.
* libpoke/pkl-asm.c (pkl_asm_insn_cmp): Support EQ and NE for
function values.
* doc/poke.texi (Function Comparison): New section.
* testsuite/poke.pkl/gt-functions-diag-1.pk: New test.
* testsuite/poke.pkl/ge-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/le-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/lt-functions-diag-1.pk: Likewise.
* testsuite/poke.pkl/ne-functions-2.pk: Likewise.
* testsuite/poke.pkl/ne-functions-1.pk: Likewise.
* testsuite/poke.pkl/eq-functions-2.pk: Likewise.
* testsuite/poke.pkl/eq-functions-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-04-06 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (dump): Fix printing of hyperlink.
2021-04-05 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Conditionalize the AC_DEFINE of HAVE_PROC.
2021-04-05 Kostas Chasialis <sdi1600195@di.uoa.gr>
* etc/pk-mi-json-schema.json (schema): Added all "required" fields to
"Mapping". "IOS" can now take null.
2021-04-05 Luca Saiu <positron@gnu.org>
* configure.ac (JITTER_PROFILE_COUNT, JITTER_PROFILE_SAMPLE):
Change to PVM_PROFILE_COUNT and PVM_PROFILE_SAMPLE, for
compatibility with Jitter.
2021-04-05 Egeyar Bagcioglu <egeyar@gmail.com>
* etc/git-hooks/pre-push: Report it clearly when the pre-push hook
fails due to remote containing unfetched commits.
2021-04-05 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_token_kind): The token is no longer
an index.
(hserver_token_cmd): Likewise.
(hserver_token_function): Likewise.
(hserver_token_p): Likewise.
2021-04-05 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Load pk-hserver.pk directly.
* poke/pk-hserver.h: Remove pk_hserver_load.
* poke/pk-hserver.c (pk_hserver_load): Remove function.
2021-04-05 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_help): Generate hyperlinks for help topics.
* poke/pk-dump.pk (pk_dump_addr_hyperlinks): New variable.
(dump): Support emitting hyperlinnks for printed bytes.
* doc/poke.texi (Presentation options for @command{dump}):
Document the hyperlinks support in dump.
2021-04-05 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.c (pk_hserver_load): New function.
* poke/poke.c (initialize): Make sure pk-hserver.pk gets loaded
before poke.pk and the cmd subsystem.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_info_ios): Add column for button
[close].
(print_info_ios): Emit a [close] button as a hyperlink.
2021-04-04 Egeyar Bagcioglu <egeyar@gmail.com>
* doc/poke.texi: Adjust the output of ".info ios".
* libpoke/libpoke.c (pk_ios_get_bias): New.
* libpoke/libpoke.h (pk_ios_get_bias): Likewise.
* libpoke/pkl-ast.h: Define PKL_AST_BUILTIN_IOGETB and
PKL_AST_BUILTIN_IOSETB.
* libpoke/pkl-gen.c (PKL_PHASE_BEGIN_HANDLER): Add the cases
PKL_AST_BUILTIN_IOGETB and PKL_AST_BUILTIN_IOSETB.
* libpoke/pkl-lex.l: Add "__PKL_BUILTIN_IOGETB__" and
"__PKL_BUILTIN_IOSETB__".
* libpoke/pkl-rt.pk: Declare iobias and iosetbias.
* libpoke/pkl-tab.y: Add BUILTIN_IOGETB and BUILTIN_IOSETB.
* libpoke/pvm.jitter (iogetb): If bias is 8-bit aligned, report it in
bytes, else in bits.
(iosetb): Swap the positions of bias and ios.
* poke/pk-cmd-ios.c (print_info_ios): Print the bias.
(pk_cmd_info_ios): Likewise.
* testsuite/Makefile.am: Add the new test files.
* testsuite/poke.cmd/file-bias-1.pk: New
* testsuite/poke.cmd/file-bias-2.pk: New.
* testsuite/poke.cmd/file-mode.pk: Adjust ".info ios".
* testsuite/poke.cmd/file-relative.pk: Likewise.
* testsuite/poke.pkl/iobias-1.pk: New.
* testsuite/poke.pkl/iobias-2.pk: New.
* testsuite/poke.pkl/iosetbias-1.pk: New.
* testsuite/poke.pkl/iosetbias-2.pk: New.
* testsuite/poke.pkl/iosetbias-3.pk: New.
* testsuite/poke.pkl/iosetbias-4.pk: New.
* testsuite/poke.pkl/iosetbias-5.pk: New.
* testsuite/poke.pkl/iosetbias-6.pk: New.
* testsuite/poke.pkl/iosetbias-7.pk: New.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (exit): Mark instruction as `branching',
since it uses JITTER_EXIT.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.c (read_from_client): Print a string hint after
the prompt when dispatching 'c' hyperlinks.
* poke/pk-hserver.pk (hserver_print_hl): Get an optional
`function' argument.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (HServer_Token): New field `function'.
(hserver_make_hyperlink): Handle hyperlinks of kind 'c'.
(hserver_token_function): New function.
* poke/pk-hserver.c (pk_hserver_function): New function.
(pk_hserver_make_hyperlink): Get a `function' argument.
(read_from_client): Dispatch 'c' hyperlinks.
* poke/pk-cmd-ios.c (print_info_ios): Adjust accordingly.
* poke/pk-repl.c (banner): Likewise.
2021-04-03 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_get_token): Allow hserver_cur_token
to grow up to 2 ** 32.
(hserver_make_hyperlink): Wrap the token
number to a table index.
* poke/pk-hserver.c (pk_hserver_get_token): hserver_get_token
returns an unsigned int.
* poke/pk-hserver.h: Adapt prototype accordingly.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_compile_call): Fix passing PVM_NULL
arguments.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Make pvm_print_val show integral structs as
integers): Add missing Component.
2021-04-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (pk_call): Allow passing PK_NULL as arguments,
for optional arguments.
* libpoke/pkl.c (pkl_compile_call): Likewise.
* poke/pk-cmd-help.c (pk_cmd_help): Adapt accordingly.
* poke/pk-hserver.c (pk_hserver_get_token): Likewise.
(pk_hserver_token_p): Likewise.
(pk_hserver_token_kind): Likewise.
(pk_hserver_cmd): Likewise.
(pk_hserver_make_hyperlink): Likewise.
2021-04-03 Luca Saiu <positron@gnu.org>
* etc/hacking.org: Documentation.
* etc/poke.rec: Documentation.
* libpoke/pvm.jitter (wrapped-functions): Update.
Add new attributes for compatibility with Jitter changes and
no-threading, and for performance.
* HACKING: Regenerate.
2021-04-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.h (struct pkl_trans_payload): Add endianness
stack.
(pkl_trans_init_payload): Initialize endian.
* libpoke/pkl-trans.c (PKL_TRANS_ENDIAN): Define.
(PKL_TRANS_PUSH_ENDIAN): Likewise.
(PKL_TRANS_POP_ENDIAN): Likewise.
(pkl_trans1_pr_struct_type_field): New handler.
(pkl_trans1_ps_struct_type_field): Likewise.
(pkl_phase_trans1): Register new handlers.
* libpoke/pkl-anal.c (pkl_anal2_ps_struct_type_field): Remove
error check and add warning.
* testsuite/poke.map/maps-structs-endian-3.pk: New test.
* testsuite/poke.map/maps-structs-endian-4.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-5.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-6.pk: Likewise.
* doc/poke.texi (Field Endianness): Note that `little' and `big'
are valid for any kind of field.
* testsuite/poke.map/maps-structs-endian-7.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-8.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-9.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-10.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-diag-1.pk: Likewise.
* testsuite/poke.map/maps-structs-endian-11.pk: Likewise.
* testsuite/poke.pkl/struct-types-endian-diag-1.pk: Remove test.
* testsuite/poke.pkl/struct-types-endian-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-04-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: pk_ios_size now reports size in bytes.
* libpoke/ios.h: Likewise for ios_size.
* libpoke/ios.c (ios_size): Adjust accordingly.
* libpoke/pvm.jitter (iosize): Likewise.
* poke/pk-cmd-ios.c (print_info_ios): Likewise.
* libpoke/pkl-rt.pk (iosize): Likewise.
* testsuite/poke.pkl/ios-mem-4.pk: Adjust accordingly.
* testsuite/poke.pkl/iosize-1.pk: Likewise.
2021-04-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c: Define.
(PK_PROC_F_MAPS_ALL): Likewise.
(PK_PROC_F_MAPS): Likewise.
* poke/pk-ios.h: Prototype for pk_open_proc_maps.
* poke/pk-ios.c (pk_open_proc_maps): New function.
2021-04-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_sub): New function.
(sub_cmd): Define.
(close_if_sub_of): New function.
(pk_cmd_close): Close sub-IOS automatically.
* poke/pk-cmd.c (dot_cmds): Register sub_cmd.
* libpoke/ios.c (ios_map): Allow callbacks to remove the given
ios.
* testsuite/poke.cmd/close-sub-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* doc/poke.texi (close command): Note how .closing an IO space
also closes sub-spaces.
(sub command): New section.
2021-03-31 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_proc): New function.
(proc_cmd): Define.
* poke/pk-cmd.c (dot_cmds): Add proc_cmd.
* doc/poke.texi (proc command): New section.
2021-03-31 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac (HAVE_PROC): Define if the host OS provides a proc/
directory.
* libpoke/ios-dev-proc.c: New file.
* libpoke/Makefile.am (libpoke_la_SOURCES): Add ios-dev-proc.c.
* libpoke/ios.c (ios_dev_ifs): Add ios_dev_proc.
2021-04-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev.h: Prototypes for ios_get_dev and
ios_get_dev_if.
* libpoke/ios.c (ios_get_dev): New function.
(ios_get_dev_if): Likewise.
(ios_dev_ifs): Register ios_dev_sub.
(ios_write_int): Return IOS_EPERM if the IOS is not writable.
(ios_write_uint): Likewise.
(ios_write_string): Likewise.
* libpoke/ios-dev-sub.c: New file.
* libpoke/Makefile.am (libpoke_la_SOURCES): Add ios-dev-sub.c.
* libpoke/std.pk (opensub): New function.
* testsuite/poke.pkl/open-sub-1.pk: New test.
* testsuite/poke.pkl/open-sub-2.pk: Likewise.
* testsuite/poke.pkl/open-sub-3.pk: Likewise.
* testsuite/poke.pkl/open-sub-4.pk: Likewise.
* testsuite/poke.pkl/open-sub-5.pk: Likewise.
* testsuite/poke.pkl/open-sub-6.pk: Likewise.
* testsuite/poke.pkl/open-sub-7.pk: Likewise.
* testsuite/poke.pkl/open-sub-8.pk: Likewise.
* testsuite/poke.pkl/open-sub-9.pk: Likewise.
* testsuite/poke.pkl/open-sub-10.pk: Likewise.
* testsuite/poke.pkl/open-sub-11.pk: Likewise.
* testsuite/poke.pkl/open-sub-12.pk: Likewise.
* testsuite/poke.pkl/open-sub-13.pk: Likewise.
* testsuite/poke.pkl/open-sub-14.pk: Likewise.
* testsuite/poke.pkl/open-sub-15.pk: Likewise.
* testsuite/poke.pkl/open-sub-16.pk: Likewise.
* testsuite/poke.pkl/open-sub-17.pk: Likewise.
* testsuite/poke.pkl/open-sub-18.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-04-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (ltos): Support an optional `base' argument.
* testsuite/poke.std/std-test.pk: Add tests for other bases in
ltos.
* doc/poke.texi (ltos): Document the `base' argument.
2021-03-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (dump): Handle E_ios when peeking bytes.
(pk_dump_unknown_byte): Define.
* etc/poke-default.css (.dump-unknown): New class.
* doc/poke.texi (Presentation options for @command{dump}):
Document pk_dump_unknown_byte.
2021-03-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-file.c (ios_dev_file_pwrite): Return IOD_ERROR
in case ferror returns an error.
(ios_dev_file_pread): Return IOD_ERROR in
case ferror returns an error.
(ios_dev_file_pwrite): Likewise.
* libpoke/ios.c (IOS_PUT_C_ERR_CHCK): Handle errors from pwrite.
(ios_write_int_fast): Likewise.
(ios_write_string): Likewise.
(IOS_GET_C_ERR_CHCK): Handle IOD_ERROR from pread.
(ios_read_int_common): Likewise.
(ios_read_int): Likewise.
(ios_read_uint): Likewise.
(ios_read_string): Likewise.
(ios_read_string): Use IOS_EOF instead of IOS_EIOFF.
(ios_write_string): Likewise.
* libpoke/ios.h (IOS_EIOFF): Remove.
* libpoke/pvm.jitter: Use IOS_EOF instead of IOS_EIOFF.
2021-03-31 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/dump-12.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-03-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-zero.c: New file.
* libpoke/Makefile.am (libpoke_la_SOURCES): Add ios-dev-zero.c.
* libpoke/ios.c (ios_dev_ifs): Register ios_dev_zero.
2021-03-31 Kostas Chasialis <sdi1600195@di.uoa.gr>
* bootstrap.conf (gnulib_modules): Added vsnprintf-posix module.
2021-03-31 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (dump): Fix ruler and addresses for offsets >
2^32.
2021-03-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_array_insert): Do not pvm_sizeof the
whole array for each inserted element.
2021-03-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_SLEEP): Define.
* libpoke/pkl-lex.l: Handle __PKL_BUILTIN_SLEEP__.
* libpoke/pkl-tab.y (builtin): Rule for the sleep builtin.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for the
`sleep' builtin.
* libpoke/pkl-rt.pk (sleep): Define builtin.
* libpoke/pvm.jitter (sleep): Do not raise an exception if
nanosleep gets interrupted and raise E_generic whenever
appropriate.
* bootstrap.conf (libpoke_modules): Import the module `errno' from
gnulib.
* testsuite/poke.pkl/sleep-1.pk: New test.
* testsuite/poke.pkl/sleep-2.pk: Likewise.
* testsuite/poke.pkl/sleep-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-03-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: New instruction PKL_INSN_SLEEP.
* libpoke/pvm.jitter (sleep): New instruction.
* bootstrap.conf (libpoke_modules): Import module `nanosleep'.
2021-03-29 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_Section): Check that the header in the
section declares the right size.
Use header.hdr_len instead of OFFSET.
(BTF_Header): Use an initialization value for `magic'.
2021-03-28 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* etc/pk-mi-json-schema.json: Re-order fields. Remove `Null` object.
Change `Mapping` to accept one required field `mapped` and three
optional fields: `strict`, `IOS` and `offset`.
* poke/pk-mi-json.c: Re-write the JSON to pk_val conversion.
(jerror): New function.
(jexpect): Likewise.
(pvalue): Likewise.
(pexpect): Likewise.
(pexpect_sct): Likewise.
(pexpect_aelem): Likewise.
(pexpect_arr): Likewise.
(pexpect_map): Likewise.
(pk_mi_jsonobj_to_val): Likewise.
(pk_mi_null_to_json): Removed.
(pk_mi_json_to_val_1): Likewise.
(pk_mi_json_poke_value_type): Likewise.
(pk_mi_json_to_int): Likewise.
(pk_mi_json_to_uint): Likewise.
(pk_mi_json_to_string): Likewise.
(pk_mi_json_to_offset): Likewise.
(pk_mi_json_to_mapping): Likewise.
(pk_mi_json_to_sct): Likewise.
(pk_mi_json_array_element_pair): Likewise.
(pk_mi_json_to_array): Likewise.
(collect_json_arg): Use `pk_mi_jsonobj_to_val` function.
(pk_mi_json_to_val): Re-write.
(RETURN_ON_JERR): New macro.
(RETURN_ERR_IF): Likewise.
* testsuite/poke.mi-json/mi-json.c (JFIELD_IMPL): New macro.
(JFIELD): Likewise.
(CHK_IMPL): Likewise.
(CHK): Likewise.
(STREQ_LIT): Likewise.
(test_json_pk_int): Re-write.
(test_json_pk_uint): Likewise.
(test_json_pk_string): Likewise.
(test_json_pk_offset): Likewise.
(test_json_pk_null): Likewise.
(test_json_pk_sct): Likewise.
(test_json_pk_array): Likewise.
(test_json_to_val): Report more info to the `stdout`.
* testsuite/poke.mi-json/pk_offset_uint.json: New sample file.
* testsuite/poke.mi-json/pk_sct_empty.json: Likewise.
* testsuite/poke.mi-json/pk_sct_empty_mapped.json: Likewise.
* testsuite/poke.mi-json/pk_array.json: Change `mapping`.
* testsuite/poke.mi-json/pk_sct.json: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Updated.
2021-03-28 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/libpoke.h (pk_val_mappable_p): New function declaration.
(pk_val_set_mapped): Likewise.
(pk_val_strict_p): Likewise.
(pk_val_set_strict): Likewise.
(pk_val_set_ios): Likewise.
(pk_val_set_offset): Likewise.
(pk_val_boffset): Likewise.
(pk_val_set_boffset): Likewise.
* libpoke/pvm-val.h (PVM_VAL_MAPPABLE_P): New macro.
* libpoke/pk-val.c (pk_val_mappable_p): New function definition.
(pk_val_set_mapped): Likewise.
(pk_val_strict_p): Likewise.
(pk_val_set_strict): Likewise.
(pk_val_set_ios): Likewise.
(pk_val_set_offset): Likewise.
(pk_val_boffset): Likewise.
(pk_val_set_boffset): Likewise.
* testsuite/poke.libpoke/values.c (test_simple_values_mapping):
New tests.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/ass-map-20.pk: New test.
* testsuite/poke.map/maps-strings-4.pk: Renamed from
maps-strings-diag-4.pk.
* testsuite/Makefile.am (EXTRA_DIST): Update accordingly.
2021-03-27 David Faust <david.faust@oracle.com>
* libpoke/ios-dev-file.c (ios_dev_file_convert_flags): Return
-1 for bad flags to avoid collision with O_RDONLY == 0.
(ios_dev_file_open): Update flags_for_open check accordingly.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (dump): Raise E_perm instead of E_no_ios if
the specified IO space exists but is not readable.
* testsuite/poke.cmd/dump-10.pk: Update accordingly.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import the gnulib `access'
module.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_file): Do not check for read
permissions before actually attempting to open the file.
* libpoke/ios-dev-file.c (ios_dev_file_open): Try to open in
write-only mode if flags are not specified.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Add IOS_EPERM and exception E_perm): Removed as
done.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Exceptions): Document E_perm.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios.c (ios_read_uint): Return IOS_EPERM if the IO space
is not readable.
(ios_read_int): Likewise.
(ios_read_string): Likewise.
(IOS_GET_C_ERR_CHCK): Likewise.
* testsuite/poke.map/maps-perm-1.pk: New test.
* testsuite/poke.map/maps-perm-2.pk: Likewise.
* testsuite/poke.map/maps-perm-3.pk: Likewise.
* testsuite/poke.map/maps-perm-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios.h (IOS_EPERM): Define.
* libpoke/pvm.jitter (PVM_PEEK): Raise PVM_E_PERM if the IO
subsystem reports IOS_EPERM.
(PVM_POKE): Likewise.
(peeks): Likewise.
(pokes): Likewise.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h (PVM_E_PERM): Define.
(PVM_E_PERM_MSG): Likewise.
(PVM_E_PERM_ESTATUS): Likewise.
* libpoke/pkl-rt.pk (EC_perm): New variable.
(E_perm): Likewise.
2021-03-27 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* poke/pk-mi-json.c (pk_mi_offset_to_json): Add support for `uint`
as magnitude of offsets.
2021-03-27 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pk-val.c (pk_val_offset): Fix the unit of offset to use
`uint<64>` instead of `uint<32>`.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-mem.c (ios_dev_mem_open): Memory IOS are always
read/write.
* poke/pk-dump.pk (Arguments): Raise E_perm if the specified IOS
is not readable.
* testsuite/poke.cmd/dump-10.pk: New test.
* testsuite/poke.cmd/dump-11.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (builtin): Rule for BUILTIN_IOFLAGS.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_IOFLAGS): Define.
* libpoke/pkl-lex.l: Handle __PKL_BUILTIN_IOFLAGS__.
* libpoke/pkl-insn.def: New instruction ioflags.
* libpoke/pvm.jitter: Likewise.
* libpoke/pkl-rt.pk (ioflags): Define function.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for the
ioflags builtin.
* doc/poke.texi (ioflags): New section.
* testsuite/poke.pkl/ioflags-1.pk: New test.
* testsuite/poke.pkl/ioflags-2.pk: Likewise.
* testsuite/poke.pkl/ioflags-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-03-27 Jose E. Marchesi <jemarch@gnu.org>
Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-gen.pks (complex_lmap): Make sure to leave the
l-value in a good state if the writer raises an exception.
* testsuite/poke.map/ass-map-19.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-03-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_do_pass_1): PKL_AST_LOOP_STMT_HEAD is a
chain.
* testsuite/poke.pkl/for-13.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-03-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi-msg.c (pk_mi_set_arg): An ANY msg argument can be of
any type.
2021-03-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi.c (pk_mi_dispatch_msg): free invreq_msg once sent.
2021-03-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi-msg.def: New event INVREQ.
* poke/pk-mi.c (pk_mi_dispatch_msg): Send an INVREQ event whenever
appropriate.
* poke/pk-mi-msg.h: Remove redundant prototype.
2021-03-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (PK_FILE_UFLAGS): Define.
(PK_FILE_F_CREATE): Likewise.
(pk_cmd_file): Maybe create file.
(file_cmd): Register PK_FILE_UFLAGS.
* poke/pk-ios.c (pk_open_file): Get a new argument create_p.
* poke/pk-ios.h: Update prototype for pk_open_file accordingly.
* doc/poke.texi (file command): Document the flag /c.
2021-03-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/leb128.pk: Fix method `value' for both LEB128 and
ULEB128.
2021-03-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi-json.c (pk_mi_json_object_to_msg): Small
factorization.
2021-03-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi-msg.def: New file.
* poke/pk-mi-msg.c: Rewrite based on pk-mi-msg.def.
* poke/pk-mi-msg.h: Likewise.
* poke/pk-mi-json.c: Likewise.
* poke/Makefile.am (poke_SOURCES): Add pk-mi-msg.def.
* testsuite/poke.mi-json/Makefile.am (mi_json_SOURCES): Add
common/pk-utils.c.
(mi_json_CPPFLAGS): Add common/.
2021-03-21 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update version to 1.1.
* doc/gendocs_template: Likewise.
2021-03-21 Jose E. Marchesi <jemarch@gnu.org>
* NEWS: Update for 1.1.
2021-03-19 Jose E. Marchesi <jemarch@gnu.org>
* etc/Makefile.am (dist_lisp_DATA): Avoid byte-compiling emacs
modes.
2021-03-17 Kostas Chasialis <sdi1600195@di.uoa.gr>
* doc/gen-pvm-insns.sh: A more portable version of the script.
* cfg.mk (sc_tests_listed_in_makefile_am): Now correctly finds
tests on srcdir builds.
2021-03-17 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_open): Create files with
adequate flags.
2021-03-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-ios.h: Rename pk_open_ios to pk_open_file.
* poke/pk-ios.c (pk_open_file): Likewise.
(pk_open_file): Pass set_cur_p to pk_ios_open.
* poke/pk-cmd-ios.c (pk_cmd_file): Reflect rename.
* poke/poke.c (parse_args_2): Use pk_ios_open instead of
pk_open_file.
2021-03-16 Thomas Weißschuh <thomas@t-8ch.de>
* etc/Makefile.am: Distribute Emacs syntax highlighting.
2021-03-16 Thomas Weißschuh <thomas@t-8ch.de>
* etc/vim/Makefile.am: Distribute vim syntax highlighting.
2021-03-15 Egeyar Bagcioglu <egeyar@gmail.com>
* .gitignore: Add /build /gl-libutils /doc/poke.text and tags
2021-03-15 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_convert_flags): New function.
(ios_dev_file_open): Open files with the right flags via "open".
2021-03-15 Egeyar Bagcioglu <egeyar@gmail.com>
* doc/poke.texi: Remove IOS_F_TRUNCATE.
* etc/poke-mode.el: Likewise.
* etc/poke.vim: Likewise.
* libpoke/ios-dev-file.c (ios_dev_file_open): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_open): Likewise.
* libpoke/libpoke.h: Likewise.
* libpoke/ios.h: Likewise.
* libpoke/pkl-rt.pk: Likewise.
2021-03-14 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* pickles/jffs2.pk (JFFS2_Dirent): Add initializer to `magic` field.
(JFFS2_XAttr): Likewise.
(JFFS2_XRef): Likewise.
(JFFS2_Summary): Likewise.
(JFFS2_Unk_Node): Likewise.
(JFFS2_Inode): Add initializer to `magic`, `compr` and `usercompr`
fields.
2021-03-14 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* doc/learn-poke-language-in-y-minutes.pk: Add a new example of
using both constraints and initializers in fields.
2021-03-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (struct_type_field): Adapt to
struct_type_field_constraint_and_init.
(struct_type_field_constraint_and_init): Rename from
struct_type_field_constraint_or_init.
* doc/poke.texi (Field Initializers): Document that both
initializers and constructors are valid.
* testsuite/poke.pkl/field-init-diag-3.pk: Remove test.
* testsuite/poke.pkl/field-init-9.pk: New test.
* testsuite/poke.pkl/field-init-10.pk: Likewise.
* testsuite/poke.pkl/field-init-11.pk: Likewise.
* testsuite/poke.pkl/field-init-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-03-13 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk: Round :size up to the next byte instead of
truncating.
* testsuite/poke.cmd/dump-9.pk (pk_dump_ascii): New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-03-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Use SSET instead of
SSETI for values mapped in non-strict mode.
* testsuite/poke.map/nsmap-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2021-03-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Handling Incorrect Data): New section.
2021-03-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Non-strict Mapping): Texinfo fix.
2021-03-12 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Writing Binary Utilities): New chapter.
(Poke Scripts): New section.
(Filters): Likewise.
(Command-Line Arguments): Likewise.
2021-03-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: define instruction `rev'.
* libpoke/pkl-asm.c (pkl_asm_insn_rev): New function.
(pkl_asm_insn): Support REV.
* libpoke/pkl-gen.c (pkl_gen_pr_print_stmt): Use the rev
macro-instruction.
(pkl_gen_pr_funcall): Likewise.
(pkl_gen_pr_func): Likewise.
2021-03-11 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_unitalicised_etc): Change rule so it is not triggered
by mentions to files in etc/.
* utils/pk-strings.in: Remove trailing whitespaces.
2021-03-10 Matt Ihlenfield <mtihlenfield@protonmail.com>
* etc/poke.vim: New vim syntax highlighter
* doc/poke.texi: Added chapter/section on poke.vim
2021-03-10 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-strings.in: New file.
* utils/Makefile.am: Rules for pk-strings.
2021-03-10 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-repl.c (banner): Avoid incomplete sentences in
translatable strings.
2021-03-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk: Do not raise an exception if HOME is not
defined in the environment.
2021-03-08 Matt Ihlenfield <mtihlenfield@protonmail.com>
* pickles/jffs2.pk: New pickle
* pickles/Makefile.am: Added new jffs2.pk to dist_pickles_DATA
2021-03-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Use
pkl_ast_type_mappable_p to decide which field types are valid.
* testsuite/poke.pkl/struct-types-diag-12.pk: New test.
* testsuite/poke.pkl/struct-types-diag-13.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-03-08 Jose E. Marchesi <jemarch@gnu.org>
* .x-sc_prohibit_path_max_allocation: New file.
2021-03-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-file.c (ios_dev_file_open): Handle `open' flags
better.
* poke/pk-save.pk (save): Adapt to new handling of flags in the
file IOD.
2021-03-07 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Struct Methods): Explain how methods have the
ability to break data integrity.
2021-03-07 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Check for recfix.
* cfg.mk (sc_recfix_poke_rec): New rule.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (check-DEJAGNU): `make check' now exits
with an error status if runtest fails.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_VAL_OFF_UNIT_GIGIBYTES): Avoid using a LU
suffix, fixing 32-bit.
(PVM_VAL_OFF_UNIT_GIGABYTES): Likewise.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_POWOP_SIGNED): Avoid using the L suffix,
fixing 32-bit.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_array): Avoid using size_t
variables, fixing 32-bit.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Set NBDKIT to `no' if --disable-libnbd is used.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_print_stmt): Fix error
message.
2021-03-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_PRINTL): make more portable.
(printlu): Adapt accordingly.
(printl): Likewise.
(PVM_PRINTI): Make more portable.
(printiu): Adapt accordingly.
(printi): Likewise.
2021-03-06 Indu Bhagat <indu.bhagat@oracle.com>
* pickles/Makefile.am: Add ctf-dump.pk to dist_pickles_DATA.
* pickles/ctf-dump.pk: New file.
2021-03-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Use pkl_asm_note
instead of pkl_asm_insn (...PKL_INSN_NOTE).
2021-03-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-env.c (pvm_env_register): Fix for 32-bit hosts.
2021-03-05 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Mapping Functions): New section.
(Programming Emacs Modes): New chapter.
(poke-mode): New section.
(ras-mode): Likewise.
(poke-map-mode): Likewise.
2021-03-04 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Strings are not Arrays): New section.
2021-03-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Getting Started): New section.
2021-03-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-set.c (pk_cmd_set_oacutoff): Fix error message.
(pk_cmd_set_obase): Likewise.
(pk_cmd_set_endian): Likewise.
(pk_cmd_set_nenc): Likewise.
(pk_cmd_set_auto_map): Likewise.
(pk_cmd_set_prompt_maps): Likewise.
(pk_cmd_set_pretty_print): Likewise.
(pk_cmd_set_odepth): Likewise.
(pk_cmd_set_oindent): Likewise.
(pk_cmd_set_omaps): Likewise.
(pk_cmd_set_omode): Likewise.
* poke/pk-cmd-ios.c (pk_cmd_file): Likewise.
* poke/pk-repl.c (banner): Likewise.
2021-03-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (ains): Raise E_inval with a more informative
message.
(map): Likewise.
(reloc): Likewise.
(ureloc): Likewise.
2021-03-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Padding and Alignment): New section.
2021-03-01 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Maintainers): Add Mohammadd-Reza Nabipoor as
the maintainer for doc/learn-poke-language-in-y-minutes.pk.
2021-03-01 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* doc/learn-poke-language-in-y-minutes.pk: New file.
* doc/Makefile.am (EXTRA_DIST): Update.
2021-02-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (CASE_INTEGRAL): Emit a compilation error
for INTEGRAL/OFFSET and INTEGRAL/^OFFSET.
* testsuite/poke.pkl/div-integers-diag-2.pk: New test.
* testsuite/poke.pkl/cdiv-integers-diag-2.pk: Likewise.
* testsuite/poke.pkl/mod-integers-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-28 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.time/time32.pk: Do not use host endianness in the
test.
2021-02-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (MOSTLYCLEANFILES): handle removal of files
created by AX_CREATE_PKGCONFIG_INFO at make distclean.
2021-02-28 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* poke/pk-cmd-map.c (SET_TO_CUR_IOS_ID): Add new macro to find the
current IOS id.
(pk_cmd_map_create): Use `SET_TO_CUR_IOS_ID` macro.
(pk_cmd_map_remove): Likewise.
(pk_cmd_map_show): Likewise.
(pk_cmd_map_entry_add): Likewise.
(pk_cmd_map_entry_remove): Likewise.
(pk_cmd_map_load): Likewise.
(pk_cmd_info_maps): Likewise.
2021-02-27 Sergei Trofimovich <slyfox@gentoo.org>
* pickles/Makefile.am (dist_pickles_DATA): Package rest of *.pk files
to tarball: mcr.pk dwarf-expr.pk dwarf-info.pk id3v2.pk.
2021-02-27 Egeyar Bagcioglu <egeyar@gmail.com>
* doc/poke.texi (close): Mention the exception, E_ios.
* libpoke/ios-dev-file.c (ios_dev_file_close): Handle errors properly.
Return IOD_ERROR on failure, IOD_OK otherwise.
* libpoke/ios-dev-mem.c (ios_dev_mem_close): Return IOD_OK.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_close): Likewise.
* libpoke/ios-dev-stream.c (ios_dev_stream_close): Likewise.
* libpoke/ios-dev.h (close): Return IOD_ERROR on failure, IOD_OK on
success.
* libpoke/ios.c (ios_close): Return IOS_OK on success and the error code on
failure. Do not assert that dev_if->close is successful.
* libpoke/ios.h (ios_close): Likewise.
* libpoke/pvm.jitter (close): Raise PVM_E_NO_IOS if the IO space to be
closed does not exist. Raise PVM_E_IO if ios_close fails.
* pk-cmd-ios.c (pk_cmd_close): Replace "file" with "IO space".
* testsuite/Makefile.am: Add new testcase.
* testsuite/poke.pkl/close-diag-1.pk: New testcase.
2021-02-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c (pk_val_offset): Return PK_NULL if the given
value is not mapped.
* testsuite/poke.libpoke/values.c (test_simple_values): Check that
pk_val_offset returns PK_NULL for simple values.
2021-02-27 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map-tab.y (tagged_value_list): Fix error messages.
(check_entry_duplicated_tags): Likewise.
(pk_map_printf_error): Make static.
2021-02-27 Morten Linderud <morten@linderud.pw>
* poke/poke.pk: Fix setting of map_load_path when XDG_DATA_HOME is
set.
2021-02-27 Jose E. Marchesi <jemarch@gnu.org>
* m4/ax_create_pkgconfig_info.m4: Import file from autoconf
archive.
2021-02-27 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Backporting to maintenance branches): New
section.
* HACKING: Regenerate.
* DEV-NEWS: Update.
2021-02-27 Sergei Trofimovich <slyfox@gentoo.org>
* doc/poke.texi (Describe-Compute): fix example and wording.
2021-02-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-file.c (ios_dev_file_open): Avoid accessing to
an uninitialized variable.
2021-02-27 Thomas Weißschuh <thomas@t-8ch.de>
* configure.ac: Call AX_CREATE_PKGCONFIG_INFO.
* libpoke/Makefile.am (dist_pkgconfig_lib_DATA): Distribute
poke.pc.
* .gitignore: Update.
2021-02-26 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_handler_normalize): Take error
as an argument rather than having it as return value.
(ios_dev_file_open): Likewise.
* libpoke/ios-dev-mem.c (ios_dev_mem_handler_normalize): Likewise.
(ios_dev_mem_open): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_handler_normalize): Likewise.
(ios_dev_nbd_open): Likewise.
* libpoke/ios-dev-stream.c (ios_dev_stream_handler_normalize):
Likewise.
(ios_dev_stream_open): Likewise.
* libpoke/ios-dev.h (handler_normalize): Likewise.
(open): Likewise.
(IOS_FILE_HANDLER_NORMALIZE): Rename newhandler as new_handler.
* ios.c (ios_open): Adjust calls to handler_normalize and open.
2021-02-26 Jose E. Marchesi <jemarch@gnu.org>
* etc/Makefile.am (EXTRA_DIST): Distribute etc/poke.rec.
2021-02-26 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update version number to 1.0.
* NEWS: Update for 1.0.
* doc/gendocs_template: Likewise.
2021-02-25 Indu Bhagat <indu.bhagat@oracle.com>
* pickles/ctf.pk (ctf_kind_str): Add string for slice.
(CTF_Dictionary): New type.
(CTF_Preamble): Add _print function.
(CTF_Header): Likewise.
(ctf_get_header): Rename to ctf_get_dict.
2021-02-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-map.c (pk_cmd_map_save): Show a "not implemented
message".
* poke/pk-cmd.c (pk_cmd_exec_1): Invoke commands even if glob
fails.
* poke/pk-cmd-misc.c (pk_cmd_exit): Remove spurious code.
2021-02-25 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Standard Units): Update to reflect std.pk.
2021-02-24 Egeyar Bagcioglu <egeyar@gmail.com>
* poke/pk-cmd-ios.c (pk_cmd_close): Replace "The current file is now
`%s'.\n" with "The current IOS is now `%s'.\n" for correctness and
consistency.
2021-02-24 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-stream.c (ios_dev_stream_pread): Change internal
implementation.
2021-02-24 Jose E. Marchesi <jemarch@gnu.org>
* doc/gendocs_template: Use our own gendocs.sh template.
2021-02-24 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Structured Integers): New section.
2021-02-24 Indu Bhagat <indu.bhagat@oracle.com>
* utils/pk-elfextractor.in: use get_section_name instead of get_string.
2021-02-24 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Maps and Map-files): New chapter.
(Editing using Variables): New section.
(poke Maps): Likewise.
(Loading Maps): Likewise.
(Multiple Maps): Likewise.
(Auto-map): Likewise.
(Constructing Maps): Likewise.
(Predefined Maps): Likewise.
2021-02-23 Indu Bhagat <indu.bhagat@oracle.com>
* doc/poke.texi: fix minor typos.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Print version even with no hand.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Change version to 0.91.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (lookup_color_code): Define only #if
HAVE_TEXTSTYLE_ACCESSORS_SUPPORT.
(register_color): Likewise.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Fix detection of overflow in signed integer
literals.
* testsuite/poke.pkl/cdiv-integers-overflow-2.pk: Update test.
* testsuite/poke.pkl/neg-int-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/neg-int-overflow-2.pk: Likewise.
* testsuite/poke.pkl/mod-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-diag-1.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-2.pk: Likewise.
* testsuite/poke.libpoke/pk_equal_uint.test: Likewise.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (poke-tmpdir): New procedure.
* testsuite/poke.repl/repl.exp: Do not rely on Tcl 8.6.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-data): Avoid using the unportable
printf %q.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* AUTHORS: Add Indu.
* etc/hacking.org: Add Indu to the write-after-approval list.
* HACKING: Regenerate.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_POWOP_SIGNED): Define.
(powi): Use PVM_POWOP_SIGNED.
(powl): Likewise.
* testsuite/poke.pkl/pow-integers-overflow-1.pk: New test.
* testsuite/poke.pkl/pow-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/pow-integers-3.pk: Update test.
* testsuite/poke.pkl/pow-offsets-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_UNARY_II): Detect overflow constant
folding negation.
* libpoke/pvm.jitter (PVM_NEG_SIGNED): Define.
(negi): Use PVM_NEG_SIGNED.
(negl): Likewise.
* testsuite/poke.pkl/neg-int-overflow-diag-1.pk: New test.
* testsuite/poke.pkl/neg-int-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/neg-int-overflow-1.pk: Likewise.
* testsuite/poke.pkl/neg-int-overflow-2.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-3.pk: Update test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_III): Detect overflow constant
folding signed remainder.
* libpoke/pvm.jitter (PVM_MOD_SIGNED): Define.
(modi): Use PVM_MOD_SIGNED.
(modl): Likewise.
* testsuite/poke.pkl/mod-integers-overflow-diag-1.pk: New test.
* testsuite/poke.pkl/mod-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/mod-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/mod-integers-overflow-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_MUL_SIGNED): Simplify a bit.
(PVM_DIV_SIGNED): Likewise.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_III): Error while constant folding
signed division and ceil-division if the operation would result in
overflow.
* libpoke/pvm.jitter (PVM_DIV_SIGNED): Define.
(divi): Use PVM_DIV_SIGNED.
(divl): Likewise.
* testsuite/poke.pkl/div-integers-overflow-diag-1.pk: New test.
* testsuite/poke.pkl/div-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-overflow-diag-1.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/div-integers-overflow-3.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-overflow-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>w
* libpoke/pkl-fold.c (OP_BINARY_III): Error while constant folding
signed multiplication if the operation would result in overflow.
* libpoke/pvm.jitter (PVM_SUB_SIGNED): Define.
(muli): Use PVM_SUB_SIGNED.
(mull): Likewise.
* libpoke/std.pk (atoi): Avoid overflow.
* testsuite/poke.std/std-test.pk: Update test.
* testsuite/poke.pkl/mul-integers-overflow-diag-1.pk: New test.
* testsuite/poke.pkl/mul-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/mul-integers-overflow-diag-3.pk: Likewise.
* testsuite/poke.pkl/mul-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/mul-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/mul-integers-overflow-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_III): Error while constant folding
signed subtraction if the operation would result in overflow.
* libpoke/pkl-lex.l: Fix promotion of constants to 64-bit.
* libpoke/pvm.jitter (PVM_SUB_SIGNED): Define.
(subi): Use PVM_SUB_SIGNED.
(subl): Likewise.
* testsuite/poke.pkl/sub-integers-overflow-diag-1.pk: New test.
* testsuite/poke.pkl/sub-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-diag-3.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-1.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/sub-integers-overflow-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_III): Error on overflow on certain
signed arithmetic operations.
* libpoke/pvm.jitter (PVM_ADD_SIGNED): Define.
(addi): Use PVM_ADD_SIGNED.
(addl): Likewise.
* testsuite/poke.pkl/add-integers-overflow-1.pk: New test.
* testsuite/poke.pkl/add-integers-overflow-2.pk: Likewise.
* testsuite/poke.pkl/add-integers-overflow-3.pk: Likewise.
* testsuite/poke.pkl/add-integers-overflow-4.pk: Likewise.
* testsuite/poke.pkl/add-integers-overflow-5.pk: Likewise.
* testsuite/poke.pkl/add-integers-overflow-diag-1.pk: Likewise.
* testsuite/poke.pkl/add-integers-overflow-diag-2.pk: Likewise.
* testsuite/poke.pkl/add-integers-overflow-diag-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-promo.c (promote_node): Make sure to set `restart'
in any case.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (entry_name_to_varname): Use PRIu64 instead of %lu
in printf format string.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Fix --disable-feature In optional features that
use PKG_CHECK_MODULES.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Invoke gl_HOST_CPU_C_ABI_32BIT and ac_define the
corresponding cpp macro.
* libpoke/pkl-asm.c (pkl_asm_insn): Use POKE_HOST_32BIT instead of
the undocumented and unportable __WORDSIZE.
(pkl_asm_note): Likewise.
* libpoke/pvm-program.c (pvm_program_append_push_instruction):
Likewise.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Add intprops.
(gui_modules): Add alloca.
(gnulib_modules): Add host-cpu-c-abi.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (EC_overflow): Define.
(E_overflow): Likewise.
* libpoke/pvm.h (PVM_E_OVERFLOW): Define.
(PVM_E_OVERFLOW_MSG): Likewise.
(PVM_E_OVERFLOW_ESTATUS): Likewise.
* doc/poke.texi (Exceptions): Document E_overflow.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Add the free-posix module.
2021-02-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk: Do not assume HOME is defined in the environment.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-misc.c (quit_cmd): Define.
* poke/pk-cmd.c (dot_cmds): Add quit_cmd.
* doc/poke.texi (quit command): New section.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org: Add David Faust to the write after approval
list.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (buildreq): Fix indentation.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (crc32): Avoid too long lines.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Invoking poke): Leave empty lines between
argument descriptions, and add missing arguments.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Print the poke hand
conditionally.
(parse_args_2): Do not print the poke hand in the --version
output.
* poke/pk-repl.c (banner): DO print the poke hand as part of the
poke banner :)
* poke/pk-cmd-misc.c (pk_cmd_version): Likewise.
2021-02-21 Indu Bhagat <indu.bhagat@oracle.com>
Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-save.pk (save): Fix invocation to copy.
* testsuite/poke.cmd/save-2.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-02-21 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am (update-hacking): New maintenance rule to regenerate
HACKING from etc/hacking.org.
* HACKING: Update.
* DEV-NEWS: Update.
2021-02-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (.pks.pkc): Fix typo in command.
2021-02-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk: Fix typo in comment
.
2021-02-20 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (print_help): Use a puts statement for each header
and option, and do not finish them with periods.
* poke/pk-cmd-ios.c (pk_cmd_load_file): Use pk_fatal and an
uniform message when out of memory.
(pk_cmd_mem): Likewise.
* poke/pk-map.c (entry_name_to_varname): Likewise.
* poke/poke.h (pk_assert_alloc): Likewise.
* libpoke/pkl-trans.c (pkl_trans1_ps_print_stmt): Start error
messages with a lower case.
2021-02-20 Jose E. Marchesi <jemarch@gnu.org>
* man/Makefile.am (poke.1): Avoid TAB-8-space indentation in
Makefile.
* libpoke/Makefile.am: Spell time-stamp.
* poke/Makefile.am: Likewise.
2021-02-20 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Set POKE_AWK and do not error out at configure
time if no suitable awk is found.
* libpoke/Makefile.am (.pks.pkc): Check that AWK is powerful
enough for RAS. Error out otherwise.
2021-02-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/poke.mi-json/mi-json.c (test_json_pk_sct): Remove unused
variable(s).
(test_val_to_json): Likewise.
(read_json_object): Change the type of `cap` to `ssize_t` to make the
compiler happy (-Wsign-compare).
2021-02-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pvm.jitter (PVM_PRINTI): Fix bit-depth of printed negative
values in base 8 and 16.
(PVM_PRINTL): Likewise.
* testsuite/poke.pkl/printf-28.pk: New test.
* testsuite/poke.pkl/printf-29.pk: Likewise.
* testsuite/poke.pkl/printf-30.pk: Likewise.
* testsuite/poke.pkl/printf-31.pk: Likewise.
* testsuite/poke.pkl/printf-32.pk: Likewise.
* testsuite/poke.pkl/printf-33.pk: Likewise.
* testsuite/poke.pkl/printf-34.pk: Likewise.
* testsuite/poke.pkl/printf-35.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-02-19 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf-frame.pk (Dwarf_CIE): Fix constant.
2021-02-19 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/poke.mi-json/mi-json.c (test_json_to_val_to_json):
Simplify the JSON file selection loop.
2021-02-16 Indu Bhagat <indu.bhagat@oracle.com>
* pickles/ctf.pk (CTF_Header): Use offset field type for cth_lbloff.
(CTF_Integer_Type): Use integral struct.
(CTF_Float_Type): Likewise.
(CTF_Slice): New definition.
(CTF_Type): CTF_KIND_ENUM is followed by a vlen number of enum records.
CTF_KIND_FUNCTION has a trailing padding of 4 bytes if the number of
function arguments is odd. Support CTF Slice.
(ctf_string): Use correct offset to the CTF string section.
2021-02-16 David Faust <david.faust@oracle.com>
* pickles/btf.pk (BTF_Int): Make `offset` and `bits` into offset types.
(BTF_Section): Properly use header type_off and str_off.
(btf_types): Remove now-redundant function.
(btf_strings): Likewise.
* pickles/btf-dump.pk (btf_dump_int): Account for above type changes.
2021-02-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ustar.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add ustar.pk.
2021-02-15 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update version to 0.90.
* NEWS: Adapt to 0.90.
2021-02-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (auto_map): Initialize to an empty array.
2021-02-15 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/ass-struct-int-5.pk: New test.
* testsuite/poke.pkl/ass-struct-int-6.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2021-02-14 Jose E. Marchesi <jose.marchesi@oracle.com>
* poke/poke.c (pk_print_version): Update copyright.
2021-02-14 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk: Fix typo for UNKNOWN.
2021-02-14 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (parse_args_2): -s doesn't imply that poke runs
non-interactively.
(main): Load user configuration file before handling -s arguments.
(parse_args_1): Handle NO_INIT_FILE_ARG here instead of
parse_args_2.
(parse_args_1): Likewise for QUIET_ARG.
2021-02-12 David Faust <david.faust@oracle.com>
* pickles/btf-dump.pk: New pickle.
* pickles/Makefile.am (dist_pickles_DATA): Add `btf-dump.pk`.
2021-02-12 David Faust <david.faust@oracle.com>
* pickles/btf.pk (BTF_Type) Make several fields `offset`s where
appropriate. Correct bitfield to use integral struct. Correct variable
data for BTF_KIND_STRUCT.
(BTF_Section) New type.
2021-02-08 David Faust <david.faust@oracle.com>
* libbpoke/pkl-anal.c: Forbid anonymous members in unions.
* pickles/btf.pk (type BTF_Type): Give name to anonymous union member.
* pickles/ctf.pk (type CTF_Type): Likewise.
* pickles/dwarf-expr.pk (type Dwarf_Op): Likewise.
* pickles/dwarf-frame.pk (type Dwarf_CFI): Likewise.
* testsuite/poke.pkl/union-diag-8.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-02-06 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-ios.c (pk_cmd_source_file): New function.
(source_cmd): Define.
* poke/pk-cmd.c (source_cmd): Define.
(dot_cmds): Add source_cmd.
* doc/poke.texi (source command): New section.
2021-02-06 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (print_help): --script to --source.
Rename SCRIPT_ARG to SOURCE_ARG.
(long_options): Likewise.
(parse_args_2): Update accordingly.
* doc/poke.texi (Invoking poke): Update accordingly.
2021-01-28 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* pickles/mbr.pk: New pickle.
* pickles/Makefile.am (dist_pickles_DATA): Add `mbr.pk`.
* testsuite/poke.pickles/mbr-test.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-01-28 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-gen.pks (struct_writer): Fix bit-offset of mapped
integral struct.
* testsuite/poke.map/maps-int-structs-21.pk: New test.
* testsuite/poke.map/maps-int-structs-22.pk: Likewise.
* testsuite/poke.map/maps-int-structs-23.pk: Likewise.
* testsuite/poke.map/maps-int-structs-24.pk: Likewise.
* testsuite/poke.map/maps-int-structs-25.pk: Likewise.
* testsuite/poke.map/maps-int-structs-26.pk: Likewise.
* testsuite/poke.map/maps-int-structs-27.pk: Likewise.
* testsuite/poke.map/maps-int-structs-28.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-01-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-env.c (get_registered): The empty string is never
recognized as the name of a registered declaration.
* libpoke/pkl-tab.y (struct_type_field): Register anonymous struct
fields in the lexical environment.
* testsuite/poke.map/maps-structs-anonfield-1.pk: New test.
* testsuite/poke.map/maps-structs-anonfield-2.pk: Likewise.
* testsuite/poke.map/maps-structs-anonfield-3.pk: Likewise.
* testsuite/poke.pkl/scons-anon-field-1.pk: Likewise.
* testsuite/poke.pkl/scons-anon-field-2.pk: Likewise.
* testsuite/poke.pkl/scons-anon-field-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2021-01-25 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-rt.pk (exception_code): New function.
* doc/poke.texi (Exceptions): Add documentation for `exception_code`.
2021-01-25 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/Makefile.am (check-DEJAGNU): Fix `make distcheck`
failure by removing the INPUTRC file after running the tests.
2021-01-24 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/Makefile.am (check-DEJAGNU): Set INPUTRC. Use custom
INPUTRC config file to explicitly disable bracketed paste mode in
readline library.
2021-01-03 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support nested integral structs): Do not schedule
for 1.0.
2021-01-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Motivation): New section.
(Dealing with Alternatives): Likewise.
(Offsets and Sizes): Likewise.
2021-01-01 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Debugging Poke Programs): Demote and relocate.
(Writing Pickles): Relocate.
2020-12-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (struct pk_color): New type.
(struct pk_term_if): Remove rgb_to_color_fn and modify get_(bg)color_fn
and set_(bg)color_fn to handle terminal colors.
* testsuite/poke.libpoke/term-if.h: Adapt to new API.
* poke/pk-term.c (lookup_color): New function.
* libpoke/pvm.jitter (pushoc): Adapt to new API.
(popoc): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Likewise.
* libpoke/pkl-insn.def: Remove the instruction rgbtoc.
* doc/poke.texi (Terminal Colors): Update to new semantics.
2020-12-31 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (dispose_active_classes): Remove unneeded
function.
(pk_term_shutdown): Use pop_active_class instead of
dispose_active_classes.
2020-12-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-term.c (pop_active_class): Return a status code.
(pk_term_end_class): Adapt to new interface.
2020-12-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (struct pk_term_if): Change end_class_fn
prototype to return an error code.
* poke/pk-term.c (pk_term_end_class): Likewise.
(dispose_active_classes): New function.
(push_active_class): Likewise.
(pop_active_class): Likewise.
(pk_term_class): Push the class.
(pk_term_end_class): Check for the class, then pop it.
* testsuite/poke.libpoke/term-if.h (pk_term_end_class): Likewise.
* libpoke/pvm.jitter (endsc): Raise an exception if the given
class is invalid.
* testsuite/poke.pkl/term-class-1.pk: New test.
* testsuite/poke.pkl/term-class-2.pk: Likewise.
* testsuite/poke.pkl/term-class-3.pk: Likewise.
* testsuite/poke.pkl/term-hl-1.pk: Likewise.
* testsuite/poke.pkl/term-hl-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_val_initialize): New function.
(string_value): New variable.
(void_type): Likewise.
(any_type): Likewise.
(pvm_make_string_type): Reuse unitary value.
(pvm_make_void_type): Likewise.
(pvm_make_any_type): Likewise.
(pvm_val_finalize): Likewise.
2020-12-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (@:.vm profile): New section.
2020-12-29 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Building with profiling support): New section.
* HACKING: Regenerate.
* DEV-NEWS: Update.
2020-12-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Prototype for pvm_ref_struct_cstr.
* libpoke/pvm-val.c (pvm_ref_struct_cstr): New function.
(pvm_ref_struct): Rewrite to use pvm_ref_struct_cstr.
* libpoke/pvm.jitter (PVM_RAISE_DIRECT): Use pvm_ref_struct_cstr.
(pushe): Likewise.
2020-12-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Store exception structs in the exceptions
stack and not pointers.
2020-12-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_MAKE_LONG): Define.
(PVM_MAKE_ULONG): Likewise.
(PVM_MAKE_LONG_ULONG): Likewise.
* libpoke/pvm-val.c (pvm_make_long_ulong): Remove function.
* libpoke/pvm.jitter: Use macros instead of functions to create
values.
2020-12-28 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Handle --enable-pvm-profiling.
* libpoke/pvm.c (pvm_print_profile): New function.
(pvm_reset_profile): Likewise.
* libpoke/libpoke.c (pk_print_profile): Likewise.
(pk_reset_profile): Likewise.
* poke/pk-cmd-vm.c (vm_profile_cmds): Define.
(vm_profile_cmd): Likewise.
(vm_cmds): Add vm_profile_cmd.
(vm_profile_show_cmd): Define.
(vm_profile_reset_cmd): Likewise.
(pk_cmd_vm_profile_show): New function.
(pk_cmd_vm_profile_reset): Likewise.
* poke/pk-cmd.c (pk_cmd_init): Initialize vm_disas_trie.
(pk_cmd_shutdown): Dispose of vm_profile_trie.
2020-12-25 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Struct Attributes): New section.
2020-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (offset_printer): Fix printing unnammed
units.
* testsuite/poke.pkl/printf-27.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal1_ps_decl): Clarify error message.
* testsuite/poke.pkl/struct-method-diag-6.pk: Adapt.
2020-12-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-promo.c (promote_node): New function.
(pkl_promo_ps_op_div): Use promote_node.
(pkl_promo_ps_op_binary_intoffstrarr): Likewise.
(pkl_promo_ps_op_bconc): Likewise.
(pkl_promo_ps_op_mul): Likewise.
(pkl_promo_ps_return_stmt): Likewise.
(pkl_promo_ps_func_arg): Likewise.
(pkl_promo_ps_print_stmt): Likewise.
(pkl_promo_ps_funcall): Likewise.
(pkl_promo_ps_op_binary): Likewise.
(pkl_promo_ps_ass_stmt): Likewise.
(pkl_promo_ps_struct_type_field): Likewise.
(pkl_promo_ps_op_in): Likewise.
2020-12-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Define poke_interactive_p in the compiler.
* libpoke/pkl.c (pvm_type_to_ast_type): Fix integral types.
* etc/poke.rec (Make poke_interactive_p available to Poke
programs): Remove as done.
2020-12-22 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org (Building after a git pull): New section.
* HACKING: Regenerate.
* DEV-NEWS: Add note.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_MAKE_INT): Define.
(PVM_MAKE_UINT): Likewise.
* libpoke/pvm-val.c (pvm_make_int): Use macro.
(pvm_make_uint): Likewise.
* libpoke/pvm.jitter: Use the macros instead of the functions.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk: Reduce the size of the hserver tokens table,
since they now expire.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c: Define NO_HSERVER_ARG.
(initialize): Honor poke_no_hserver_arg to initialize
poke_hserver_p.
(print_help): Help for --no-hserver.
* poke/pk-cmd-ios.c (print_info_ios): Do not emit hyperlinks if
the hserver is not enabled.
* testsuite/lib/poke-dg.exp (poke-dg-test): Do not run the hserver
when testing.
* testsuite/lib/poke-pk.exp (tap_execute): Likewise.
* testsuite/lib/poke.exp (poke_start): Likewise.
* etc/poke.rec (Add command-line option to disable the hserver):
Remove as done.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_cur_token): Define.
(hserver_get_token): Use a simpler schema to allocate tokens, and
expire them if needed.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_token_kind): New function.
(hserver_make_hyperlink): Initialize the token's kind.
(hserver_make_hyperlink): Do not include the command kind in the
hyperlink url.
* poke/pk-hserver.c (pk_hserver_token_kind): New function.
(read_from_client): Do not get the kind of the token from the URL.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_get_token): Improve the token
allocation algorithm.
(hserver_make_hyperlink): Do not include the command in the
hyperlink URL.
(hserver_token_cmd): New function.
(hserver_token_p): Likewise.
* poke/pk-hserver.c (pk_hserver_cmd): New function.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Acknowledge struct
labels.
* testsuite/poke.pkl/scons-label-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_func): Emit a `note' instruction
with the function name only if the function actually has a name.
2020-12-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_print_stmt): use
pkl_ast_type_promoteable_p.
* libpoke/pkl-ast.c (pkl_ast_type_promoteable_p): VOID can't be
promoted to anything.
* testsuite/poke.pkl/printf-diag-18.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-20 Luca Saiu <positron@gnu.org>
* libpoke/pvm.jitter (r): Change the number of fast
registers, enable slow registers.
2020-12-20 Luca Saiu <positron@gnu.org>
* libpoke/pvm.jitter (vm): Remove stack specifications...
(s, t, x): ...And add them back to their new sections.
(r): Adapt to new syntax.
These changes adapt poke to Jitter's new syntax.
2020-12-20 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk (hserver_print_hl): New function.
2020-12-20 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-hserver.pk: New file.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-hserver.pk.
* poke/pk-hserver.c (pk_hserver_init): Load pk-hserver.pk.
(pk_hserver_port): Get the value of the port from the poke value.
Turn pk_hserver_port and pk_hserver_tokens into pk values.
(pk_hserver_get_token): Rewrite to use the hserver_get_token.
(pk_hserver_token): New function.
(pk_hserver_make_hyperlink): Rewrite to call the Poke code.
(pk_hserver_start): Rename from pk_hserver_init.
2020-12-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Prototype for pk_decl_set_val.
* libpoke/libpoke.c (pk_decl_set_val): New function.
2020-12-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (struct_type_specifier): Fix the unit of
OFFSET.
2020-12-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (ltos): New function.
* doc/poke.texi (ltos): New section.
* testsuite/poke.std/std-test.pk: Test for ltos.
2020-12-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (reverse): New function.
* testsuite/poke.std/std-test.pk: Tests for `reverse'.
* doc/poke.texi (Array Functions): New section.
(reverse): New subsection.
* testsuite/lib/poke-pk.exp (tap_execute): Do not style output
when running pktests.
2020-12-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_indexer): Make sure to traverse
entity and index in normal context, as assignments can be nested
via post/pre incr/decr expressions.
* testsuite/poke.pkl/ass-10.pk: New test.
* testsuite/poke.pkl/ass-11.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-18 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* poke/poke.c (parse_args_2): Go to `exit_failure` when
`pk_compile_file` fails.
2020-12-17 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pickles/color-test.pk: Fix typo.
2020-12-17 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/lib/poke-pk.exp: New file.
* testsuite/poke.pickles/pickles.exp: Likewise.
* testsuite/poke.pickles/argp-test.pk: New unit test.
* testsuite/poke.pickles/color-test.pk: Likewise.
* testsuite/poke.pickles/id3v1-test.pk: Likewise.
* testsuite/poke.pickles/rgb24-test.pk: Likewise.
* testsuite/poke.std/std-test.pk: Likewise.
* testsuite/poke.std/std.exp: Re-write to use `poke-pk.exp`.
* testsuite/poke.argp/: Remove test directory.
* testsuite/poke.color/: Likewise.
* testsuite/poke.id3v1/: Likewise.
* testsuite/poke.rgb24/: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests, remove old ones.
2020-12-17 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* pickles/pktest.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add `pktest.pk`.
* testsuite/poke.pktest/pktest.exp: New file.
* testsuite/poke.pktest/pktest-1.pk: Likewise.
* testsuite/poke.pktest/pktest-2.pk: Likewise.
* testsuite/poke.pktest/pktest-3.pk: Likewise.
* testsuite/poke.pktest/pktest-4.pk: Likewise.
* testsuite/poke.pktest/pktest-5.pk: Likewise.
* testsuite/poke.pktest/pktest-6.pk: Likewise.
* testsuite/poke.pktest/pktest-7.pk: Likewise.
* testsuite/poke.pktest/pktest-8.pk: Likewise.
* testsuite/poke.pktest/pktest-9.pk: Likewise.
* testsuite/poke.pktest/pktest-10.pk: Likewise.
* testsuite/poke.pktest/pktest-11.pk: Likewise.
* testsuite/poke.pktest/pktest-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* etc/hacking.org (Testing Pickles): Update.
* HACKING: Regenerate.
2020-12-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (struct pk_term_if): Change the prototype of
end_hyperlink_fn so it can communicate errors to the user.
* poke/pk-term.c (pk_term_end_hyperlink): Keep count of the
hyperlinks and return the proper status.
* libpoke/pvm.jitter (beghl): Adapt accordingly.
(endhl): Likewise.
* testsuite/poke.libpoke/term-if.h (pk_term_end_hyperlink): Adapt
to new interface.
2020-12-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Improve spelling in exception description.
2020-12-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_TERM_BEGIN_HYPERLINK):
Define.
(PKL_AST_BUILTIN_TERM_END_HYPERLINK): Likewise.
* libpoke/pkl-tab.y: Handle term_begin_hyperlink and
term_end_hyperlink builtins.
* libpoke/pkl-lex.l: Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for new
builtins.
* libpoke/pkl-rt.pk: New functions term_begin_hyperlink and
term_end_hyperlink.
2020-12-17 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Check whether libtextstyle provides accessor
functions.
* poke/pk-term.c (pk_term_set_bgcolor): Use new libtextstyle
interface to access the ostream_term of an ostream_styled_term.
(pk_term_set_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_get_color): Likewise.
(pk_term_rgb_to_color): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Fix code for builtin
term_rgb_to_color
2020-12-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_TERM_CLASS): Define.
(PKL_AST_BUILTIN_TERM_END_CLASS): Likewise.
* libpoke/pkl-lex.l: Handle tokens BUILTIN_TERM_CLASS and
BUILTIN_TERM_END_CLASS.
* libpoke/pkl-tab.y: Likewise.
* libpoke/pkl-rt.pk: Built-ins term_begin_class and
term_end_class.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for the
new builtins.
2020-12-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (TYPIFY_BIN): DIV and CEILDIV accept
arguments of different types.
(CASE_OFFSET): Handle OFFSET / INT configuration.
* libpoke/pkl-promo.c (pkl_promo_ps_op_div): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_op_div): Likewise.
(pkl_gen_ps_op_cdiv): Likewise.
* testsuite/poke.pkl/div-offset-int-1.pk: New test.
* testsuite/poke.pkl/div-offset-int-2.pk: Likewise.
* testsuite/poke.pkl/div-offset-int-3.pk: Likewise.
* testsuite/poke.pkl/cdiv-offset-int-1.pk: Likewise.
* testsuite/poke.pkl/cdiv-offset-int-2.pk: Likewise.
* testsuite/poke.pkl/cdiv-offset-int-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* doc/poke.texi (Offset Operations): Mention division of an offset
by an integer.
* etc/poke.rec (Support OFFSET / MAGNITUDE -> OFFSET): Remove as
done.
2020-12-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_bconc): Improve
diagnostics.
* testsuite/poke.pkl/bconc-diag-1.pk: New test.
* testsuite/poke.pkl/bconc-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (info_var_cmd): .info var -> .info variables.
(info_fun_cmd): .info fun -> .info functions.
* doc/poke.texi (info command): Document .info types.
2020-12-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-info.c (info_types_cmd): Likewise.
(info_cmds): Add info_types_cmd.
* poke/pk-cmd-def.c (info_types_cmd): Define.
(pk_cmd_info_types): New function.
(print_type_decl): Likewise.
* etc/poke.rec (Support the command `info types'): Remove as done.
2020-12-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.h: New file.
* poke/pk-table.c: Likewise.
* poke/*.c: Use pk-table to print tabulated data.
* testsuite/poke.cmd/*.pk: Update.
* etc/poke.rec (pk-table): Remove as done.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-table.h: New file.
* poke/pk-table.c: Likewise.
* poke/Makefile.am (poke_SOURCES): Add pk-table.c and pk-table.h.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (canary): Use JITTER_STATE_BACKING_FIELD.
(exit): Likewise.
(pushob): Likewise.
(popob): Likewise.
(pushom): Likewise.
(popom): Likewise.
(pushoo): Likewise.
(popoo): Likewise.
(pushoi): Likewise.
(popoi): Likewise.
(pushod): Likewise.
(popod): Likewise.
(pushoac): Likewise.
(popoac): Likewise.
(pushopp): Likewise.
(popopp): Likewise.
(strace): Likewise.
(exit): Likewise.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Define PKL_INSN_BEGINHL and
PKL_INSN_ENDHL.
* libpoke/pvm.jitter (beghl): New instruction.
(endhl): Likewise.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (poke_term_if): Register color-related handlers in
the terminal interface.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_TERM_GET_COLOR): Define.
(PKL_AST_BUILTIN_TERM_SET_COLOR): Likewise.
(PKL_AST_BUILTIN_TERM_GET_BGCOLOR): Likewise.
(PKL_AST_BUILTIN_TERM_SET_BGCOLOR): Likewise.
(PKL_AST_BUILTIN_TERM_RGB_TO_COLOR): Likewise.
* libpoke/pkl-tab.y: Tokens for new builtins.
(builtin): Rules for new builtins.
* libpoke/pkl-lex.l: Handle new built-ins.
* libpoke/pkl-rt.pk (term_get_color): New builtin.
(term_set_color): Likewise.
(term_get_color): Likewise.
(term_set_bgcolor): Likewise.
(term_get_bgcolor): Likewise.
(term_rgb_to_color): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for
terminal color related builtins.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Define PKL_INSN_RGBTOC, PKL_INSN_PUSHOC,
PKL_INSN_POPOC, PKL_INSN_PUSHOBC and PKL_INSN_POPOBC.
* libpoke/pvm.jitter (rgbtoc): New instruction.
(pushoc): Likewise.
(popoc): Likeiwise.
(pushobc): Likewise.
(popobc): Likewise.
* libpoke/pkt.h (pk_term_rgb_to_color): Define.
(pk_term_get_color): Likewise.
(pk_term_set_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_set_bgcolor): Likewise.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (struct pk_term_if): New handlers get_color,
get_bgcolor, set_color, set_bgcolor and rgb_to_color.
* poke/pk-term.h: Prototypes for color handling functions.
* poke/pk-term.c (pk_term_rgb_to_color): New function.
(pk_term_get_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_set_color): Likewise.
(pk_term_set_bgcolor): Likewise.
* testsuite/poke.libpoke/term-if.h (pk_term_rgb_to_color): New
dummy function.
(pk_term_get_color): Likewise.
(pk_term_get_bgcolor): Likewise.
(pk_term_set_color): Likewise.
(pk_term_set_bgcolor): Likewise.
(poke_term_if): Install handlers.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
* pickles/id3v1.pk (ID3V1_Tag) <_print>: simplify.
2020-12-14 Jose E. Marchesi <jemarch@gnu.org>
BZ 26883
* libpoke/pkl-gen.c (pkl_gen_pr_print_stmt): Evaluate arguments
before printing anything.
* testsuite/poke.pkl/printf-26.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* etc/poke.rec (printf should evaluate arguments _before_ printing
anything): Removed as fixed.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (pk_dump_nonprintable_char): Define.
(print_ascii): use pk_dump_nonprintable_char.
* doc/poke.texi (Presentation options for @command{dump}):
Document pk_dump_nonprintable_char.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support for non-strict values): Removed as done.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_mapper): Set the strict attribute to
the mapped value.
(struct_mapper): Likewise.
* testsuite/poke.map/ass-map-17.pk: Check that the r-value of an
ass-map keeps the `strict' attribute.
* testsuite/poke.map/strict-attr-8.pk: New test.
* testsuite/poke.map/strict-attr-9.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-attrs.def: Define PKL_AST_ATTR_STRICT.
* libpoke/pkl-typify.c (pkl_typify1_ps_attr): Typify attribute
'strict.
* libpoke/pkl-gen.c (pkl_gen_ps_op_attr): Generate code for the
attribute 'strict.
* testsuite/poke.map/strict-attr-1.pk: New test.
* testsuite/poke.map/strict-attr-2.pk: Likewise.
* testsuite/poke.map/strict-attr-3.pk: Likewise.
* testsuite/poke.map/strict-attr-4.pk: Likewise.
* testsuite/poke.map/strict-attr-5.pk: Likewise.
* testsuite/poke.map/strict-attr-6.pk: Likewise.
* testsuite/poke.map/strict-attr-7.pk: Likewise.
* doc/poke.texi (Array Attributes): Document the 'strict
attribute.
(Non-strict Mapping): Mention the attribute.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/nsmap-1.pk: New test.
* testsuite/poke.map/nsmap-2.pk: Likewise.
* testsuite/poke.map/nsmap-3.pk: Likewise.
* testsuite/poke.map/nsmap-4.pk: Likewise.
* libpoke/pkl-ast.h (struct pkl_ast_map): New field `strict_p'.
(PKL_AST_MAP_STRICT_P): Define.
* libpoke/pkl-ast.c (pkl_ast_make_map): Get a new argument for
strict_p.
(pkl_ast_print_1): Print new attribute strict_p.
* libpoke/pkl-lex.l: Handle @! tokens.
* libpoke/pkl-tab.y (mapop): New rule.
(map): Support non-strict variants of the map operator.
* doc/poke.texi (Non-strict Mapping): Section draft.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (struct_type_specifier): Adjust lexical
environment accordingly.
* libpoke/pkl-gen.c (pkl_gen_ps_type_integral): Handle STRICT in
mapper context.
(pkl_gen_ps_type_array): Likewise.
(pkl_gen_ps_type_string): Likewise.
(pkl_gen_ps_type_struct): Likewise.
(pkl_gen_pr_type_function): Likewise.
(pkl_gen_pr_map): Specify strictness.
* libpoke/pkl-gen.pks (array_mapper): Get a STRICT argument.
(struct_mapper): Likewise.
(struct_field_mapper): Likewise.
(struct_field_extractor): Likewise.
(handle_struct_field_constraints): Likewise.
(struct_constructor): Adjust lexical environment to match
the one in struct_mapper.
* libpoke/pkl-asm.pks (remap): Pass strict to mapper.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Definitions for the mgets and msets
instructions.
* libpoke/pvm.jitter (mgets): New instruction.
(msets): Likewise.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (struct pvm_mapinfo): New field `strict_p'.
(PVM_MAPINFO_STRICT_P): Define.
(PVM_VAL_ARR_STRICT_P): Likewise.
(PVM_VAL_SCT_STRICT_P): Likewise.
(PVM_VAL_STRICT_P): Likewise.
(PVM_VAL_SET_STRICT_P): Likewise.
* libpoke/pvm-val.c (pvm_make_array): New array values are strict
by default.
(pvm_make_struct): Ditto for structs.
2020-12-13 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* poke/pk-mi.c: Add include `errno.h`.
(mi_loop): Ignore `EINTR` when `select` fails. It's not a fatal error.
* poke/pk-hserver.c (hserver_thread_worker): Likewise.
2020-12-13 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-promo.c (pkl_promo_ps_struct_type_field): Skip
promotion of initializer if it has the same type as the field.
* testsuite/poke.pkl/struct-types-7.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (struct pvm_mapinfo): New type.
(struct pvm_array): New fields mapinfo and mapinfo_back and remove
obsolete fields.
(struct pvm_struct): Likewise.
(PVM_VAL_ARR_MAPINFO): Define.
(PVM_VAL_ARR_MAPINFO_BACK): Likewise.
(PVM_MAPINFO_MAPPED_P): Likewise.
(PVM_MAPINFO_IOS): Likewise.
(PVM_MAPINFO_OFFSET): Likewise.
(PVM_VAL_SCT_MAPINFO): Likewise.
(PVM_VAL_SCT_MAPINFO_BACK): Likewise.
(pvm_mapinfo_null): Define.
* libpoke/pvm-val.c (pvm_make_array): Initialize the mapinfo.
(pvm_make_struct): Likewise.
(pvm_val_reloc): Adapt to mapinfo structures.
(pvm_val_ureloc): Likewise.
* testsuite/poke.map/ass-map-18.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/valmap-struct-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (srefo): New instruction.
* libpoke/pkl-insn.def: Define PKL_INSN_SREFO.
* libpoke/pvm-val.c (pvm_refo_struct): New function.
* libpoke/pvm-val.h: Prototype for pvm_refo_struct.
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Use srefo instead of
srefio.
(LMAP): Make sure the array type has a bounder.
* testsuite/poke.map/valmap-struct-2.pk: New test.
* testsuite/poke.map/valmap-struct-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-elfextractor.in: Add Emacs local variable for the
mode.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (`unmap' should be recursive): Removed as fixed.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
BZ 26897
* libpoke/pvm.h: Prototype for pvm_val_unmap.
* libpoke/pvm-val.c (pvm_val_unmap): New function.
* libpoke/pvm.jitter (unmap): Use pvm_val_unmap.
* testsuite/poke.map/unmap-2.pk: New test.
* testsuite/poke.map/unmap-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_ass_smtp): Support valmap
operations.
* testsuite/poke.map/valmap-array-1.pk: New test.
* testsuite/poke.map/valmap-struct-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Error on -0xffff_ffff_ffff_ffff.
* testsuite/poke.libpoke/values.c (testcase_pk_val_equal_p):
Finalize the pk compiler in case of an error.
* testsuite/poke.libpoke/pk_equal_uint.test: Update to not use the
invalid literal.
* testsuite/poke.libpoke/pk_nequal_uint.test: Likewise.
* testsuite/poke.pkl/integers-diag-2.pk: New test.
* testsuite/poke.pkl/integers-7.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (OP_BINARY_III): Fix signedness of
comparison.
* testsuite/poke.pkl/lt-integers-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Remove array bounders
after they are used.
* libpoke/pkl-gen.c (pkl_gen_pr_func_arg): Likewise.
(pkl_gen_pr_cast): Likewise.
* testsuite/poke.pkl/scons-64.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_func_arg): Traverse the argument
type in normal context.
(pkl_gen_pr_map): Traverse the map type in normal context.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_cast): Make a pre-order handler.
(pkl_gen_pr_type): Remove handler.
(pkl_phase_gen): Adjust accordingly.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_struct_type_field): Subpass on the
field type in normal context, avoiding generating a name.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_pr_type_struct): Likewise.
(pkl_gen_pr_type): Remove hack.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_offset): Handle in_mapper and
in_constructor and in_type.
(pkl_gen_ps_type_offset): Remove.
(pkl_phase_gen): Deregister pkl_gen_ps_type_offset.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.h (struct pkl_gen_payload): Remove field
generating_pvm_struct_type.
(PKL_GEN_CTX_GENERATING_PVM_STRUCT_TYPE): Remove.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Use the `in_type' context
to break the pass.
(pkl_gen_pr_type_struct): Do not handle generating_pvm_struct_type.
(pkl_gen_ps_type_struct): Likewise.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (PKL_GEN_DUP_CONTEXT): Renamed from
PKL_GEN_SAVE_CONTEXT.
(PKL_GEN_POP_CONTEXT): Renamed from PKL_GEN_RESTORE_CONTEXT.
* libpoke/pkl-gen.pks: Adapt to renames.
2020-12-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.h (PKL_GEN_CTX_IN_TYPE): Define.
* libpoke/pkl-gen.c (pkl_gen_ps_type_offset): Build offset type
only in `in_type' context.
(pkl_gen_ps_type_void): Likewise.
(pkl_gen_ps_type_any): Likewise.
(pkl_gen_ps_type_integral): Likewise.
(pkl_gen_ps_type_function): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_ps_type_string): Likewise.
(pkl_gen_pr_type_struct): Likewise.
(pkl_gen_ps_type_struct): Likewise.
(pkl_gen_pr_struct_type_field): Likewise.
(PKL_GEN_PUSH_CONTEXT): Define.
* libpoke/pkl-gen.pks (array_mapper): Set the `in_type' context
wherever appropriate.
(array_constructor): Likewise.
(struct_mapper): Likewise.
(struct_constructor): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_array): Likewise.
(pkl_gen_ps_struct): Likewise.
(pkl_gen_ps_cast): Likewise.
(pkl_gen_ps_isa): Likewise.
2020-12-10 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* pickles/color.pk: Use `assert` for integrity check.
* pickles/rgb24.pk: Likewise.
2020-12-07 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am (SUBDIRS): Add utils/.
* utils/Makefile.am: New file.
* utils/pk-elfextractor.in: Renamed from pk-elfextractor.
2020-12-06 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (eqa): Fix lexical context handling when the
comparison is false.
2020-12-05 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Programs): New chapter.
(argp): New section.
2020-12-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk (argp_parse): Support for --.
* testsuite/poke.argp/argp-11.pk: New test.
* testsuite/poke.argp/argp-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-12-04 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.argp/argp.exp: New file.
* testsuite/poke.argp/argp-1.pk: New test.
* testsuite/poke.argp/argp-2.pk: Likewise.
* testsuite/poke.argp/argp-3.pk: Likewise.
* testsuite/poke.argp/argp-4.pk: Likewise.
* testsuite/poke.argp/argp-5.pk: Likewise.
* testsuite/poke.argp/argp-6.pk: Likewise.
* testsuite/poke.argp/argp-7.pk: Likewise.
* testsuite/poke.argp/argp-8.pk: Likewise.
* testsuite/poke.argp/argp-9.pk: Likewise.
* testsuite/poke.argp/argp-10.pk: Likewise.
* testsuite/poke.argp/argp-diag-1.pk: Likewise.
* testsuite/poke.argp/argp-diag-2.pk: Likewise.
* testsuite/poke.argp/argp-diag-3.pk: Likewise.
* testsuite/poke.argp/argp-diag-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-12-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk (argp_do_version): New function.
(argp_parse): Add support for default --version.
2020-12-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk (argp_parse): Support proper arguments with = in
long options.
(argp_do_help): Adapt printing accordingly.
* .x-sc_prohibit_magic_number_exit: Add pickles/*.
2020-12-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk (argp_parse): Support specifying several short
options in a -FOO construction.
2020-12-04 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk (argp_do_help): New function.
(argp_parse): Support a default --help option.
2020-12-03 Jose E. Marchesi <jemarch@gnu.org>
* utils/pk-elfextractor: Rename from elfextractor.
2020-12-03 Jose E. Marchesi <jemarch@gnu.org>
* pickles/argp.pk: New file.
* pickles/Makefile.am (dist_pickles_DATA): Add argp.pk.
2020-11-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (PKL_GEN_IN_CTX_P): Likewise.
(PKL_GEN_SAVE_CONTEXT): Likewise.
(PKL_GEN_RESTORE_CONTEXT): Likewise.
(PKL_GEN_SET_CONTEXT): Likewise.
(PKL_GEN_CLEAR_CONTEXT): Likewise.
* libpoke/pkl-gen.h (PKL_GEN_CTX_IN_STRUCT_DECL): Define.
(PKL_GEN_CTX_IN_MAPPER): Likewise.
(PKL_GEN_CTX_IN_CONSTRUCTOR): Likewise.
(PKL_GEN_CTX_IN_WRITER): Likewise.
(PKL_GEN_CTX_IN_LVALUE): Likewise.
(PKL_GEN_CTX_IN_COMPARATOR): Likewise.
(PKL_GEN_CTX_IN_PRINTER): Likewise.
(PKL_GEN_CTX_IN_ARRAY_BOUNDER): Likewise.
(PKL_GEN_CTX_IN_METHOD_ARGUMENTS): Likewise.
(PKL_GEN_CTX_IN_FUNCALL): Likewise.
(PKL_GEN_CTX_GENEARTING_PVM_STRUCT_TYPE): Likewise.
(PKL_GEN_MAX_CTX): Likewise.
2020-11-30 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-def.c (print_var_decl): Use base_name instead of
basename.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev-file.c: Remove stale hidden attributes.
* libpoke/pkl-typify.c: Likewise.
* libpoke/pkl-trans.c: Likewise.
* libpoke/pkl-promo.c: Likewise.
* libpoke/pkl-gen.c: Likewise.
* libpoke/pkl-fold.c: Likewise.
* libpoke/pkl-anal.c: Likewise.
* libpoke/libpoke.c: Likewise.
* libpoke/ios-dev-stream.c: Likewise.
* libpoke/ios-dev-nbd.c: Likewise.
* libpoke/ios-dev-mem.c: Likewise.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_help): Do not use tabs to separate command
names from summary.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/sref-func-5.pk: Remove trailing whitespaces.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>,
BZ 26976
* libpoke/ios-buffer.c: Include stdlib.h instead of malloc.h
* libpoke/ios-dev-stream.c: Do not include malloc.h
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
BZ 26975
* bootstrap.conf (libpoke_modules): Import module `byteswap'.
* libpoke/ios.c: Include byteswap.h.
(ios_read_int_common): Use bswap_64 instead of __bswap_64.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Do not emit empty source lines in error
reporting): Removed as fixed.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (disas): New instruction.
* libpoke/pkl-insn.def: Define PKL_INSN_DISAS.
* libpoke/pkl-gen.c (pkl_gen_ps_struct_ref): Fix logic in
determining is_field_p when there are anonymous fields in a
struct.
* testsuite/poke.pkl/sref-func-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_STRACE): Define.
* libpoke/pkl-lex.l: Rule for __PKL_BUILTIN_STRACE__.
* libpoke/pkl-tab.y: Define BUILTIN_STRACE.
(builtin): Add rule for the `strace' builtin.
* libpoke/pkl-rt.pk (strace): Define function.
* libpoke/pkl-gen.c (PKL_PHASE_BEGIN_HANDLER): Implement body for
the `strace' builtin.
* doc/poke.texi (strace): New section.
* DEV-NEWS: Add entry.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-scrabble.pk: New file.
* poke/pk-cmd.pk: Load pk-scrabble.pk.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-scrabble.pk.
* doc/poke.texi (scrabble): New section.
* testsuite/poke.cmd/scrabble-1.pk: New test.
* testsuite/poke.cmd/scrabble-2.pk: Likewise.
* testsuite/poke.cmd/scrabble-3.pk: Likewise.
* testsuite/poke.cmd/scrabble-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (pkl_make_assertion): do not ignore the result
of ASTREF.
2020-11-29 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_printer): fix style class handling.
* testsuite/poke.pkl/printf-value-15.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-11-29 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-ast.h (ASTREF): Re-write the macro as inline function
with `always_inline` and `warn_unused_result` attributes.
(ASTDEREF): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Use return value of
`ASTREF`.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-promo.c (promote_integral): Likewise.
(promote_offset): Likewise.
(promote_array): Likewise.
(pkl_promo_ps_op_div): Likewise.
(pkl_promo_ps_op_rela): Likewise.
(pkl_promo_ps_type_array): Likewise.
(pkl_promo_ps_map): Likewise.
(pkl_promo_ps_struct_type_field): Likewise.
* libpoke/pkl-tab.y (offset_type_specifier): Likewise.
(struct_type_field): Likewise.
(stmt): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Likewise.
* libpoke/pkl-ast.c (pkl_ast_reverse): Use return value of `ASTDEREF`.
* etc/hacking.org (Memory Management): Update.
* HACKING: Regenerate.
2020-11-29 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/libpoke.h (pk_call): Remove `__attribute__ ((sentinel))`.
`sentinel` expects `NULL` but the API uses `PK_NULL`.
2020-11-28 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.h (struct pkl_gen_payload): New field
`in_file_p'.
* libpoke/pkl-gen.c (pkl_gen_pr_program): Initialize `in_file_p'.
(pkl_gen_ps_exp_stmt): Always drop the expression from the stack
if `in_file_p' is 1, i.e. if we are in a `load'.
* testsuite/poke.pkl/load-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_writer): Do not destroy the
in_constructor context.
(struct_integrator): Likewise.
* testsuite/poke.pkl/scons-int-struct-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support for multi-line strings with """): Removed
as not needed any longer.
(Support functions in struct fields): Removed as done.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_VAR_IS_PARENTHESIZED): Define.
(PKL_AST_STRUCT_REF_IS_PARENTHESIZED): Likewise.
(struct pkl_ast_var): Add field `is_parenthesized'.
(struct pkl_ast_struct_ref): Likewise.
* libpoke/pkl-tab.y (primary): Annotate array references as
parenthesized whenever appropriate.
* libpoke/pkl-trans.c (pkl_trans1_ps_var): Do not deprocedure if
the variable is parenthesized.
(pkl_trans2_ps_struct_ref): Likewise.
* testsuite/poke.pkl/funcall-17.pk: New test.
* testsuite/poke.pkl/struct-method-17.pk: LIkewise.
* doc/poke.texi (Calling Functions): Mention how parenthesized
function names do not deprocedure.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Chdr): New type.
(Elf64_Dyn): Likewise.
Define DT_* values.
* pickles/future/elf-future.pk: The future is now, so removed :)
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Note): New type.
* pickles/dwarf-frame.pk (Dwarf_CIE): Simplify calculation of
insn_size.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (struct_type_identifier): Register OFFSET.
* libpoke/pkl-gen.pks (struct_constructor): Add OFFSET and adjust
code accordingly.
(struct_mapper): Likewise.
(handle_struct_field_constraints): Likewise.
* testsuite/poke.pkl/scons-offset-4.pk: Likewise.
* testsuite/poke.map/map-struct-offset-5.pk: Likewise.
* testsuite/poke.map/map-struct-offset-4.pk: Likewise.
* testsuite/poke.pkl/scons-offset-diag-1.pk: Likewise.
* testsuite/poke.pkl/scons-offset-3.pk: Likewise.
* testsuite/poke.pkl/scons-offset-2.pk: Likewise.
* testsuite/poke.map/scons-offset-1.pk: Likewise.
* testsuite/poke.map/map-struct-offset-3.pk: Likewise.
* testsuite/poke.map/map-struct-offset-2.pk: Likewise.
* testsuite/poke.map/map-struct-offset-3.pk: Likewise.
* testsuite/poke.map/map-struct-offset-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* doc/poke.texi (The OFFSET variable): New section.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (alignto): New function.
* doc/poke.texi (Offset Functions): New section.
(alignto): Likewise.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf_Hash_Table): New type.
(Elf64_Note): Likewise.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (How Structs are Built): New section.
(Variables in Structs): Likewise.
(Functions in Structs): Likewise.
(Struct Methods): Likewise.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Remove obsolete
comment.
* libpoke/pkl-fold.c (pkl_fold_ps_cast): Likewise.
* libpoke/pkl-ast.c (pkl_ast_finish_breaks_1): Likewise.
(pkl_ast_lvalue_p): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_var): Likewise.
(pkl_gen_ps_var): Likewise.
(pkl_gen_pr_type_offset): Fix writer.
* libpoke/pkl-typify.c (pkl_typify2_ps_type): Remove unneeded
conditional.
* libpoke/pkl-ast.c (pkl_ast_type_is_complete): Handle `any' and
`void' types.
2020-11-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Define PKL_INSN_AREM.
* libpoke/pvm.jitter (ains): IDX argument is ulong, not long.
(arem): New instruction.
* libpoke/pvm.h: Prototype for pvm_array_rem.
* libpoke/pvm-val.c (pvm_array_rem): New function.
2020-11-26 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-lex.l: New token.
* libpoke/pkl-tab.y (simple_stmt): Add rules for assert expression.
(pkl_make_assertion): New function.
* libpoke/pkl-rt.pk (EC_assert): New error code.
(E_assert): New exception.
(_pkl_assert): New function.
* libpoke/pvm.h (PVM_E_ASSERT*): New exception.
* doc/poke.texi (assert): New section.
* testsuite/poke.pkl/assert-1.pk: New test.
* testsuite/poke.pkl/assert-2.pk: Likewise.
* testsuite/poke.pkl/assert-3.pk: Likewise.
* testsuite/poke.pkl/assert-4.pk: Likewise.
* testsuite/poke.pkl/assert-5.pk: Likewise.
* testsuite/poke.pkl/assert-diag-1.pk: Likewise.
* testsuite/poke.pkl/assert-diag-2.pk: Likewise.
* testsuite/poke.pkl/assert-diag-3.pk: Likewise.
* testsuite/poke.pkl/assert-diag-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (pvm_literal_printer_hi): Get a jitter print
context as first argument.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Object Formats): New chapter.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-env.c (register_decl): Change the names of
re-defined declarations to "" instead of removing the declaration
name identifier node.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (get_string): New method.
* pickles/ctf.pk (ctf_string): Use it.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ctf.pk: Adapt to new interface in elf.pk.
* maps/dwarf.map: Likewise.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
BZ 26891
* libpoke/pkl-ast.h (PKL_AST_SRC_FILENAME): Define.
(struct pkl_ast_src): New type.
(pkl_ast_make_src): New prototype.
(union pkl_ast_node): New field `src'.
* libpoke/pkl-ast.c (pkl_ast_make_src): New function.
(pkl_ast_node_free): Handle SRC AST nodes.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-tab.y (load): Add SRC nodes.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-anal.c (pkl_anal_pr_src): New handler.
(pkl_phase_anal1): Install handler.
(pkl_phase_anal2): Likewise.
(pkl_phase_analf): Likewise.
(pkl_anal2_ps_offset): Fix location of error message.
* libpoke/pkl-typify.c (pkl_typify_ps_src): New handler.
(pkl_phase_typify1): Install handler.
(pkl_phase_typify2): Likewise.
* libpoke/pkl-fold.c (pkl_fold_ps_src): New handler.
(pkl_phase_fold): Install handler.
* libpoke/pkl-trans.c (pkl_trans_ps_src): New handler.
(pkl_phase_trans1): Install handler.
(pkl_phase_trans2): Likewise.
(pkl_phase_trans3): Likewise.
(pkl_phase_trans4): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_src): New handler.
* libpoke/pkl-diag.c (pkl_detailed_location): Open the source file
for diagnostics, do not reuse the fp in the ast.
(pkl_print_filename): New function.
(pkl_error_internal): Use pkl_print_filename.
(pkl_warning): Likewise.
* etc/poke.rec (Source line is missing on in-type struct errors):
Remove as fixed.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (get_sections_by_name): Renamed from
get_section_by_name.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Fix indentation.
* pickles/elf.pk: Remove a couple of comments.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Sym): Make st_info and st_other integral
structs.
2020-11-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Group): Define.
(GRP_COMDAT): Likewise.
(GRP_MASKOS): Likewise.
(GRP_MASKPROC): Likewise.
(get_section_group): New method.
(get_group_signature): Likewise.
(get_group_signatures): Likewise.
(get_symbol_name): Likewise.
2020-11-25 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (pk_help_topics): New variable.
(pk_help_add_topic): New function.
* poke/pk-dump.pk: Add an entry to pk_help_topics.
* poke/pk-save.pk: Likewise.
* poke/pk-copy.pk: Likewise.
* poke/pk-extract.pk: Likewise.
* poke/pk-cmd-help.c (pk_cmd_help): Rewrite to use the Poke
infrastructure.
* poke/pk-cmd.c (pk_cmd_shutdown): Reflect changes in
pk-cmd-help.c.
2020-11-25 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/strings-5.pk: New test.
* testsuite/poke.pkl/string-multiline-diag-1.pk: Remove.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Integer Types): Fix formatting.
(if-else): Fix syntax of `if-else'.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (pk_help_str): Remove empty line between try and
catch.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_do_pass_1): Traverse the head of for
loops before the condition.
* poke/pk-copy.pk (pk_help_str): Use a `for' loop.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_finish_returns_1): Fix return drops
for `for' statements.
* pickles/id3v1.pk: Use a `for' loop.
* testsuite/poke.pkl/for-12.pk: New test.
* testsuite/poke.id3v1/id3v1-6.pk: Expand test to exercise the
set_genre method.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Rework grammar to allow comma-separated lists
of "simple" statements.
* libpoke/pkl-pass.c (pkl_do_pass_1): Traverse all the statements
in the tail.
* libpoke/pkl-gen.c (pkl_gen_pr_loop_stmt): Support several
statements in for loop.
* doc/poke.texi (for): Adjust accordingly.
* testsuite/poke.pkl/for-11.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Implement for-from-to-by loops): Removed as done.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (print_data): Use a `for' statement instead of a
`while' statement.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (simple_stmt): New rule.
(simple_stmt_opt): Likewise.
(simple_declaration): Likewise.
(stmt): Rules for FOR statement.
* libpoke/pkl-ast.h (PKL_AST_LOOP_STMT_TAIL): Define.
(PKL_AST_LOOP_STMT_DECL): Likewise.
(PKL_AST_LOOP_STMT_KIND_WHILE): Define.
(PKL_AST_LOOP_STMT_KIND_FOR): Likewise.
(PKL_AST_LOOP_STMT_KIND_FOR_IN): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_loop_stmt): Get `head' and
`tail' arguments.
* libpoke/pkl-pass.c (pkl_do_pass_1): subpass on new fields of
loop statements.
* libpoke/pkl-typify.c (pkl_typify1_loop_stmt): Handle lists of
conditions.
* libpoke/pkl-asm.c (PKL_ASM_ENV_FOR_LOOP): Define.
(pkl_asm_for): New function.
(pkl_asm_for_condition): Likewise.
(pkl_asm_for_loop): Likewise.
(pkl_asm_for_loop_tail): Likewise.
(pkl_asm_for_endloop): Likewise.
(pkl_asm_for_in): Renamed from pkl_asm_for.
(pkl_asm_for_in_where): Renamed from pkl_asm_for_where.
(pkl_asm_for_in_loop): Renamed from pkl_asm_for_loop.
(pkl_asm_for_in_endloop): Renamed from pkl_asm_for_in_endloop.
(PKL_ASM_ENV_FOR_IN_LOOP): Renamed form PKL_ASM_ENV_FOR_LOOP.
* testsuite/poke.pkl/for-diag-1.pk: New test.
* testsuite/poke.pkl/for-1.pk: Likewise.
* testsuite/poke.pkl/for-2.pk: Likewise.
* testsuite/poke.pkl/for-3.pk: Likewise.
* testsuite/poke.pkl/for-4.pk: Likewise.
* testsuite/poke.pkl/for-5.pk: Likewise.
* testsuite/poke.pkl/for-6.pk: Likewise.
* testsuite/poke.pkl/for-7.pk: Likewise.
* testsuite/poke.pkl/for-8.pk: Likewise.
* testsuite/poke.pkl/for-9.pk: Likewise.
* testsuite/poke.pkl/for-10.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* doc/poke.texi (for): New section.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support mapping and constructing functions):
Removed as done.
2020-11-24 Jose E. Marchesi <jemarch@gnu.org>
* jitter: submodule reference updated to v0.9.237.
* etc/poke-default.css: Rename pvm_* styling classes to pvm-*.
* libpoke/pvm-program.c (pvm_jitter_print_char): Add cast.
2020-11-24 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-ops.def: Remove unused definitions.
* libpoke/pkl-lex.l: New token: `POWA`.
* libpoke/pkl-tab.y: Use `POWA` in `ass_exp_op` rule.
* testsuite/poke.pkl/powa-int-1.pk: New test.
* testsuite/poke.pkl/powa-offset-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (ass_exp_op): New rule.
(stmt): Add rule for ass_exp statements.
* testsuite/poke.pkl/xora-offset-1.pk: Likewise.
* testsuite/poke.pkl/xora-int-1.pk: Likewise.
* testsuite/poke.pkl/iora-offset-1.pk: Likewise.
* testsuite/poke.pkl/iora-int-1.pk: Likewise.
* testsuite/poke.pkl/banda-offset-1.pk: Likewise.
* testsuite/poke.pkl/banda-int-1.pk: Likewise.
* testsuite/poke.pkl/rla-offset-1.pk: Likewise.
* testsuite/poke.pkl/rla-int-1.pk: Likewise.
* testsuite/poke.pkl/sla-offset-1.pk: Likewise.
* testsuite/poke.pkl/sla-int-1.pk: Likewise.
* testsuite/poke.pkl/suba-int-1.pk: Likewise.
* testsuite/poke.pkl/suba-offset-1.pk: Likewise.
* testsuite/poke.pkl/adda-int-1.pk: Likewise.
* testsuite/poke.pkl/adda-offset-1.pk: Likewise.
* testsuite/poke.pkl/adda-string-1.pk: Likewise.
* testsuite/poke.pkl/moda-offset-1.pk: Likewise.
* testsuite/poke.pkl/moda-int-1.pk: Likewise.
* testsuite/poke.pkl/diva-offset-diag-1.pk: Likewise.
* testsuite/poke.pkl/diva-int-1.pk: Likewise.
* testsuite/poke.pkl/mula-int-1.pk: New test.
* testsuite/poke.pkl/mula-offset-1.pk: Likewise.
* testsuite/poke.pkl/mula-string-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (pk_disassemble_function_val): New function.
* libpoke/libpoke.c (pk_disassemble_function_val): Likewise.
(pk_disassemble_function): Rewrite in terms of
disassemble_function_val.
* poke/pk-cmd-vm.c (pk_cmd_vm_disas_fun): Use
pk_disassemble_function_val.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-default.css: Add styling classes for PVM disassembly.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-program.h: Prototypes for pvm_program_init and
pvm_program_fini.
* libpoke/pvm-program.c (pvm_program_init): New function.
(pvm_program_fini): Likewise.
(pvm_disassemble_program): Adapt to new API.
(pvm_disassemble_program_nat): Likewise.
* libpoke/pvm.c (pvm_init): Call pvm_program_init.
(pvm_shutdown): Call pvm_program_fini.
* libpoke/pvm-program.c (pvm_jitter_print_char): New function.
(pvm_jitter_print_chars): Likewise.
* libpoke/pvm.jitter: Adapt printers to new API.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_tests_listed_in_makefile_am): Rewrite to detect
errors in both directions and be more efficient.
* etc/hacking.org (List the test files in testsuite/Makefile.am):
Update accordingly.
* HACKING: Regenerate.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_func): Avoid generating a
tor-fromr sequence in methods that do not get additional
arguments.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support for ++ and --): Removed as fixed.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap: Updated from latest gnulib.
* DEV-NEWS: Update.
* bootstrap.conf (bootstrap_option_hook): New function.
(bootstrap_print_option_usage_hook): Likewise.
(bootstrap_post_import_hook): Honor --jitter-srcdir.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: The INC and DEC operators are
non-associative.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Arithmetic Operators): Mention ++ and --.
(Offset Operations): Likewise.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_ORDER_PRE): Rename from PKL_AST_PRE.
(PKL_AST_ORDER_POST): Rename from PKL_AST_POST.
(PKL_AST_SIGN_INCR): Rename from PKL_AST_INCR.
(PKL_AST_SIGN_DECR): Rename from PKL_AST_DECR.
* libpoke/pkl-anal.c (pkl_analf_ps_incrdecr): Adapt accordingly.
* libpoke/pkl-typify.c (pkl_typify1_ps_incrdecr): Likewise.
* libpoke/pkl-tab.y: Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_incrdecr): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_incrdecr): Likewise.
2020-11-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (expression): Rules for pre{incr,decr}
expressions.
* testsuite/poke.pkl/preincr-1.pk: New test.
* testsuite/poke.pkl/predecr-offset-1.pk: Likewise.
* testsuite/poke.pkl/predecr-field-1.pk: Likewise.
* testsuite/poke.pkl/predecr-diag-2.pk: Likewise.
* testsuite/poke.pkl/predecr-diag-1.pk: Likewise.
* testsuite/poke.pkl/predecr-aelem-1.pk: Likewise.
* testsuite/poke.pkl/predecr-2.pk: Likewise.
* testsuite/poke.pkl/predecr-1.pk: Likewise.
* testsuite/poke.pkl/preincr-offset-1.pk: Likewise.
* testsuite/poke.pkl/preincr-field-1.pk: Likewise.
* testsuite/poke.pkl/preincr-diag-2.pk: Likewise.
* testsuite/poke.pkl/preincr-diag-1.pk: Likewise.
* testsuite/poke.pkl/preincr-aelem-1.pk: Likewise.
* testsuite/poke.pkl/preincr-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-22 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-dump.pk (dump): Use ++/-- wherever appropriate.
* pickles/color.pk (color_register): Likewise.
* pickles/id3v1.pk (id3v1_search_genre): Likewise.
* pickles/time.pk (ptime): Likewise.
2020-11-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (enum pkl_ast_code): Add PKL_AST_INCRDECR.
(struct pkl_ast_incrdecr): New type.
(PKL_AST_INCRDECR_ORDER): Define.
(PKL_AST_INCRDECR_SIGN): Likewise.
(PKL_AST_INCRDECR_EXP): Likewise.
(PKL_AST_INCRDECR_ASS_STMT): Likewise.
(PKL_AST_PRE): Likewise.
(PKL_AST_POST): Likewise.
(PKL_AST_INCR): Likewise.
(PKL_AST_DECR): Likewise.
(pkl_ast_make_incrdecr): New prototype.
(pkl_ast_type_incr_step): Likewise.
(union pkl_ast_node): New field incrdecr.
* libpoke/pkl-ast.c (pkl_ast_make_incrdecr): New function.
(pkl_ast_type_incr_step): Likewise.
(pkl_ast_node_free): Handle PKL_AST_INCRDECR nodes.
* libpoke/pkl-pass.c (pkl_do_pass_1): LIkewise.
* libpoke/pkl-tab.y (primary): syntax for INCRDECR.
* libpoke/pkl-typify.c (pkl_typify1_ps_incrdecr): New handler.
(pkl_phase_typify1): Register handler.
* libpoke/pkl-anal.c (pkl_analf_ps_incrdecr): New handler.
(pkl_phase_analf): Install handler.
* libpoke/pkl-trans.c (pkl_trans1_ps_incrdecr): New handler.
(pkl_phase_trans1): Install handler.
* libpoke/pkl-gen.c (pkl_gen_pr_incrdecr): New handler.
(pkl_phase_gen): Install handler.
* testsuite/poke.pkl/postincr-diag-1.pk: New test.
* testsuite/poke.pkl/postincr-diag-2.pk: Likewise.
* testsuite/poke.pkl/postincr-diag-3.pk: Likewise.
* testsuite/poke.pkl/postincr-diag-4.pk: Likewise.
* testsuite/poke.pkl/postincr-diag-5.pk: Likewise.
* testsuite/poke.pkl/postdecr-diag-1.pk: Likewise.
* testsuite/poke.pkl/postdecr-diag-2.pk: Likewise.
* testsuite/poke.pkl/postdecr-diag-3.pk: Likewise.
* testsuite/poke.pkl/postdecr-diag-4.pk: Likewise.
* testsuite/poke.pkl/postdecr-diag-5.pk: Likewise.
* testsuite/poke.pkl/postincr-1.pk: Likewise.
* testsuite/poke.pkl/postincr-2.pk: Likewise.
* testsuite/poke.pkl/postdecr-1.pk: Likewise.
* testsuite/poke.pkl/postdecr-2.pk: Likewise.
* testsuite/poke.pkl/postincr-offset-1.pk: Likewise.
* testsuite/poke.pkl/postincr-offset-2.pk: Likewise.
* testsuite/poke.pkl/postdecr-offset-1.pk: Likewise.
* testsuite/poke.pkl/postdecr-offset-2.pk: Likewise.
* testsuite/poke.pkl/postincr-aelem-1.pk: Likewise.
* testsuite/poke.pkl/postdecr-aelem-2.pk: Likewise.
* testsuite/poke.pkl/postdecr-field-1.pk: Likewise.
* testsuite/poke.pkl/postincr-field-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_printer): Print struct elements
offsets.
* libpoke/pvm.jitter: Fix typo in comment.
2020-11-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (printv): Remove.
* libpoke/pkl-insn.def: Remove definition of PKL_INSN_PRINTV.
* libpoke/pkl-asm.c (pkl_asm_insn_print): Do not use printv.
* libpoke/pkl-typify.c (pkl_typify1_ps_print_stmt): Do not admit
`any' values as arguments to printf.
* testsuite/poke.pkl/printf-diag-17.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_printer): Use the styling class
struct-field-name for struct field names.
2020-11-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal1_ps_var): Lift the restriction of
methods not being able to refer to variables and functions defined
in struct types.
* testsuite/poke.pkl/struct-method-diag-4.pk: Remove test.
* testsuite/poke.pkl/struct-method-diag-10.pk: Remove test.
* testsuite/poke.pkl/struct-method-diag-11.pk: Remove test.
* testsuite/poke.pkl/struct-method-diag-15.pk: Remove test.
* testsuite/poke.pkl/scons-62.pk: New test.
* testsuite/poke.pkl/scons-63.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add missing test.
* etc/hacking.org (List the test files in testsuite/Makefile.am):
Add recipe on how to get a list of test files missing from
testsuite/Makefile.am.
* HACKING: Regenerated.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* etc/hacking.org: New file.
* HACKING: Generated from hacking.org.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Remove non-existing tests
poke.pkl/arrays-14.pk, poke.map/arrays-14.pk and
poke.pkl/scons-diag-7.pk.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Remove non-existing test
acons-10.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/scons-61.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
* etc/poke.rec (Infamous constructor bug): Removed as fixed, yay.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_FUNC_PROGRAM): Define.
(struct pkl_ast_func): New field `program'.
* libpoke/pkl-ast.c (pkl_ast_make_func): Initialize field
`program'.
* libpoke/pkl-gen.c (pkl_gen_ps_decl): Move handling of function
declarations to the pre-order handler.
(pkl_gen_pr_decl): Handle function declarations, and do not
re-compile the initial if it is already compiled.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.libpoke/values.c (test_simple_values): Replace
strcmp with STREQ.
(STREQ): Define.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_struct_ref): Fix regression with
anonymous fields.
* testsuite/poke.pkl/sref-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (pretty-printer to pretty-printer calls dont work):
Removed as fixed.
(Exceptions raised in pretty-printers are not propagated):
Likewise.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (indent_if_tree): New macro.
(struct_printer): Acknowledge tree mode.
* libpoke/pkl-gen.c (pkl_gen_pr_print_stmt): Acknowledge mode and
depth from printf statements.
* libpoke/pvm.jitter: Fix stack handling of the popo*
instructions.
* testsuite/poke.pkl/printf-value-14.pk: Adapt test.
2020-11-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (indent): New instruction.
* libpoke/pkl-insn.def (PKL_INSN_INDENT): Define.
* libpoke/pkl-gen.c (pkl_gen_pr_print_stmt): Pass an initial depth
to the printer.
* libpoke/pkl-gen.pks (offset_printer): Handle a depth argument.
(string_printer): Likewise.
(array_printer): Likewise.
(struct_printer): Likewise.
(integral_printer): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_type_function): Likewise.
* testsuite/poke.pkl/printf-value-14.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (pushopp): New instruction.
(popopp): Likewise.
(srefnt): Likewise.
(tysctn): Likewise.
* libpoke/pkl-insn.def: Define PKL_INSN_PUSHOPP,
PKL_INSN_POPOPP, PKL_INSN_SREFMNT, PKL_INSN_TYSCTN.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Initialize struct
printer.
(pkl_ast_node_free): Deregister GC roots from the printer.
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_PRINTER): Define.
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Implement printer.
(pkl_gen_pr_print_stmt): Remove legacy code.
* libpoke/pkl-gen.pks (struct_printer): New function.
* testsuite/poke.pkl/struct-pretty-print-7.pk: New test.
* testsuite/poke.pkl/printf-value-13.pk: Likewise.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Support \" in RAS strings.
* libpoke/pkl-ast.h (PKL_AST_TYPE_A_PRINTER): Define.
(array): New field `printer' for arrays.
* libpoke/pkl-ast.c (pkl_ast_make_array_type): Initialize the
printer.
(pkl_ast_node_free): Remove GC roots for array printers.
* libpoke/pkl-gen.c (pkl_gen_pr_type_array): Implement printer.
(pkl_gen_pr_print_stmt): Subpass in the array type in printer
mode.
(pkl_gen_ps_type_string): Use the string_printer RAS macro.
* libpoke/pkl-gen.pks (array_printer): New function.
(string_printer): New macro.
(print_boffset): Likewise.
* testsuite/poke.pkl/printf-value-10.pk: New test.
* testsuite/poke.pkl/printf-value-11.pk: Likewise.
* testsuite/poke.pkl/printf-value-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Prototype for pvm_env_toplevel.
* libpoke/pvm-env.c (pvm_env_toplevel): New function.
* libpoke/pvm.jitter (pushtopvar): New instruction.
* libpoke/pkl-insn.def: Define PKL_INSN_PUSHTOPVAR.
* libpoke/pkl-asm.c (pkl_asm_call): Use the `pushtopvar'
instruction.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* common/pk-utils.c (pk_print_binary): Do not print prefixes.
* libpoke/pvm-val.c (pvm_print_val_1): Print prefix 0b before
calling pk_print_binary.
* testsuite/poke.map/maps-int-structs-11.pk: Adapt test
accordingly.
* testsuite/poke.map/maps-int-structs-6.pk: Likewise.
* testsuite/poke.pkl/printf-binary-1.pk: Likewise.
* testsuite/poke.pkl/printf-binary-2.pk: Likewise.
* testsuite/poke.pkl/printf-binary-3.pk: Likewise.
* testsuite/poke.pkl/printf-binary-4.pk: Likewise.
* testsuite/poke.pkl/cast-integers-11.pk: Likewise.
* testsuite/poke.pkl/cast-integers-10.pk: Likewise.
* testsuite/poke.pkl/printf-value-6.pk: Likewise.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Fix .call pseudo-op.
* libpoke/pkl-rt.pk (_pkl_unit_str): New function.
(_pkl_base_prefix): Likewise.
(_pkl_unit_bit): Define.
(_pkl_unit_nibble): Likewise.
(_pkl_unit_kilobit): Likewise.
(_pkl_unit_kilobyte): Likewise.
(_pkl_unit_megabit): Likewise.
(_pkl_unit_megabyte): Likewise.
(_pkl_unit_gigabit): Likewise.
(_pkl_unit_gigabyte): Likewise.
(_pkl_unit_kibibits): Likewise.
(_pkl_unit_kibibytes): Likewise.
(_pkl_unit_mebibits): Likewise.
(_pkl_unit_mebibytes): Likewise.
(_pkl_unit_gigibits): Likewise.
(_pkl_unit_gigibytes): Likewise.
* libpoke/pkl-gen.pks (print_int_suffix): Likewise.
(integral_printer): New macro.
(offset_printer): Likewise.
* libpoke/pkl-gen.c (pkl_gen_ps_type_integral): Generate code for
value printer.
(pkl_gen_pr_type_function): Likewise.
(pkl_gen_pr_type_offset): Likewise.
(pkl_gen_ps_type_string): Likewise.
(pkl_gen_pr_print_stmt): Subpass in printer for integral, offset,
string and function types.
* testsuite/poke.pkl/printf-value-1.pk: Adjust test.
* testsuite/poke.pkl/printf-value-2.pk: Likewise.
* testsuite/poke.pkl/printf-value-3.pk: Likewise.xo
* testsuite/poke.pkl/printf-value-6.pk: New test.
* testsuite/poke.pkl/printf-value-7.pk: Likewise.
* testsuite/poke.pkl/printf-value-8.pk: Likewise.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (PVM_PRINTI): Get a BASE argument.
(PVM_PRINTL): Likewise.
(printi): Get BASE from the stack.
(printiu): Likewise.
(printl): Likewise.
(printlu): Likewise.
* libpoke/pkl-insn.def: Change macro-instruction `print' to not
get the output base as an argument.
* libpoke/pkl-asm.c (pkl_asm_insn): Adapt accordingly.
(pkl_asm_insn_print): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_print_stmt): Adapt code generator
accordingly.
2020-11-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (pushob): New instruction.
(popob): Likewise.
(pushom): Likewise.
(popom): Likewise.
(pushoo): Likewise.
(popoo): Likewise.
(pushoi): Likewise.
(popoi): Likewise.
(pushod): Likewise.
(popod): Likewise.
(pushoac): Likewise.
(popoac): Likewise.
* libpoke/pkl-insn.def (PKL_INSN_PUSHOB): Define.
(PKL_INSN_POPOB): Likewise.
(PKL_INSN_PUSHOM): Likewise.
(PKL_INSN_POPOB): Likewise.
(PKL_INSN_PUSHOO): Likewise.
(PKL_INSN_POPOO): Likewise.
(PKL_INSN_PUSHOI): Likewise.
(PKL_INSN_POPOI): Likewise.
(PKL_INSN_PUSHOD): Likewise.
(PKL_INSN_POPOD): Likewise.
(PKL_INSN_PUSHOAC): Likewise.
(PKL_INSN_POPOAC): Likewise.
2020-11-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/libpoke.c (pk_compiler_new): Make sure all feilds of
`term_if` are non-NULL.
* libpoke/pk-val.c (pk_make_offset): Reject zero value for units.
* testsuite/poke.libpoke/values.c: Add include `assert.h`.
(test_simple_values): Add more tests to cover all simple data
types: signed/unsigned ints, strings and offsets.
* testsuite/poke.libpoke/api.c: New test file to unit test libpoke
public API.
* testsuite/poke.libpoke/Makefile.am: Add build rules for `api` test.
* testsuite/poke.libpoke/libpoke.exp: Add support for new `api`
executable.
2020-11-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* bootstrap.conf (gnu_modules): Add module `read-file`.
* testsuite/poke.libpoke/values.c: Add includes: `stdint.h`, `err.h`,
`read-file.h`.
(compile_initial_poke_code): Remove.
(compile_poke_expressions): Likewise.
(test_pk_val_equal_p): Refactored to use `asprintf` for string
manipulation. Use memory buffers instead of `FILE`s.
(test_pk_equal_file): Renamed to `testcase_pk_val_equal_p` with new
interface to deal with memory buffers instead of `FILE`s.
2020-11-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-lex.l (STRING): Fix regexp to escape backslash and
newline characters correctly.
* libpoke/pkl-trans.c (pkl_trans1_ps_string): Ignore `\<NEWLINE>`
escape sequence.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* testsuite/poke.pkl/string-diag-2.pk: New test.
* testsuite/poke.pkl/string-multiline-1.pk: Likewise.
* testsuite/poke.pkl/string-multiline-diag-1.pk: Likewise.
2020-11-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Prototype for pvm_call_closure.
* libpoke/pvm.c (pvm_call_closure): New function.
* libpoke/pvm-val.c (pvm_call_pretty_printer): Use
pvm_call_closure.
2020-11-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.c (pvm_initialize_state): New function.
(pvm_init): Use pvm_initialize_state.
* testsuite/poke.pkl/struct-pretty-print-6.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-11-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_type_is_complete): Function types are
always complete.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_type_field): Allow
function types in struct fields.
(pkl_typify1_ps_type): Determine completeness also in function
types.
* libpoke/pkl-asm.c (pkl_asm_insn_cmp): Support function values.
* testsuite/poke.pkl/offsets-13.pk: Likewise.
* testsuite/poke.pkl/scons-diag-7.pk: Likewise.
* testsuite/poke.pkl/scons-58.pk: New test.
* testsuite/poke.pkl/scons-59.pk: LIkewise.
* testsuite/poke.pkl/scons-60.pk: Likewise.
* testsuite/poke.pkl/sref-func-1.pk: New test.
* testsuite/poke.pkl/sref-func-2.pk: Likewise.
* testsuite/poke.pkl/sref-func-3.pk: Likewise.
* testsuite/poke.pkl/sref-func-4.pk: Likewise.
* testsuite/poke.map/map-struct-fun-1.pk: Likewise.
* testsuite/poke.map/map-struct-fun-2.pk: Likewise.
* testsuite/poke.map/map-struct-fun-3.pk: Likewise.
* etc/poke.rec (Support setting methods in struct constructors):
Remove as no longer needed.
(Support Poke IOS Translators): This no longer depends on other
tasks
2020-11-19 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Use gl_PROG_BISON instead of gl_BISON.
* libpoke/Makefile.am (libpoke_la_SOURCES): Replace pkl-tab.y with
pkl-tab.c.
(pkl-tab.h pkl-tab.c): New rule to invoke bison.
(BUILT_SOURCES): Declare pkl-tab.h and pkl-tab.c as built sources.
(EXTRA_DIST): Distribute pkl-tab.y.
(MOSTLYCLEANFILES): Add bison generated files.
* poke/Makefile.am (poke_SOURCES): Replace pk-map-tab.y with
pk-map-tab.c.
(BUILT_SOURCES): Add pk-map-tab.c.
(EXTRA_DIST): Add pk-map-tab.y
(pk-map-tab.h pk-map-tab.c): New rule to invoke bison.
(MOSTLYCLEANFILES): Add bison generated files.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Skip empty lines, and lines composed only by blank
characters, when reading the output of cpp.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/func-map-2.pk: Fix syntax in test.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_type_mappable_p): Function types are
now mappable.
* libpoke/pkl-typify.c (pkl_typify1_ps-attr): Function values
accept the 'size attribute.
* libpoke/pkl-gen.c (pkl_gen_pr_type_function): New handler.
(pkl_phase_gen): Install handler.
* testsuite/poke.pkl/attr-size-14.pk: Likewise.
* testsuite/poke.pkl/map-diag-1.pk: Remove.
* testsuite/poke.pkl/unmap-diag-1.pk: Likewise.
* testsuite/poke.map/func-map-1.pk: New test.
* testsuite/poke.map/func-map-2.pk: Likewise.
* testsuite/poke.map/func-map-3.pk: Likewise.
* testsuite/poke.map/func-map-4.pk: Likewise.
* testsuite/poke.map/func-map-5.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* doc/poke.texi (Function Attributes): New section.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Remove spaces before and after arguments
to accommodate some weird cpp implementations.
2020-11-18 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/libpoke.h (PK_ENOMEM): Define.
(PK_EEOF): Likewise.
(PK_EINVAL): Likewise.
(PK_IOS_OK): Remove.
(PK_IOS_ERROR): Likewise.
(PK_IOS_NOID): Define.
(pk_errno): New prototype.
(pk_compile_file): Use `PK_OK`/`PK_ERROR` for return value.
(pk_compile_buffer): Likewise.
(pk_compile_satement): Likewise.
(pk_compile_expression): Likewise.
(pk_load): Likewise.
(pk_defvar): Likewise.
(pk_call): Likewise.
(pk_ios_open): Use `PK_IOS_NOID` as invalid return value.
* libpoke/libpoke.c (struct pk_compiler): Add new field: `status`.
(PK_RETURN): Define.
(pk_errno): New function.
(pk_compile_file): Update `status` filed of `pk_compiler` and return
that.
(pk_compile_buffer): Likewise.
(pk_compile_statement): Likewise.
(pk_compile_expression): Likewise.
(pk_load): Likewise.
(pk_disassemble_function): Likewise.
(pk_disassemble_expression): Likewise.
(pk_defvar): Likewise.
(pk_call): Likewise.
(pk_set_quiet_p): Update `status` field of `pk_compiler`.
(pk_set_lexical_cuckolding_p): Likewise.
(pk_set_alien_toekn_fn): Likewise.
(pk_ios_cur): Likewise.
(pk_ios_set_cur): Likewise.
(pk_ios_search): Likewise.
(pk_ios_search_by_id): Likewise.
(pk_ios_close): Likewise.
(pk_ios_map): Likewise.
(pk_decl_map): Likewise.
(pk_decl_p): Likewise.
(pk_decl_val): Likewise.
(pk_obase): Likewise.
(pk_set_obase): Likewise.
(pk_oacutoff): Likewise.
(pk_set_oacutoff): Likewise.
(pk_odepth): Likewise.
(pk_set_odepth): Likewise.
(pk_oindent): Likewise.
(pk_set_oindent): Likewise.
(pk_omaps): Likewise.
(pk_set_omaps): Likewise.
(pk_omode): Likewise.
(pk_set_omode): Likewise.
(pk_error_on_warning): Likewise.
(pk_set_error_on_warning): Likewise.
(pk_endian): Likewise.
(pk_set_endian): Likewise.
(pk_nenc): Likewise.
(pk_set_nenc): Likewise.
(pk_pretty_print): Likewise.
(pk_set_pretty_print): Likewise.
(pk_print_val): Likewise.
(pk_ios_open): Update the `status` field of `pk_compiler`. Return
`PK_IOS_NOID` on failure.
* poke/pk-cmd-ios.c (pk_cmd_file): Use `PK_IOS_NOID` instead of
`PK_IOS_ERROR`.
* poke/pk-ios.c (pk_open_ios): Likewise.
(pk_cmd_mem): Likewise.
(pk_cmd_nbd): Likewise.
(pk_cmd_load_file): Check `pk_compile_file` against `PK_OK`.
* poke/pk-cmd.c (pk_cmd_exec): Check `pk_compile_buffer` and
`pk_compile_statement` against `PK_OK`.
* poke/pk-map.c (pk_map_load_parsed_map): Check `pk_compile_buffer`
and `pk_compile_expression` against `PK_OK`.
* poke/poke.c (parse_args_2): Check `pk_compile_file` against
`PK_OK`. Check `pk_open_ios` against `PK_IOS_NOID`.
* testsuite/poke.libpoke/values.c (compile_initial_poke_code): Use
`PK_OK`/`PK_ERROR` as return value. Check `pk_compile_expression`
against `PK_OK`.
* testsuite/poke.mi-json/mi-json.c (compile_poke_expression): Likewise.
(compile_initial_poke_code): Use `PK_OK`/`PK_ERROR` as return value.
(test_json_file): Check `pk_compile_expression` against `PK_OK`.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/redef-1.pk: Remove trailing whitespaces.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Building Release Tarballs): Remove obsolete comment
regarding stale files in testsuite/**.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-env.c (pkl_env_register): Adjust call to
register_decl accordingly.
(register_decl): Allow "redefining" variables, functions and
types.
* testsuite/poke.pkl/redef-1.pk: New test.
* testsuite/poke.pkl/redef-2.pk: Likewise.
* testsuite/poke.pkl/redef-3.pk: Likewise.
* testsuite/poke.pkl/redef-diag-1.pk: Likewise.
* testsuite/poke.pkl/redef-diag-2.pk: Likewise.
* testsuite/poke.pkl/redef-diag-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* etc/poke.rec (Allow re-definitions of variables and units at the
top-level): Remove as done.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Allow re-definitions of variables and units at the
top-level): New entry.
(Factorize promotion of expressions in promo): Likewise.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Support mapping functions): New task.
(Support functions in struct fields): Likewise.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_CONS_KIND_STRING): Remove.
* libpoke/pkl-typify.c (pkl_typify1_ps_cons): Remove string
constructor stuff.
* libpoke/pkl-anal.c (pkl_anal1_ps_cons): Likewise.
* libpoke/pkl-tab.y (expression): Likewise.
* testsuite/poke.pkl/strcons-diag-1.pk: Revove test.
* testsuite/poke.pkl/strcons-diag-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update accordingly.
* testsuite/poke.pkl/acons-diag-6.pk: Update error message.
* testsuite/poke.pkl/acons-diag-7.pk: Update error message.
2020-11-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_continue_stmt): Fix typo.
* libpoke/pkl-ast.c (pkl_ast_finish_breaks_1): Take into account
lexical frames introduced by the "catch" block when it gets an
argument.
* testsuite/poke.pkl/continue-for-3.pk: New test.
* testsuite/Makefile.am: Add new test.
2020-11-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Syntax for string constructors.
* libpoke/pkl-ast.h (PKL_AST_CONS_KIND_STRING): Define.
(PKL_AST_CONS_KIND_UNKNOWN): Likewise.
* libpoke/pkl-ast.c (pkl_ast_make_cons): Accep string kind in
constructors.
(pkl_ast_chain_length): New function.
(pkl_typify1_ps_cons): Handle string constructors.
* libpoke/pkl-anal.c (pkl_anal1_ps_cons): New handler.
(pkl_phase_anal1): Install handler.
* testsuite/poke.pkl/acons-diag-6.pk: Adapt to new error messages.
* testsuite/poke.pkl/acons-diag-7.pk: Adapt to new error messages.
* testsuite/poke.pkl/acons-diag-8.pk: Likewise.
* testsuite/poke.pkl/acons-diag-9.pk: New test.
* testsuite/poke.pkl/strcons-diag-1.pk: New test.
* testsuite/poke.pkl/strcons-diag-2.pk: Likewise.
* testsuite/Makefile.am: Add new tests.
2020-11-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Unify acons and scons AST nodes.
* libpoke/pkl-ast.c: Likewise.
* libpoke/pkl-pass.c: Likewise.
* libpoke/pkl-tab.y: Likewise.
* libpoke/pkl-typify.c: Likewise.
* libpoke/pkl-promo.c: Likewise.
* libpoke/pkl-gen.c: Likewise.
2020-11-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (expression): Add rules for array
constructors.
(resolve_typename): New function.
* libpoke/pkl-ast.h (enum pkl_ast_code): New entry PKL_AST_ACONS.
(PKL_AST_ACONS_TYPE): Define.
(PKL_AST_ACONS_VALUE): Define.
(struct pkl_ast_acons): New struct.
(union pkl_ast_node): New field acons.
* libpoke/pkl-ast.c (pkl_ast_make_acons): New function.
(pkl_ast_node_free): Handle array constructors.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_acons): New handler.
(pkl_phase_typify1): Register handler.
* libpoke/pkl-promo.c (pkl_promo_ps_acons): New handler.
(pkl_phase_promo): Install handler.
* libpoke/pkl-gen.c (pkl_gen_ps_acons): New handler.
(pkl_phase_gen): Install handler.
* libpoke/pkl-insn.def: Define macro-instruction PKL_INSN_AFILL.
* libpoke/pkl-asm.c (pkl_asm_insn_afill): Define.
(pkl_asm_insn): Dispatch PKL_INSN_AFILL.
* libpoke/pkl-asm.pks (afill): New macro.
* testsuite/poke.pkl/acons-diag-1.pk: New test.
* testsuite/poke.pkl/acons-diag-2.pk: Likewise.
* testsuite/poke.pkl/acons-diag-3.pk: Likewise.
* testsuite/poke.pkl/acons-diag-4.pk: Likewise.
* testsuite/poke.pkl/acons-diag-5.pk: Likewise.
* testsuite/poke.pkl/acons-diag-6.pk: Likewise.
* testsuite/poke.pkl/acons-diag-7.pk: Likewise.
* testsuite/poke.pkl/acons-diag-8.pk: Likewise.
* testsuite/poke.pkl/acons-1.pk: Likewise.
* testsuite/poke.pkl/acons-2.pk: Likewise.
* testsuite/poke.pkl/acons-3.pk: Likewise.
* testsuite/poke.pkl/acons-4.pk: Likewise.
* testsuite/poke.pkl/acons-5.pk: Likewise.
* testsuite/poke.pkl/acons-6.pk: Likewise.
* testsuite/poke.pkl/acons-7.pk: Likewise.
* testsuite/poke.pkl/acons-8.pk: Likewise.
* testsuite/poke.pkl/acons-9.pk: Likewise.
* testsuite/poke.pkl/acons-10.pk: Likewise.
* testsuite/poke.pkl/acons-11.pk: Likewise.
* testsuite/poke.pkl/acons-12.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Array Constructors): New section.
* etc/poke.rec (Provide syntax for array constructors): Remove as
done.
2020-11-17 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Document "default values" in the poke manual): New
entry.
2020-11-16 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Assign to sref with data integrity): Remove as
done.
(Implement {beginning,end}-of-defun-function functions in
poke-mode): New entry.
(Implement add-log-current-defun-function in poke-mode): Likewise.
2020-11-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TRIMMER_ADDEND): Define.
(struct pkl_ast_trimmer): New field `addend'.
* libpoke/pkl-ast.c (pkl_ast_make_trimmer): Handle ADDEND.
(pkl_ast_node_free): Likewise.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-tab.y: New token RANGEA.
(primary): Rule for array trims based on +:.
* libpoke/pkl-lex.l: Handle RANGEA tokens.
* libpoke/pkl-gen.c (pkl_gen_pr_trimmer): Renamed from
pkl_gen_ps_trimmer, and adapted accordingly.
* libpoke/pkl-asm.pks (atrim): The TO boundaries in array trims
are now open.
* libpoke/pvm.jitter (substr): Likewise.
* testsuite/poke.map/maps-trims-1.pk: Adjust test accordingly.
* testsuite/poke.map/trimmed-map-2.pk: Likewise.
* testsuite/poke.map/trimmed-map-3.pk: Likewise.
* testsuite/poke.map/trimmed-map-4.pk: Likewise.
* testsuite/poke.pkl/getenv-1.pk: Likewise.
* testsuite/poke.pkl/strings-esc-2.pk: Likewise.
* testsuite/poke.pkl/trim-10.pk: Likewise.
* testsuite/poke.pkl/trim-11.pk: Likewise.
* testsuite/poke.pkl/trim-13.pk: Likewise.
* testsuite/poke.pkl/trim-15.pk: Likewise.
* testsuite/poke.pkl/trim-19.pk: Likewise.
* testsuite/poke.pkl/trim-20.pk: Likewise.
* testsuite/poke.pkl/trim-21.pk: Likewise.
* testsuite/poke.pkl/trim-22.pk: Likewise.
* testsuite/poke.pkl/trim-23.pk: Likewise.
* testsuite/poke.pkl/trim-25.pk: Likewise.
* testsuite/poke.pkl/trim-26.pk: Likewise.
* testsuite/poke.pkl/trim-27.pk: New test.
* testsuite/poke.pkl/trim-28.pk: Likewise.
* testsuite/poke.pkl/trim-29.pk: Likewise.
* testsuite/poke.pkl/trim-30.pk: Likewise.
* testsuite/poke.pkl/trim-31.pk: Likewise.
* testsuite/poke.pkl/trim-32.pk: Likewise.
* testsuite/poke.pkl/trim-33.pk: Likewise.
* testsuite/poke.pkl/trim-34.pk: Likewise.
* testsuite/poke.pkl/trim-35.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Modifying SBM Images): Update accordingly.
(Array Trimming): Likewise.
* etc/poke.rec (Use semi-open ranges in array trims): Removed as
done.
2020-11-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Ehdr): Initialize e_version to EV_CURRENT.
(EV_NONE): Define.
(EV_CURRENT): Likewise.
(EM_NONE): Likewise.
(EM_RISCV): Likewise.
(ET_NONE): Likewise.
(ET_REL): Likewise.
(ET_EXEC): Likewise.
(ET_DYN): Likewise.
(ET_CORE): Likewise.
2020-11-16 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-ras-mode.el (poke-ras-log-current-entity): New
function.
(poke-ras-mode): Add function to add-log hook.
2020-11-16 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Use semi-open ranges in array trims): New task.
2020-11-16 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/lib/poke.exp (verify_exit_status): New proc.
(verified_host_execute): Likewise.
* testsuite/poke.libpoke/libpoke.exp: Replace `host_execute` with
`verified_host_execute`.
* testsuite/poke.mi-json/mi-json.exp: Likewise.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-misc.c (pk_cmd_jmd): New quote.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (time): Use pvm_make_array.
* testsuite/poke.time/gettimeofday-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/scons-union-11.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Union constructors are not aware of field
coupling): This is fixed. Remove.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_scons): Union constructors
require exactly one field initializer.
* libpoke/pkl-gen.pks (struct_constructor): Implement new
semantics for union construction.
* testsuite/poke.pkl/scons-56.pk: Adjust test.
* testsuite/poke.pkl/scons-union-1.pk: Likewise.
* testsuite/poke.pkl/scons-union-2.pk: Likewise.
* testsuite/poke.pkl/scons-union-3.pk: LIkewise.
* testsuite/poke.pkl/scons-union-5.pk: Likewise.
* testsuite/poke.pkl/scons-union-6.pk: Likewise.
* testsuite/poke.pkl/scons-union-7.pk: Likewise.
* testsuite/poke.pkl/scons-union-8.pk: Likewise
* testsuite/poke.pkl/scons-union-2.pk: Likewise.
* testsuite/poke.pkl/scons-union-10.pk: New test.
* testsuite/poke.pkl/scons-union-diag-1.pk: New test.
* testsuite/poke.pkl/scons-union-9.pk: Likewise.
* testsuite/poke.pkl/ass-union-int-1.pk: Likewise.
* testsuite/poke.pkl/ass-union-int-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update tests.
* doc/poke.texi (Union Constructors): New section.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_make_struct): Initialize the bit-offset
of the struct to 0#B.
2020-11-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Fix pk_array_insert_elem prototype.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_make_array): Initialize the bit-offset of
the array to 0#B.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Union constructors are not aware of field
coupling): Add more details.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec (Union constructors are not aware of field
coupling): New bug.
* .x-sc_trailing_blank: Add etc/poke.rec
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks: Fix a couple of typos.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Define PKL_INSN_SSETI.
* libpoke/pkl-asm.c (pkl_asm_insn): Handle the SSETI
macro-instruction.
(pkl_asm_insn_sseti): New function.
* libpoke/pkl-asm.pks (sseti): New macro.
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Use sseti.
(pkl_gen_pr_type_struct): Make constructors install constructors
for their contained anonymous structs.
* testsuite/poke.pkl/ass-struct-int-1.pk: New test.
* testsuite/poke.pkl/ass-struct-int-2.pk: Likewise.
* testsuite/poke.map/ass-map-struct-int-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.rec: Renamed from POKE.
* DEV-NEWS: Updated to reflect new name.
* HACKING: Likewise.
* TODO: Likewise.
* .x-sc_prohibit_atoi_atof: Likewise.
* .x-sc_space_tab: Likewise.
2020-11-14 Bruno Haible <bruno@clisp.org>
Fix 'make dist' failure.
* testsuite/Makefile.am (EXTRA_DIST): Remove tests that were deleted
on 2020-11-11.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Remove trailing whitespaces.
* .x-sc_prohibit_atoi_atof: Add POKE.
* .x-sc_space_tab: Likewise.
* POKE: Remove repeated words.
2020-11-14 Jose E. Marchesi <jemarch@gnu.org>
* POKE: New file.
* DEV-NEWS: Mention POKE.
* HACKING (Deciding on What to Work on): Remove section.
(The POKE database): New section.
* TODO: Refer to POKE.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Correct docstring of function pvm_array_insert.
* libpoke/libpoke.h: Prototype for pk_array_insert_elem_val.
Remove pk_array_set_elem_boffset.
* libpoke/pk-val.c (pk_array_insert_elem_val): New function.
(pk_array_set_elem_boffset): Remove function.
* poke/pk-mi-json.c (pk_mi_json_to_array): Adapt to new array API
in libpoke.
* poke/poke.c (set_script_args): Likewise.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/struct-method-16.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Remove the rtpath argument from the
pk_compiler_new prototype.
* libpoke/libpoke.c (pk_compiler_new): Likewise.
* poke/poke.c (initialize): Adjust call to pk_compiler_new
accordingly.
* testsuite/poke.libpoke/values.c (test_pk_equal_file): Likewise.
* testsuite/poke.mi-json/mi-json.c (test_json_file): Likewise.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (enum pkl_ast_code): New entry
PKL_AST_CONTINUE_STMT.
(PKL_AST_CONTINUE_STMT_ENTITY): Define.
(PKL_AST_CONTINUE_STMT_NFRAMES): Likewise.
(struct pkl_ast_continue_stmt): Define.
Prototype for pkl_ast_make_continue_stmt.
(union pkl_ast_node): New field `continue_stmt'.
* libpoke/pkl-ast.c (pkl_ast_make_continue_stmt): Define.
(pkl_ast_node_free): Handle continue statements.
(pkl_ast_finish_breaks_1): Likewise.
(pkl_ast_finish_returns_1): Likewise.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-tab.y (stmt): Add continue statement.
* libpoke/pkl-lex.l: New token continue.
* libpoke/pkl-tab.y: Likewise.
* libpoke/pkl-pass.c (pkl_do_pass_1): Add case for
PKL_AST_CONTINUE_STMT.
* libpoke/pkl-anal.c (pkl_anal1_ps_continue_stmt): New handler.
(pkl_phase_anal1): Install handler.
* libpoke/pkl-gen.c (pkl_gen_ps_continue_stmt): New handler.
(pkl_phase_gen): Install handler.
* libpoke/pkl-asm.h: Prototype for pkl_asm_continue_label.
* libpoke/pkl-asm.c (struct pkl_asm_level): New field
`continue_label'.
(pkl_asm_loop): Set the continue label of the loop.
(pkl_asm_while): Likewise.
(pkl_asm_for): Likewise.
(pkl_asm_continue_label): New function.
* testsuite/poke.pkl/continue-diag-1.pk: New test.
* testsuite/poke.pkl/continue-for-1.pk: Likewise.
* testsuite/poke.pkl/continue-for-2.pk: Likewise.
* testsuite/poke.pkl/continue-while-1.pk: Likewise.
* testsuite/poke.pkl/continue-while-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (while): Document `continue' in while loops.
(for-in): Likewise.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (aset): Use pvm_array_set.
* libpoke/pvm-val.c (pvm_array_set): Fix recalculation of element
bit-offsets.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def: Remove definition of PKL_INSN_XMKA.
* libpoke/pvm.jitter (mka): Remove.
(xmka): Rename to mka.
* libpoke/pkl-asm.pks (aconc): Rename xmka to mka.
(atrim): Likewise.
* libpoke/pkl-gen.c (pkl_gen_pr_funcall): Likewise.
(pkl_gen_pr_array): Likewise.
* libpoke/pkl-gen.pks (array_mapper): Likewise.
(array_constructor): Likewise.
* libpoke/pvm.h: Remove prototype for xpvm_make_array.
* libpoke/pvm-val.c (pvm_make_array): Remove.
(xpvm_make_array): Rename to pvm_make_array.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_ASS_STMT_VALMAPPER_BACK): Remove.
(PKL_AST_ASS_STMT_VALMAPPER_OVER): Likewise.
(PKL_AST_ASS_STMT_VALMAPPER_P): Likewise.
(struct pkl_ast_ass_stmt): Remove fields `valmapper_back' and
`valmapper_over'.
* libpoke/pkl-gen.h (struct pkl_gen_payload): Remove field
`in_valmapper'.
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stml): Remove valmappers.
(pkl_gen_ps_type_offset): Likewise.
(pkl_gen_ps_type_integral): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_ps_type_string): Likewise.
* libpoke/pkl-gen.pks (array_valmapper): Remove.
* testsuite/poke.map/valmap-arrays.pk: Remove test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_funcall): Use new array schema.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (acat): New macro.
(aelems): Remove macro.
(aconc): Use the new array schema.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_constructor): Use new array schema.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_array_insert): Fix setting of elem
offsets.
* libpoke/pkl-gen.pks (array_mapper): Use new array schema.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_array_insert): Fix reallocation of
buffer.
* libpoke/pkl-asm.pks (atrim): Use new array schema.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_val_equal_p): Do not include mapper and
writer closures in the comparison criteria for arrays.
* testsuite/poke.libpoke/values.c (test_pk_equal_file): Print
details when a test fails.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c (pk_val_mapped_p): Update the criteria to
decide when a value is mapped.
* libpoke/libpoke.h (PK_PRINT_F_MAPS): Define.
(PK_PRINT_F_PPRINT): Likewise.
* libpoke/libpoke.c (pk_print_val_with_params): New function.
* testsuite/poke.mi-json/mi-json.c (test_json_file): Do not skip
array tests anymore.
2020-11-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/ass-map-17.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add test.
* doc/poke.texi (Assignments): Document that maps in l-value can
be of any type.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_array): Optimize.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (pk_cmd_exec_1): Support commas in string
arguments that are at the end of the argument list.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_array): Install a writer in arrays
built from literals.
* libpoke/pvm-val.c (pvm_val_reloc): Fix setting mapped_p in arrays.
* testsuite/poke.map/ass-map-12.pk: New test.
* testsuite/poke.map/ass-map-13.pk: Likewise.
* testsuite/poke.map/ass-map-14.pk: Likewise.
* testsuite/poke.map/ass-map-15.pk: Likewise.
* testsuite/poke.map/ass-map-16.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_sizeof): Closure values have size zero by
convention.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_val_reloc): Fix calculation of new
boffset for contained structs.
* testsuite/poke.map/ass-map-9.pk: New test.
* testsuite/poke.map/ass-map-10.pk: Likewise.
* testsuite/poke.map/ass-map-11.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_scons): Subpass on scons_type
instead of calling the constructor closure directly.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_VAL_ARR_MAPPED_P_BACK): Define
(PVM_VAL_SCT_MAPPED_P_BACK): Likewise.
(struct pvm_array): New field mapped_p_back;
(struct pvm_struct): Likewise.
* libpoke/pvm-val.c (pvm_make_array): Initialize mapped_p_back.
(pvm_make_struct): Likewise.
(pvm_val_reloc): Handle the mapped_p backups.
(pvm_val_ureloc): Restore the mapped_p attribute.
(pvm_val_reloc): Save the mapped_p attribute.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Install a writer in
newly-constructed struct values.
(pkl_gen_pr_type_array): Ditto for newly-constructed array values.
2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Prototype for pvm_val_ureloc.
* libpoke/pvm-val.c (pvm_make_array): Initialize ios_back and
offset_back.
(pvm_make_struct): Likewise, and also modified_back.
(pvm_val_ureloc): New function.
* libpoke/pvm-val.h (PVM_VAL_ARR_ELEM_OFFSET_BACK): Define.
(PVM_VAL_ARR_OFFSET_BACK): Likewise.
(PVM_VAL_ARR_IOS_BACK): Likewise.
(PVM_VAL_SCT_OFFSET_BACK): Likewise.
(PVM_VAL_SCT_FIELD_MODIFIED_BACK): Likewise.
(PVM_VAL_SCT_FIELD_OFFSET_BACK): Likewise.
(struct pvm_array): New fields offset_back and ios_back.
(struct pvm_array_elem): Likewise.
(struct pvm_struct): Likewise.
(struct pvm_struct_field): New fields modified_back and
offset_back.
* libpoke/pkl-insn.def: New instruction PKL_INSN_URELOC.
* libpoke/pvm.jitter (reloc): Change to new interface.
(ureloc): New instruction.
* libpoke/pkl-typify.c (pkl_typify1_ps_ass_stmt): Remove
restriction of simple types in lvalues.
* libpoke/pkl-gen.pks (complex_lmap): New macro.
* testsuite/poke.pkl/ass-map-diag-1.pk: Remove test.
* testsuite/poke.pkl/ass-map-diag-2.pk: Likewise.
* testsuite/poke.map/ass-map-7.pk: New test.
* testsuite/poke.map/ass-map-8.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def; Define PKL_INSN_RELOC.
* libpoke/pvm.jitter (reloc): New instruction.
* libpoke/pvm.h: Prototype for pk_val_reloc.
* libpoke/pk-val.c (pvm_val_reloc): New function.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans4_ps_array): Remove handler.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Prototype for pvm_array_set.
* libpoke/pvm-val.c (pvm_array_set): New function.
* libpoke/pvm-val.c (xpvm_make_array): New temporary function.
(pvm_array_insert): Update the number of elements in the array,
and update nallocated.
(pvm_sizeof): By convention closures have size zero.
* libpoke/pvm.jitter (xmka): Use xpvm_make_array.
(aset): Use pvm_array_set.
* libpoke/pkl-gen.c (pkl_gen_pr_array): Use the new array schema.
(pkl_gen_pr_array_initializer): Likewise.
(pkl_gen_ps_array_initializer): Likewise.
(pkl_gen_ps_array): Likewise.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (ains): New instruction.
(xmka): New temporary instruction.
* libpoke/pkl-insn.def: Define PKL_INSN_AINS and PKL_INSN_XMKA.
* libpoke/pvm.h: Prototype for pvm_array_insert.
* libpoke/pvm-val.h (PVM_VAL_ARR_ELEMS): Define.
* libpoke/pvm-val.c (pvm_array_insert): New function.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter: Remove instruction aseto.
* libpoke/pkl-insn.def: Likewise.
2020-11-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_VAL_ARR_NALLOCATED): Define.
(struct pvm_array): New field `nallocated'.
* libpoke/pvm-val.c (pvm_make_array): Initialize nallocated.
2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (mm,map,unmap): New instructions.
* libpoke/pkl-insn.def: Entries for new instructions.
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Likewise.
(pkl_gen_ps_op_unmap): Use the new unmap instruction.
(pkl_gen_ps_op_attr): Use `mm' to determine
whether a value is mapped or not.
* libpoke/pkl-asm.pks (remap): Use mm instead of mgetm.
(atrim): Likewise.
(write) Likewise.
* libpoke/pkl-gen.pks (array_mapper): Map the new value.
(array_valmapper): Likewise.
(struct_mapper): Likewise.
(array_constructor): Set bit-offset of the constructed array.
(struct_constructor): Likewise.
(struct_field_inserter): Adapt to the fact mgeto can't return null
any longer.
(op_unmap): Delete macro.
* libpoke/pvm-val.c (pvm_make_array): Make new arrays unmapped by
default.
(pvm_make_struct): Likewise for structs.
(pvm_print_val_1): Print element offsets in
mapped arrays and structs.
* libpoke/pvm-val.h (PVM_VAL_ARR_MAPPED_P): Define.
(struct pvm_array): New field `mapped_p'.
(PVM_VAL_SCT_MAPPED_P): Define.
(struct pvm_struct): New field `mapped_p'.
(PVM_VAL_MAPPED_P): Define.
(PVM_VAL_SET_MAPPED_P): Likewise.
* testsuite/poke.cmd/set-omaps-1.pk: Adapt.
2020-11-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (mktyv): New instruction.
* libpoke/pkl-insn.def: Define PKL_INSN_MKTYV.
* libpoke/pvm.h: Prototype for pvm_make_void_type.
* libpoke/pvm-val.c (pvm_make_void_type): New function.
(pvm_print_val_1): Handle PVM_TYPE_VOID.
(pvm_type_equal_p): Likewise.
* libpoke/pvm-val.h (enum pvm_type_code): Add PVM_TYPE_VOID.
* libpoke/pkl-gen.c (pkl_gen_ps_type_void): New handler.
(pkl_phase_gen): Install handler.
* testsuite/poke.pkl/arrays-14.pk: New test.
* testsuite/poke.pkl/arrays-15.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-10 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.c (pvm_print_val_1): Fix printing function
types.
2020-11-09 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Add modules timespec and
gettime.
* libpoke/pkl-insn.def (PKL_INSN_TIME): Define.
* libpoke/pvm.jitter (time): New instruction.
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_GET_TIME): Define.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Handle
PKL_AST_BUILTIN_GET_TIME.
* libpoke/pkl-lex.l: Handle __PKL_BUILTIN_GET_TIME__.
* libpoke/pkl-rt.pk (get_time): New function.
* libpoke/pkl-tab.y (builtin): Handle BUILTIN_GET_TIME.
* pickles/time.pk (gettimeofday): New function.
(Timespec): New type.
* doc/poke.texi (rand): Mention using get_time to seed the
pseudo-random numbers generator.
(Dates and Times): Update to mention Timespec and gettimeofday.
2020-11-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-insn.def (PKL_INSN_DUC): Define.
* libpoke/pvm.jitter (duc): New instruction.
* libpoke/pkl-gen.c (pkl_gen_ps_lambda): Duplicate the closure
value before installing the environment.
(pkl_gen_ps_decl): Likewise.
* testsuite/poke.pkl/defun-15.pk: New test.
* testsuite/poke.pkl/lambda-4.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_return_stmt): Do not pop
environment frames before RETURN, as it is not needed.
(pkl_gen_ps_func): Likewise.
2020-11-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_func): Do not leak a frame in the
dynamic lexical environment when raising no_return exception.
2020-11-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_func): Functions always introduce
a lexical environment for arguments even if they get none.
(pkl_gen_ps_return_stmt): Likewise.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Rename pkl_ast_type_promoteable to
pkl_ast_type_promoteable_p.
* libpoke/pkl-ast.c: Likewise.
* libpoke/pkl-typify.c: Likewise.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Rename pkl_ast_type_equal to
pkl_ast_type_equal_p.
* libpoke/pkl-ast.c (pkl_ast_type_equal_p): Likewise.
* libpoke/pkl-typify.c: Likewise.
* libpoke/pkl-promo.c: Likewise.
* libpoke/pkl-fold.c (pkl_fold_ps_cast): Likewise.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Support `lambda'.
* libpoke/pkl-tab.y (LABMDA): New token.
(primary): Support lambdas as primaries in expressions.
* libpoke/pkl-ast.h (enum pkl_ast_code): New value PKL_AST_LAMBDA.
(PKL_AST_LAMBDA_FUNCTION): Define.
(struct pkl_ast_lambda): Likewise.
(union pkl_ast_node): New field `lambda'.
(pkl_ast_make_lambda): New prototype.
* libpoke/pkl-ast.c (pkl_ast_make_lambda): New function.
(pkl_ast_node_free): Handle lambda AST nodes.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-pass.c (pkl_do_pass_1): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_lambda): New handler.
(pkl_phase_typify1): Register handler.
* libpoke/pkl-gen.c (pkl_gen_pr_lambda): New handler.
(pkl_gen_ps_lambda): Likewise.
(pkl_phase_gen): Register handlers.
* testsuite/poke.pkl/lambda-1.pk: New test.
* testsuite/poke.pkl/lambda-2.pk: Likewise.
* testsuite/poke.pkl/lambda-3.pk: Likewise.
* testsuite/poke.pkl/lambda-diag-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Lambdas): New section.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el (poke-font-lock-keywords): Remove unneeded
entry for strings, since they are font-locked via the syntax
table.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Do not include config.h as this is an
installed header.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el (poke-field-name): New face.
(poke-font-lock-keywords): Rule to highlight many field names.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
(poke-font-lock-keywords): Cover the case of chained declaration
lines with type constructors in them.
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el (poke-font-lock-keywords): Add additional rule
to cover chained declarations.
2020-11-07 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el (poke-builtin-types): Remove "offset".
(poke-type-constructor-integral): New face.
(poke-type-constructor-offset): Likewise.
(poke-declaration-name): Likewise.
(poke-font-lock-keywords): Font-lock string literals, integral
constructors, offset constructors and the names of declared
entities.
2020-11-07 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el (poke-smie-grammar): Indent chained
declarations for variables, types and units.
2020-11-07 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bmp.pk: Use chained declarations.
* pickles/bpf.pk: Likewise.
* pickles/btf.pk: Likewise.
* pickles/color.pk: Likewise.
* pickles/ctf.pk: Likewise.
* pickles/dwarf-expr.pk: Likewise.
* pickles/dwarf-frame.pk: Likewise.
* pickles/dwarf-info.pk: Likewise.
* pickles/elf.pk: Likewise.
* pickles/rgb24.pk: Likewise.
* pickles/time.pk (ptime): Likewise.
2020-11-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (defvar): New rule.
(defvar_list): Likewise.
(deftype): Likewise.
(deftype_list): Likewise.
(defunit): Likewise.
(defunit_list): Likewise.
* testsuite/poke.pkl/defunit-1.pk: Likewise.
* testsuite/poke.pkl/deftype-1.pk: Likewise.
* testsuite/poke.pkl/defvar-6.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* doc/poke.texi (Values and Variables): Mention chained variable
declarations.
(type): Document chained type declarations.
(Offset Units): Likewise for unit declarations.
2020-11-07 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Rename tokens def{var,type,fun,unit} to
{var,type,fun,unit}.
* libpoke/pkl-lex.l: Likewise.
* libpoke/pkl-rt.pk: Adjust accordingly.
* libpoke/std.pk: Likewise.
* poke/poke.pk: Likewise.
* poke/pk-copy.pk: Likewise.
* poke/pk-dump.pk: Likewise.
* poke/pk-extract.pk: Likewise.
* poke/pk-save.pk: Likewise.
* poke/pk-cmd.pk: Likewise.
* pickles/bmp.pk: Likewise.
* pickles/bpf.pk: Likewise.
* pickles/btf.pk: Likewise.
* pickles/color.pk: Likewise.
* pickles/ctf.pk: Likewise.
* pickles/dwarf-common.pk: Likewise.
* pickles/dwarf-expr.pk: Likewise.
* pickles/dwarf-frame.pk: Likewise.
* pickles/dwarf-info.pk: Likewise.
* pickles/dwarf-pubnames.pk: Likewise.
* pickles/dwarf-types.pk: Likewise.
* pickles/elf.pk: Likewise.
* pickles/id3v1.pk: Likewise.
* pickles/id3v2.pk: Likewise.
* pickles/leb128.pk: Likewise.
* pickles/rgb24.pk: Likewise.
* pickles/time.pk: Likewise.
* poke/pk-cmd.c (pk_cmd_exec): Likewise.
* etc/poke.g4 (declaration): Likewise.
* etc/poke-mode.el: Likewise.
* poke/pk-map.c (pk_map_load_parsed_map): Likewise.
* poke/pk-mi.c: Likewise.
* maps/dwarf.map: Likewise.
* doc/poke.texi: Likewise.
* testsuite/poke.cmd/*.pk: Likewise.
* testsuite/poke.pkl/*.pk: Likewise.
* testsuite/poke.map/*.pk: Likeiwise.
* testsuite/poke.libpoke/*.pk: Likewise.
* testsuite/poke.id3v1/*.pk: Likewise.
* testsuite/poke.color/*.pk: Likewise.
* testsuite/poke.repl/repl.exp: Likewise.
* testsuite/poke.std/*.pk: Likewise.
* testsuite/poke.mi-json/pk_sct.json: Likewise.
* utils/elfextractor: Likewise.
* HACKING: Likewise.
* TODO: Likewise.
2020-11-04 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* HACKING (Write After Approval): Add Mohammad-Reza Nabipoor.
* AUTHORS: Likewise.
2020-11-03 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/pkl-trans.c (pkl_trans1_ps_string): Add support for octal
and hexadecimal escape sequences.
* doc/poke.texi (String Literals): Document new escape sequences.
* testsuite/poke.pkl/strings-esc-1.pk: New test.
* testsuite/poke.pkl/strings-esc-2.pk: Likewise.
* testsuite/poke.pkl/strings-esc-diag-1.pk: Likewise.
* testsuite/poke.pkl/strings-esc-diag-2.pk: Likewise.
* testsuite/poke.pkl/strings-esc-diag-3.pk: Likewise.
* testsuite/poke.pkl/strings-esc-diag-4.pk: Likewise.
* testsuite/poke.pkl/string-diag-1.pk: `\x` is now a valid sequence;
use `\z` as an invalid escape sequence.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-11-01 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.h: Include errno.h.
(ios_dev_file_handler_normalize): Pass a new argument to be filled
with the new_handler. Convert the return value to int to return IOD
error types. In case of no errors, return IOD_OK.
(ios_dev_file_open): Pass a new argument to be filled with the newly
opened device. Convert the return value into an int to return IOD
error types. In case of no errors, return IOD_OK.
* libpoke/ios-dev-mem.h (ios_dev_mem_handler_normalize): Like
ios_dev_file_handler_normalize.
(ios_dev_mem_open): Like ios_dev_file_open.
* libpoke/ios-dev-nbd.h (ios_dev_nbd_handler_normalize): Like
ios_dev_file_handler_normalize.
(ios_dev_nbd_open): Like ios_dev_file_open.
* libpoke/ios-dev-stream.h (ios_dev_stream_handler_normalize): Like
ios_dev_file_handler_normalize.
(ios_dev_stream_open): Like ios_dev_file_open.
* libpoke/ios-dev.h (handler_normalize): Pass a new argument to be
filled with the new_handler. Convert the return value to int.
(open): Pass a new argument to be filled with the newly opened device.
Convert the return value into an int to return IOD error types. In
case of no errors, return IOD_OK.
* libpoke/ios.c (ios_open): Set IO id after making sure open won't
fail. Handle errors returned by handler_normalize and open. Prevent
opening an already-open IO space.
* libpoke/ios.h: Introduce IOS_EOPEN.
* libpoke/pvm.jitter (open): Raise a PVM_E_IO for all possible error
values of ios_open.
2020-11-01 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev.h: Add IOD_OK, IOD_EIOFF, IOD_EFLAGS and IOD_ENOMEM.
Change the values of IOD_EOF and IOD_EINVAL.
* libpoke/ios.h: Add IOS_EOF and IOS_EINVAL. Define
IOD_ERROR_TO_IOS_ERROR.
2020-10-28 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* bootstrap.conf: Add `lib-symbol-visibility` module to `libpoke`.
* libpoke/Makefile.am: Add CPP flags to hide symbols by default.
* libpoke/libpoke.h: Define `LIBPOKE_API` macro. Mark all public
functions with `LIBPOKE_API`.
* libpoke/ios.h: Remove `__attribute__ ((visibility ("hidden")))`.
* libpoke/pkl-asm.h: Likewise.
* libpoke/pkl-ast.h: Likewise.
* libpoke/pkl-diag.h: Likewise.
* libpoke/pkl-env.h: Likewise.
* libpoke/pkl-parser.h: Likewise.
* libpoke/pkl-pass.h: Likewise.
* libpoke/pkl.h: Likewise.
* libpoke/pkl-alloc.h: Likewise.
* libpoke/pvm-program.h: Likewise.
* libpoke/pvm-val.h: Likewise.
* libpoke/pvm.h: Likewise.
* DEV-NEWS: Add relevant notes for devs.
2020-10-25 Jose E. Marchesi <jemarch@gnu.org>
* DEV-NEWS: New file.
* HACKING (Recording noteworthy development changes): New section.
2020-10-25 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.h: Rename pvm_type_equal to pvm_type_equal_p.
* libpoke/pvm.jitter: Likewise.
* libpoke/pvm-val.c: Likewise.
2020-10-22 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* doc/poke.texi: output of `.info ios`commands: Add `Type` column.
Minor tweaks to make them consistent.
* doc/poke.texi (From Bytes to Integers): Remove the description of
little-endian integers.
* HACKING (Appendix): Fix `pk-utils.[ch]` paths.
2020-10-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/ios-dev-stream.c (ios_dev_stream_close): Free buffer only
in read mode.
* libpoke/ios-buffer.h (ios_buffer_free): Change return type to void.
* libpoke/ios-buffer.c (ios_buffer_free): Handle buffer == NULL.
2020-10-20 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* libpoke/ios-dev-stream.c: Add missing include "pk-utils.h".
2020-10-19 Mohammad-Reza Nabipoor <m.nabipoor@yahoo.com>
* testsuite/poke.mi-json/pk_int.json: Add new line at the end.
* testsuite/poke.mi-json/pk_uint.json: Likewise.
* testsuite/poke.mi-json/pk_offset.json: Likewise.
* testsuite/poke.mi-json/pk_string.json: Likewise.
* testsuite/poke.mi-json/pk_array.json: Add new line at the end and
trim trailing whitespaces.
* testsuite/poke.mi-json/pk_sct.json: Likewise.
* poke/pk-cmd-ios.c: Expand TAB to 8 spaces.
* libpoke/ios-buffer.h: Likewise.
* libpoke/ios-buffer.c: Likewise.
* libpoke/ios.c: Put space after function name.
* libpoke/ios-dev-stream.c: Expand TAB to 8 spaces. Put space after
function names. Use STREQ. Remove `if` before `free`. Remove inclusion
of assert.h.
* libpoke/ios-buffer.h: Reformat function prototypes according to the
GNU Coding Standards.
2020-10-12 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/Makefile.am (libpoke_la_SOURCES): Add ios-buffer.h,
ios-buffer.c and ios-dev-stream.c.
* libpoke/ios-buffer.c: New file.
* libpoke/ios-buffer.h: New file.
* libpoke/ios-dev-stream.c: New file.
* libpoke/ios.c: Extern ios_dev_stream.
(ios_dev_ifs): Add ios_dev_stream.
2020-10-11 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios.c (ios_flush): Divide the offset by 8 before passing it
to io->dev_if->flush which accepts offsets in the granularity of bytes.
2020-10-11 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_get_if_name): New.
* libpoke/ios-dev-mem.c (ios_dev_mem_get_if_name): New.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_get_if_name): New.
* libpoke/ios-dev.h (get_if_name): New.
* libpoke/ios.c (ios_get_dev_if_name): New.
* libpoke/ios.h (ios_get_dev_if_name): New.
* libpoke/libpoke.c (pk_ios_get_dev_if_name): New.
* libpoke/libpoke.h (pk_ios_get_dev_if_name): New.
* poke/pk-cmd-ios.c (print_info_ios): Print interface name.
* testsuite/poke.cmd/file-mode.pk: Adjust test output.
* testsuite/poke.cmd/file-relative.pk: Adjust test output.
2020-09-30 Kostas Chasialis <sdi1600195@di.uoa.gr>
* poke/pk-mi-json.h (pk_mi_val_to_json): Prototype.
(pk_mi_json_to_val): Prototype.
* poke/pk-mi-json.c (pk_mi_val_to_json): Define.
(pk_mi_json_to_val): Define.
(pk_mi_val_to_json): New function.
(pk_mi_val_to_json_1): Likewise.
(pk_mi_int_to_json): Likewise.
(pk_mi_uint_to_json): Likewise.
(pk_mi_string_to_json): Likewise.
(pk_mi_offset_to_json): Likewise.
(pk_mi_mapping_to_json): Likewise.
(pk_mi_sct_to_json): Likewise.
(pk_mi_array_to_json): Likewise.
(pk_mi_null_to_json): Likewise.
(pk_mi_json_to_val): Likewise.
(pk_mi_json_to_val_1): Likewise.
(pk_mi_json_to_int): Likewise.
(pk_mi_json_to_uint): Likewise.
(pk_mi_json_to_string): Likewise.
(pk_mi_json_to_offset): Likewise.
(pk_mi_json_to_mapping): Likewise.
(pk_mi_json_to_sct): Likewise.
(pk_mi_json_to_array): Likewise.
(pk_mi_json_poke_value_type): Likewise.
(pk_mi_json_array_element_pair): Likewise.
* testsuite/poke.mi-json/mi-json.c (test_json_to_val_to_json): New function.
(test_json_file): Likewise.
(test_json_to_val): Likewise.
(test_val_to_json): Likewise.
(test_json_pk_val): Likewise.
(test_json_pk_int): Likewise.
(test_json_pk_uint): Likewise.
(test_json_pk_string): Likewise.
(test_json_pk_offset): Likewise.
(test_json_pk_null): Likewise.
(test_json_pk_sct): Likewise.
(test_json_pk_array): Likewise.
(compile_initial_poke_code): Likewise.
(compile_poke_expression): Likewise.
(read_json_object): Likewise.
(parse_json_str_object): Likewise.
* testsuite/poke.mi-json/pk_int.json: New test.
* testsuite/poke.mi-json/pk_uint.json: New test.
* testsuite/poke.mi-json/pk_string.json: New test.
* testsuite/poke.mi-json/pk_offset.json: New test.
* testsuite/poke.mi-json/pk_array.json: New test.
* testsuite/poke.mi-json/pk_sct.json: New test.
* testsuite/poke.mi-json/Makefile.am: Added TESTDIR.
* testsuite/Makefile.am (EXTRA_DIST): Updated with new tests.
2020-09-30 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-mode.el: Delete trailing whitespaces.
2020-09-30 Pierre-Evariste Dagand <pierre-evariste.dagand@lip6.fr>
* doc/poke.texi: Fix typos.
2020-09-15 Aurélien Aptel <aaptel@suse.com>
* etc/poke-mode.el: Add SMIE grammar and indent code.
2020-09-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/time.pk: New file.
(ptime): Move from std.pk.
(POSIX_Time32): Likewise.
(POSIX_Time64): Likewise.
* pickles/Makefile.am (dist_pickles_DATA): Add time.pk.
* testsuite/poke.time/time32.pk: Moved from poke.std.
* testsuite/poke.time/time.exp: New file.
* testsuite/Makefile.am (EXTRA_DIST): Reflect change of opsition
of time32.pk
* doc/poke.texi (Time): New chapter.
2020-09-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (struct pk_compiler): New field complete_type.
(pk_compiler_new): Initialize complete_type.
(complete_struct): Use complete_type.
2020-09-06 Kostas Chasialis <sdi1600195@di.uoa.gr>
* testsuite/poke.libpoke/values.c: Now all tests run with make check.
* testsuite/poke.libpoke/Makefile.am: Added TESTDIR and LTLIBTEXTSTYLE
for this purpose.
2020-09-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (rest_of_compilation): Revert fold and trans4 in
the middleend pass.
2020-09-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_do_pass): Get a new argument `level'.
(pkl_do_subpass): Likewise.
(pkl_do_pass_1): Likewise.
(pkl_call_node_handlers): Likewise.
(PKL_PASS_CHAIN): Pass the new argument.
(PKL_PASS): Likewise.
(PKL_CALL_PHASES_SINGLE): Likewise.
* libpoke/pkl.c (rest_of_compilation): Set pass levels.
* libpoke/pkl-ast.h: Update comment on COMPILED.
* libpoke/pkl-anal.c (pkl_anal_pr_type): Remove handler.
(pkl_phase_anal1): Likewise.
(pkl_phase_anal2): Likewise.
(pkl_anal_ps_type): Likewise.
(pkl_phase_analf): Likewise.
* libpoke/pkl-trans.c (pkl_trans_pr_type): Likewise.
(pkl_phase_trans1): Likewise.
(pkl_phase_trans2): Likewise.
(pkl_phase_trans3): Likewise.
(pkl_phase_trans4): Likewise.
* libpoke/pkl-promo.c (pkl_promo_pr_type): Likewise.
(pkl_phase_promo): Likewise.
* libpoke/pkl-fold.c (pkl_fold_pr_type): Likewise.
(pkl_phase_fold): Likewise.
* libpoke/pkl-typify.c (pkl_typify_pr_type): Likewise.
(pkl_phase_typify1): Likewise.
(pkl_phase_typify2): Likewise.
* testsuite/poke.pkl/compiler-passes-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-09-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type): Process types in
PKL_AST_FUNC_TYPE_ARG nodes.
(pkl_gen_pr_func_type_arg): Remove weird subpass.
2020-09-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_func): New handler.
(pkl_phase_gen): Install handler.
2020-09-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify2_ps_type): Do not set
COMPILED=1.
* libpoke/pkl-anal.c (pkl_analf_ps_type): New handler.
(pkl_phase_analf): Install handler.
* testsuite/poke.pkl/ass-diag-9.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-09-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (aconc): Fix the type of the resulting
array.
* testsuite/poke.pkl/add-arrays-4.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-09-01 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/libpoke.h (pk_val_equal_p): Prototype.
* libpoke/pk-val.c (pk_val_equal_p): Define.
* libpoke/pvm.h (pvm_val_equal_p): Prototype.
* libpoke/pvm-val.c (pvm_val_equal_p): Define.
* testsuite/poke.libpoke/values.c (test_pk_val_equal_p): New function.
(test_pk_equal_file): Likewise.
(copy_line_to_expression): Likewise.
(compile_poke_expressions): Likewise.
(compile_initial_poke_code): Likewise.
* testsuite/poke.libpoke/pk_equal_int.test: New test.
* testsuite/poke.libpoke/pk_equal_uint.test: New test.
* testsuite/poke.libpoke/pk_equal_str.test: New test.
* testsuite/poke.libpoke/pk_equal_off.test: New test.
* testsuite/poke.libpoke/pk_equal_sct.test: New test.
* testsuite/poke.libpoke/pk_equal_arr.test: New test.
* testsuite/poke.libpoke/pk_nequal_int.test: New test.
* testsuite/poke.libpoke/pk_nequal_uint.test: New test.
* testsuite/poke.libpoke/pk_nequal_str.test: New test.
* testsuite/poke.libpoke/pk_nequal_off.test: New test.
* testsuite/poke.libpoke/pk_nequal_sct.test: New test.
* testsuite/poke.libpoke/pk_nequal_arr.test: New test.
* testsuite/poke.libpoke/Makefile.am: Added PKGDATADIR.
* testsuite/Makefile.am (EXTRA_DIST): Updated with new tests.
* bootstrap.conf (gnulib_modules): Added new modules.
2020-09-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type): Update comment.
(pkl_gen_pr_type_array): Duplicating logic from pkl_gen_pr_type is
no longer necessary.
(pkl_gen_pr_type_struct): Likewise.
* libpoke/pkl-anal.c (pkl_anal1_pr_type_struct): It is no longer
needed to break the pass here.
2020-09-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_call_node_handlers): Execute pre-order
handlers from more generic to more particular, and post-order
handlers from more particular to more generic.
* libpoke/pkl-pass.h: Document new precedence of handlers based on
the ordering.
2020-09-01 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-pass.c (pkl_do_pass_1): Pass the right pass order to
pkl_cal_node_handlers.
(pkl_call_node_handlers): Adjust accordingly.
2020-09-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf-info.pk: New file.
* pickles/dwarf.pk: Load dwarf-info.pk.
* pickles/dwarf-common.pk: Do not load leb128.pk.
* maps/dwarf.map: Add comment with information on DWARF related
sections and the data stored in them.
2020-09-01 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-map.c (pk_cmd_map_show): Include the $ prefix in the
map entry names.
* testsuite/poke.cmd/maps-4.pk: Update accordingly.
* testsuite/poke.cmd/maps-5.pk: Likewise.
* testsuite/poke.cmd/maps-6.pk: Likewise.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf-frame.pk (Dwarf_CFI): Adapt to use Dwarf_Op for
CFA_def_cfa_expression, CFA_expression and CFA_val_expression.
* pickles/dwarf-expr.pk: New file.
* pickles/dwarf.pk (DW_TAG_hi_user): Fix value.
Load dwarf-expr.pk.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf-common.pk: New file.
* pickles/dwarf-frame.pk: Likewise.
* pickles/dwarf-pubnames.pk: Likewise.
* pickles/dwarf-types.pk: Likewise.
* pickles/dwarf.pk: load the other dwarf- files.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf.pk (Dwarf_Name_Lookup_Table): pubnames and
pubtypes weren't available until DWARF 3.
(Dwarf_Name_Lookup_Table): New method `lookup'.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Fix handling of
payload->generating_pvm_struct_type.
Break pass whenever appropriate.
(pkl_gen_ps_type_struct): Likewise.
* testsuite/poke.pkl/scons-57.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* pickles/leb128.pk (LEB128): Define.
* pickles/dwarf.pk (Dwarf_Block): Define.
(Dwarf_CFI): Options for DW_CFA_def_cfa_expression,
DW_CFA_expression and DW_CFA_val_expression.
(Dwarf_Call_Frame_Info): Define.
* maps/dwarf.map (frame): New entry.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal_ps_program): New handler.
(pkl_phase_anal1): Install handler.
(pkl_phase_anal2): Likewise.
(pkl_phase_analf): Likewise.
(pkl_anal1_pr_type_struct): Break phase if compiled.
2020-08-31 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf.pk (Dwarf_Section_Offset): New method `value'.
(Dwarf_Type_Unit_Header): Define.
(Dwarf_CIE): Likewise.
* maps/dwarf.map: New file.
* maps/elf.map: Move dwarf entries to dwarf.map.
* maps/Makefile.am (dist_maps_DATA): Add dwarf.map.
2020-08-30 Jose E. Marchesi <jemarch@gnu.org>
* pickles/dwarf.pk: Add more constants.
2020-08-30 Jose E. Marchesi <jemarch@gnu.org>
* pickles/future/dwarf.pk: Remove.
* pickles/dwarf.pk: Copied and adapted from future/dwarf.pk.
* maps/elf.map: Add debug_info.
2020-08-27 Jose E. Marchesi <jemarch@gnu.org>
* gui/poke-gui.c: Include locale.h, for setlocale.
2020-08-27 Jose E. Marchesi <jemarch@gnu.org>
* pickles/leb128.pk: Simplify pretty printing.
2020-08-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk (BPF_Insn_Opcode.class): Turn into method.
(BPF_Insn_Opcode.imm64): Likewise.
2020-08-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal1_ps_type_struct): Allow methods
anywhere in union types. Declarations are still only allowed
before alternatives.
* libpoke/pkl-gen.pks (struct_mapper): Support methods in union
types.
(struct_constructor): Likewise.
* testsuite/poke.pkl/scons-union-method-1.pk: New test.
* testsuite/poke.pkl/scons-union-method-2.pk: Likewise
* testsuite/poke.pkl/scons-union-method-3.pk: Likewise.
* testsuite/poke.pkl/scons-union-method-4.pk: Likewise.
* testsuite/poke.map/maps-unions-method-1.pk: Likewise.
* testsuite/poke.map/maps-unions-method-2.pk: Likewise.
* testsuite/poke.map/maps-unions-method-3.pk: Likewise.
* testsuite/poke.pkl/union-pretty-print-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-08-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c (pk_type_code): Fix regression.
* poke/pk-map.c (pk_map_load_parsed_map): Remove spurious trace.
2020-08-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_File.section_name_p): New method.
2020-08-26 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_mapper): Keep the right
lexical environment when subpassing results in a constraint
exception.
* testsuite/poke.map/maps-unions-11.pk: New test.
* testsuite/poke.map/maps-unions-12.pk: Likewise.
* testsuite/poke.map/maps-unions-13.pk: Likewise.
* testsuite/poke.pkl/scons-56.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-08-25 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: IN has a bigger priority than AND and OR.
* testsuite/poke.pkl/in-8.pk: New test.
* testsuite/poke.pkl/in-9.pk: Likewise.
2020-08-21 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (sc_tests_listed_in_makefile_am): New rule.
2020-08-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add trim-26.pk, scons-55.pk,
add-int-struct-4.pk, poke.pkl/offset-type-diag-6.pk,
offset-type-1.pk.
2020-08-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_trimmer): The type of a
trimmed array is unbounded.
* testsuite/poke.pkl/trim-26.pk: New test.
2020-08-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): Avoid invalid memory
access.
(struct_mapper): Likewise.
* testsuite/poke.pkl/scons-55.pk: New test.
2020-08-20 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_Type): Fix ordering of fields in `info', and
add pretty-printer for `info'.
(BTF_KIND_UNKNOWN): Define.
(btf_kind_names): Likewise.
* libpoke/pkl-anal.c (pkl_anal1_ps_type_struct): Allow methods
after union fields.
2020-08-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_ps_cast): Struct types used in casts
may not have integrators compiled, if they are anonymous structs.
* libpoke/pkl-gen.pks (struct_integrator): Fix stale reference to
type_struct.
* testsuite/poke.pkl/add-int-struct-4.pk: New test.
2020-08-20 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (btf_types): Fix offset.
(btf_strings): Likewise.
(BTF_Header): Fix endian determination.
2020-08-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_type_is_complete): Fix logic in the
determination on whether a struct type is complete.
* testsuite/poke.pkl/offset-type-diag-6.pk: New test.
2020-08-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-promo.c (pkl_promo_ps_type_offset): New handler.
(pkl_phase_promo): Use handler.
* libpoke/pkl-trans.c (pkl_trans2_ps_type_offset): Renamed from
pkl_trans2_ps_offset_type.
(pkl_phase_trans2): Likewise.
* testsuite/poke.pkl/offset-type-1.pk: New test.
2020-08-17 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_Type): Make `info' an integral struct.
(BTF_Int): Turn into an integral struct.
2020-08-17 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (BTF_Type): Move the vararg_p method from
BTF_Func_Proto to BTF_Type.
2020-08-17 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bmp.pk (BMP_Info_Header): Make `num_colors' a method and
not a function.
2020-08-07 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/pvm-val.c (pvm_type_equal): Bugfixes.
2020-08-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Document that PK_NULL should have the same
value than PVM_NULL.
2020-08-03 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/pvm-val.c (pvm_typeof): pvm_integral_type now represents
signed_p as int.
(pvm_type_equal): Updated accordingly.
(pvm_print_val_1): Likewise.
2020-08-03 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/pk-val.c (pk_type_code): Now return PK_UINT
if integral type is unsigned.
* etc/pk-mi-json-schema.json (json_schema) : Changed "offsets"
to "boffsets" on arrays and structs.
2020-08-02 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/libpoke.h: Change poke to Poke on function documentations.
2020-08-01 Bruno Haible <bruno@clisp.org>
Update after gnulib changed.
* configure.ac: Invoke gl_LIBTEXTSTYLE_OPTIONAL explicitly.
2020-07-27 Kostas Chasialis <sdi1600195@di.uoa.gr>
* etc/pk-mi-json-schema.json (json_schema): Indentation fixes.
* libpoke/libpoke.h (pk_make_struct): Fixed function documentation.
2020-07-25 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Command Files): Renamed from Scripts.
(Scripts): Renamed from Shebang.
(Modifying SBM Images): Fix typo.
2020-07-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm-val.h (PVM_VAL_TYP_I_SIGNED_P): Renamed from
PVM_VAL_TYP_I_SIGNED.
* libpoke/pkl.c (pvm_type_to_ast_type): Update accordingly.
* libpoke/pvm-val.c (pvm_make_integral_type): Likewise.
(pvm_print_val_1): Likewise.
(pvm_type_equal): Likewise.
* libpoke/pk-val.c (pk_integral_type_signed_p): Likewise.
2020-07-24 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Change title.
2020-07-24 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.c (pkl_anal1_ps_type_struct): Integral structs
cannot be pinned.
* testsuite/poke.pkl/pinned-int-struct-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Update.
* doc/poke.texi (Pinned Structs): Document that integral structs
cannot be pinned.
2020-07-24 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Integral Structs): Document explicit casts to
integral types, and coercions.
2020-07-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_I_SIGNED_P): Rename from
PKL_AST_TYPE_I_SIGNED.
* libpoke/pkl-promo.c: Likewise.
* libpoke/pkl-gen.c: Likewise.
* libpoke/pkl-fold.c: Likewise.
* libpoke/pkl-ast.c: Likewise.
* libpoke/pkl-asm.c: Likewise.
* libpoke/pkl-typify.c: Likewise.
* libpoke/pkl.c: Likewise.
2020-07-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_type_promoteable): Integral struct
types can be promoted to integral types.
* libpoke/pkl-typify.c (TYPIFY_BIN): Consider integral structs as
integers in binary operators.
(pkl_typify1_ps_bshift_pow): Likewise.
(pkl_typify1_ps_mul): Likewise.
(pkl_typify1_ps_op_bconc): Likewise.
(pkl_typify1_ps_op_boolean): Likewise.
(pkl_typify1_ps_first_operand): Likewise.
(pkl_typify1_ps_op_not): Likewise.
(pkl_typify1_ps_loop_stmt): Likewise.
(pkl_typify1_ps_if_stmt): Likewise.
* libpoke/pkl-anal.c (pkl_anal1_ps_op_sl): Likewise.
* libpoke/pkl-promo.c (promote_integral): Support promoting
integral structs.
(pkl_promo_ps_op_mul): Likewise.
(pkl_promo_ps_op_rela): Likewise.
(pkl_promo_ps_op_div): Likewise.
(pkl_promo_ps_cond_exp): Likewise.
(pkl_promo_ps_struct_type_field): Likewise.
(pkl_phase_promo): Promote OP_NEG, OP_POS and OP_BNOT.
(pkl_promo_ps_op_bconc): New handler.
(pkl_promo_ps_if_stmt): Likewise.
(pkl_promo_ps_loop_stmt): Likewise.
(pkl_phase_promo): Install new handlers.
* testsuite/poke.pkl/add-int-struct-1.pk: New test.
* testsuite/poke.pkl/add-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/add-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/sub-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/sub-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/sub-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/mul-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/mul-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/mul-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/div-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/div-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/div-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/and-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/or-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/not-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/neg-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/pos-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/band-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/band-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/band-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/ior-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/ior-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/ior-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/bnot-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/xor-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/xor-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/xor-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/bconc-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/bconc-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/bconc-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/cdiv-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/cdiv-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/cdiv-int-struct-3.pk: Likewise.
* testsuite/poke.pkl/sl-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/sl-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/sr-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/sr-int-struct-2.pk: Likewise.
* testsuite/poke.pkl/promo-int-struct-arg-1.pk: Likewise.
* testsuite/poke.pkl/promo-int-struct-return-1.pk: Likewise.
* testsuite/poke.pkl/if-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/while-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/while-3.pk: Likewise.
* testsuite/poke.pkl/for-in-5.pk: Likewise.
* testsuite/poke.pkl/for-in-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/cond-exp-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/cond-exp-int-struct-2.pk: Likewise.
* testsuite/poke.map/maps-int-struct-constraint-1.pk: Likewise.
* testsuite/poke.map/maps-int-struct-constraint-2.pk: Likewise.
* testsuite/poke.map/map-opcond-int-struct-1.pk: Likewise.
* testsuite/poke.map/map-opcond-int-struct-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update with new tests.
2020-07-23 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_inserter): Take into account
the struct offse in calculations.
* testsuite/poke.pkl/cast-int-struct-2.pk: New test.
* testsuite/poke.pkl/cast-int-struct-3.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update with new tests.
2020-07-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_INTEGRATOR): Define.
(sct): New field integrator.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Handle the
integrator.
(pkl_ast_node_free): Likewise.
* libpoke/pkl-gen.h: Note that IN_WRITER is also used for struct
integrators.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Compile integrators for
integral structs.
(pkl_gen_ps_cast): Handle casts from struct to integral.
* libpoke/pkl-gen.pks (struct_integrator): New RAS function.
* libpoke/pkl-typify.c (pkl_typify1_ps_cast): Allow casts from
integral structs to integral types.
* testsuite/poke.pkl/cast-struct-diag-3.pk: New test.
* testsuite/poke.pkl/cast-int-struct-1.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update with new tests.
* doc/poke.texi (Casting Structs): Document casts from integral
struct to integral type.
(Integral Structs): Likewise.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/scons-int-struct-3.pk: New test.
* testsuite/poke.map/maps-int-structs-19.pk: Likewise.
* testsuite/poke.map/maps-int-structs-20.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update with new tests.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_type_struct): Handle gen
environment properly before and after calling
RAS_FUNCTION_STRUCT_WRITER.
(pkl_gen_pr_type_array): Ditto for RAS_FUNCTION_ARRAY_WRITER.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/map-int-structs-17.pk: New test.
* testsuite/poke.map/map-int-structs-18.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-1.pk: Likewise.
* testsuite/poke.pkl/scons-int-struct-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update with new tests.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* pickles/id3v2.pk: Moved from future and adapted to actual Poke.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_op_rela): Do not allow
operands of type any.
* testsuite/poke.pkl/eq-any-diag-1.pk: New test.
* testsuite/poke.pkl/neq-any-diag-1.pk (equalstructs): Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Update with new tests.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-fold.c (pkl_fold_ps_cast): Fix masking of the
resulting magnitude of converted offsets.
* testsuite/poke.pkl/cast-offsets-5.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-07-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_inserter): Simplify code.
(struct_mapper): Likewise.
(struct_comparator): Likewise.
(struct_constructor): Likewise.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Rename .arg to .let, support initialization
expressions, and substitute RAS variables in literal C.
* libpoke/pkl-gen.pks (struct_field_extractor): Make use of these
new goodies.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Support for .arg directives.
* libpoke/pkl-gen.pks: Make use of them.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (array_mapper): Use macro arguments to
access AST nodes instead of relying on the context.
(array_valmapper): Likewise.
(array_writer): Likewise.
(array_bounder): Likewise.
(array_constructor): Likewise.
* libpoke/pkl-gen.c: Adjust accordingly.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Use macro arguments to
access AST nodes, instead of relying on the context.
(struct_comparator): Likewise.
(struct_constructor): Likewise.
(struct_writer): Likewise.
(struct_field_writer): Likewise.
(handle_struct_field_constraints): Likewise.
* libpoke/pkl-gen.c: Adapt accordingly.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Support arguments in RAS functions.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Calling compiled Poke from RAS): New section.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Support for the .call directive.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ras: Use RAS_PUSH_ASM and RAS_POP_ASM instead of the
PKL_GEN_ macros.
* libpoke/pkl-gen.c (RAS_PUSH_ASM): Define.
(RAS_POP_ASM): Likewise.
2020-07-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (integral_struct): Accept any
simple_type_specifier after struct.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Make sure the
type associated with an integral struct is itself integral.
* pickles/elf.pk (Elf64_RelInfo): Use Elf64_Xword as the integer
type of the struct.
* testsuite/poke.pkl/int-struct-type-diag-14.pk: New test.
* testsuite/poke.pkl/int-struct-1.pk: Likewise.
* testsuite/poke.pkl/int-struct-2.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (elf_stv_names): Define.
(STT_NOTYPE): Likewise.
(STT_OBJECT): Likewise.
(STT_FUNC): Likewise.
(STT_SECTION): Likewise.
(STT_FILE): Likewise.
(STT_COMMON): Likewise.
(STT_TLS): Likewise.
(STT_NUM): Likewise.
(STT_LOOS): Likewise.
(STT_GNU_IFUNC): Likewise.
(STT_HIOS): Likewise.
(STT_LOPROC): Likewise.
(STT_HIPROC): Likewise.
(elf_stt_names): Likewise.
(elf_stb_names): Likewise.
(Elf64_Sym): Pretty-printers for st_info and st_other.
* TODO: Update.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_field_inserter): Remove description
of the no-longer required C environment for this macro.
* libpoke/ras: Document how macro/function arguments can be
referred inside literal C directives.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-int-structs-14.pk: Avoid cast.
* testsuite/poke.map/maps-int-structs-16.pk: Likewise.
* pickles/elf.pk (Elf64_Sym): st_info should not be an integral
struct.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_writer): Support integral structs.
(struct_field_inserter): New macro.
* libpoke/pvm.jitter (srefia): Fix instruction.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Do not allow
optional fields in integral structs.
* testsuite/poke.map/maps-int-structs-13.pk: New test.
* testsuite/poke.map/maps-int-structs-14.pk: Likewise.
* testsuite/poke.map/maps-int-structs-15.pk: Likewise.
* testsuite/poke.map/maps-int-structs-16.pk: Likewise.
* testsuite/poke.map/maps-int-structs-17.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-13.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_PINNED_P): Renamed from
PKL_AST_TYPE_S_PINNED.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Adapt accordingly.
(pkl_ast_dup_type): Likewise.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-gen.pks (struct_mapper): Likewise.
(struct_constructor): Likewise.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-int-structs-12.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new test.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Handle offset
fields.
* libpoke/pkl-gen.pks (struct_mapper): Support offset fields in
integral structs.
(struct_field_extractor): Likewise.
* testsuite/poke.pkl/int-struct-type-diag-12.pk: New test.
* testsuite/poke.map/maps-int-structs-11.pk: Likewise.
* testsuite/poke.map/maps-int-structs-10.pk: Likewise.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
* pickles/ctf.pk (CTF_Name): Turn into an integral struct.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_RelInfo): Turn into an integral struct.
(st_info): Likewise.
* pickles/ctf.pk (CTF_Type_Id): Likewise.
(CTF_Info): Likewise.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks (struct_mapper): Use null as a dummy and not
an uint<64>0.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add missing tests.
2020-07-19 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (struct_type_specifier): Register one more
dummy.
* libpoke/pkl-gen.pks (struct_mapper): Support for mapping
integral structs.
(struct_constructor): Match the lexical
structure of struct_mapper.
(struct_field_mapper): Adapt to new lexical structure of
struct_mapper.
(struct_field_extractor): New macro.
(handle_struct_field_constraints): New macro.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Do not allow
integral structs inside other integral structs.
* testsuite/poke.pkl/int-struct-type-diag-10.pk: Adapt accordingly.
* testsuite/poke.pkl/int-struct-type-diag-8.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-9.pk: Likewise.
* testsuite/poke.map/maps-int-structs-1.pk: New test.
* testsuite/poke.map/maps-int-structs-2.pk: Likewise.
* testsuite/poke.map/maps-int-structs-5.pk: Likewise.
* testsuite/poke.map/maps-int-structs-4.pk: Likewise.
* testsuite/poke.map/maps-int-structs-3.pk: Likewise.
* testsuite/poke.map/maps-int-structs-6.pk: Likewise.
* testsuite/poke.map/maps-int-structs-7.pk: Likewise.
* testsuite/poke.map/maps-int-structs-8.pk: Likewise.
* testsuite/poke.map/maps-int-structs-9.pk: Likewise.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks: Typo in comment fixed.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev.h (IOD_ERROR): Redefine to -1.
(IOD_EOF): Redefine to -2.
(IOD_EINVAL): Redefine to -3.
* libpoke/ios.h: Remove IOS_EIOBJ.
* libpoke/ios.c (IOS_PUT_C_ERR_CHCK): Replace IOS_EIOBJ with
IOS_EIBOFF.
(ios_write_int_fast): Likewise.
* libpoke/pvm.jitter: Likewise.
* testsuite/poke.pkl/ios-mem-5.pk: Update accordingly.
* TODO: Update.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-copy.pk (copy): Make argument `to' to default to `from',
and do not move data around if to == from and to_ios == from_ios.
* doc/poke.texi (copy): Reflect change in documentation.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add poke.cmd/extract-1.pk,
poke.map/maps-structs-labels-2.pk, poke.pkl/funcall-15.pk and
poke.pkl/funcall-16.pk.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-extract.pk: New file.
* poke/pk-cmd.pk: Load pk-extract.pk.
* poke/Makefile.am (dist_pkgdata_DATA): Add pk-extract.pk.
* doc/poke.texi (extract): New section.
* testsuite/poke.cmd/extract-1.pk: New test.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import glob module.
* poke/pk-cmd.c (pk_cmd_exec_1): Use the more portable `glob' than
`wordexp'.
* testsuite/poke.cmd/file-relative.pk: Do not quote the file name.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-promo.c (pkl_promo_ps_struct_type_field): Promote
struct field labels to offset<uint<64>,b>.
* libpoke/pkl-gen.pks (handle_struct_field_label): Simplify
assuming that the label unit is bits.
* testsuite/poke.map/maps-structs-labels-2.pk (Foo): New test.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Fix references to prototypes to not include a
trailing colon.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* .x-sc_prohibit_magic_number_exit: Whitelist utils/*.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pvm.jitter (rand): Take an additional argument in the
stack for the seed.
* libpoke/pkl-rt.pk (rand): Redefine the builtin `rand' to take an
optional argument for the seed.
* libpoke/pkl-gen.c (pkl_gen_ps_comp_stmt): Likewise.
* doc/poke.texi (rand): New section.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* utils/elfextractor: New file.
* HACKING (Poke Utilities): New section.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (From Bytes to Integers): Reflect new syntax for
bit-concatenation.
(Big and Little Endians): Likewise.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Unions): Note about placing most common
alternatives first in unions.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (primary): Allow funcall statements.
* testsuite/poke.pkl/funcall-15.pk: New test.
* testsuite/poke.pkl/funcall-16.pk: Likewise.
* doc/poke.texi (Calling Functions): Document that the funcall
alternative syntax can be used in expressions.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ops.def: Remove unused ELEMSOF and TYPEOF operator
definitions.
2020-07-18 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Casting Structs): Expand a little.
2020-07-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.pks: Remove obsolete comments.
* libpoke/pkl-tab.y (INTEGER): Likewise.
(identifier): Likewise.
* libpoke/pk-val.c: Likewise.
2020-07-17 Bruno Haible <bruno@clisp.org>
Fix build failure during "make distcheck".
* testsuite/Makefile.am (EXTRA_DIST): Remove all directories. Add
individual files instead.
* testsuite/poke.libpoke/Makefile.am (EXTRA_DIST): Add libpoke.exp.
* testsuite/poke.mi-json/Makefile.am (EXTRA_DIST): Add mi-json.exp.
* HACKING: Mention that test files need to be listed.
2020-07-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_TYPE_S_UNION_P): Renamed from
PKL_AST_TYPE_S_UNION.
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Update
accordingly.
(pkl_ast_dup_type): Likewise.
(pkl_ast_print_1): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Likewise.
* libpoke/pkl-gen.pks (struct_mapper): Likewise.
* libpoke/pkl-anal.c (pkl_anal1_ps_type_struct): Likewise.
(pkl_anal2_ps_type_struct): Likewise.
2020-07-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_type_struct): Unions can't
be integral.
* testsuite/poke.pkl/int-struct-type-diag-11.pk: New test.
2020-07-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-typify.c (pkl_typify1_ps_struct): Do not allow
labels in fields in integral structs.
* testsuite/poke.pkl/int-struct-type-diag-10.pk: New test.
2020-07-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (sct): New field sct.itype.
(PKL_AST_TYPE_S_ITYPE): Define
* libpoke/pkl-ast.c (pkl_ast_make_struct_type): Get itype as
argument.
(pkl_ast_print_1): Print out itype.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct): Pass itype to
pkl_ast_make_struct_type.
(pkl_typify1_ps_type_struct): New handler.
(pkl_phase_typify1): Install handler.
* libpoke/pkl-tab.y (integral_struct): New rule.
(struct_type_specifier): Support for integral structs.
* testsuite/poke.pkl/int-struct-type-diag-1.pk: New test.
* testsuite/poke.pkl/int-struct-type-diag-2.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-9.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-8.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-7.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-6.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-5.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-4.pk: Likewise.
* testsuite/poke.pkl/int-struct-type-diag-3.pk: Likewise.
2020-07-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_File.get_section_by_name): Optimize
slightly.
2020-07-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Phdr): Define.
(Elf64_File): Add field phdr.
(PT_NULL): Define.
(PT_LOAD): Likewise.
(PT_DYNAMIC): Likewise.
(PT_INTERP): Likewise.
(PT_NOTE): Likewise.
(PT_SHLIB): Likewise.
(PT_PHDR): Likewise.
(PT_TLS): Likewise.
(PT_LOOS): Likewise.
(PT_HIOS): Likewise.
(PT_LOPROC): Likewise.
(PT_HIPROC): Likewise.
(Elf64_SegmentFlags): Likewise.
(PF_X): Likewise.
(PF_W): Likewise.
(PF_R): Likewise.
(PF_MASKOS): Likewise.
(PF_MASKPROC): Likewise.
2020-07-16 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Fail if an usable Boehm GC library is not found at
configure time.
2020-07-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (parse_args_1): Set that poke is invoked
non-interactively when -L is used.
(main): Initialize poke_interactive_p in main.
2020-07-14 Kostas Chasialis <sdi1600195@di.uoa.gr>
* etc/pk-mi-json-schema.json (json schema) : Fixed indentation style
and change to PokeValue properties.
2020-07-14 Bruno Haible <bruno@clisp.org>
Fix build failure during "make check" without libjson-c.
* testsuite/poke.mi-json/Makefile.am: Don't build anything if POKE_MI is
false.
* testsuite/poke.mi-json/mi-json.exp: Don't run any test if
poke.mi-json/mi-json wasn't built.
2020-07-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c: Remove trailing spaces.
* libpoke/libpoke.h: Likewise.
2020-07-14 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/libpoke.h (pk_make_struct_type): Prototype.
(pk_struct_type): Likewise.
(pk_allocate_struct_attrs): Likewise.
(pk_struct_type_name): Likewise.
(pk_struct_type_nfields): Likewise.
(pk_struct_type_fname): Likewise.
(pk_struct_type_set_fname): Likewise.
(pk_struct_type_ftype): Likewise.
(pk_struct_type_set_ftype): Likewise.
* libpoke/pk-val.c (pk_make_struct_type): Define.
(pk_struct_type): Likewise.
(pk_allocate_struct_attrs): Likewise.
(pk_struct_type_name): Likewise.
(pk_struct_type_nfields): Likewise.
(pk_struct_type_fname): Likewise.
(pk_struct_type_set_fname): Likewise.
(pk_struct_type_ftype): Likewise.
(pk_struct_type_set_ftype): Likewise.
2020-07-14 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.mi-json/mi-json.c (pk_fatal): Use EXIT_FAILURE
instead of hardcoded 1.
* libpoke/ios-dev.h (IOS_FILE_HANDLER_NORMALIZE): Replace tabs
with whitespaces.
2020-07-14 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Change jemarch for "the poke
authors".
* doc/poke.texi: Likewise.
2020-07-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/ios-dev.h (IOS_FILE_HANDLER_NORMALIZE): Fix logic.
2020-07-14 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_map): Fix subpassing on the map
offset when it is on the left side of an assignment.
2020-07-13 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_handler_normalize): Move
the file name normalization logic from here ...
* libpoke/ios-dev.h (IOS_FILE_HANDLER_NORMALIZE): ... to here.
2020-07-13 Jose E. Marchesi <jemarch@gnu.org>
* .x-sc_bindtextdomain: New file.
* testsuite/poke.mi-json/Makefile.am: New file.
* testsuite/poke.mi-json/mi-json.c: Likewise.
* testsuite/poke.mi-json/json.exp: Likewise.
* configure.ac: AC_CONFIG testsuite/poke.mi-json/Makefile.
* testsuite/Makefile.am (SUBDIRS): Add poke.mi-json.
* poke/pk-mi-json.c (pk_mi_json_to_msg): Do not print tokener
diagnostics.
* HACKING (Test Suite): Update.
2020-07-13 Bruno Haible <bruno@clisp.org>
Fix build failure during "make check".
* bootstrap.conf (libpoke_modules): Add vasprintf-posix.
(ACLOCAL_FLAGS): New variable.
* Makefile.am (ACLOCAL_AMFLAGS): Add -I options for the second and third
gnulib-tool invocation.
* configure.ac: Invoke libpoke_EARLY, gui_EARLY, libpoke_INIT, gui_INIT.
2020-07-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Add libpoke.
* testsuite/poke.libpoke/libpoke.exp: New file.
* testsuite/poke.libpoke/Makefile.am: Likewise.
* testsuite/poke.libpoke/values.c: Likewise.
* testsuite/poke.libpoke/term-if.h: Likewise.
* configure.ac: AC_CONFIG testsuite/libpoke/Makefile.
* HACKING (Unit Tests): New section.
2020-07-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h (PKL_AST_BUILTIN_FORGET): Define.
* libpoke/pkl-tab.y (BUILTIN_FORGET): Define.
(builtin): Handle BUILTIN_FORGET.
* libpoke/pkl-lex.l: Handle __PKL_BUILTIN_FORGET__.
* libpoke/pkl-rt.pk (flush): Define.
* doc/poke.texi (flush): New section.
* libpoke/pkl-insn.def (PKL_INSN_FLUSH): Define.
* libpoke/pvm.jitter (flush): New instruction.
2020-07-12 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_handler_normalize): Add
parameter "flags".
* libpoke/ios-dev-mem.c (ios_dev_mem_handler_normalize): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_handler_normalize): Likewise.
* libpoke/ios-dev.h (struct ios_dev_if): Add parameter "flags" to
handler_normalize.
* libpoke/ios.c (ios_open): Pass "flags" to handler_normalize.
2020-07-12 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios.h (ios_flush): New.
* libpoke/ios.c (ios_flush): New.
* libpoke/ios-dev.h (struct ios_dev_if): Add new member "flush".
* libpoke/ios-dev-file.c (ios_dev_file_flush): New.
* libpoke/ios-dev-mem.c (ios_dev_mem_flush): New.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_flush): New.
2020-07-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c: Remove trailing whitespace.
* libpoke/libpoke.h: Likewise.
* etc/pk-mi-json-schema.json: Add missing newline at EOF.
2020-07-02 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/libpoke.h (pk_make_struct): Prototype.
(pk_struct_nfields): Likewise.
(pk_struct_field_boffset): Likewise.
(pk_struct_set_field_boffset): Likewise.
(pk_struct_field_name): Likewise.
(pk_struct_set_field_name): Likewise.
(pk_struct_field_value): Likewise.
(pk_struct_set_field_value): Likewise.
* libpoke/pk-val.c (pk_make_struct): Define.
(pk_struct_nfields): Likewise.
(pk_struct_field_boffset): Likewise.
(pk_struct_set_field_boffset): Likewise.
(pk_struct_field_name): Likewise.
(pk_struct_set_field_name): Likewise.
(pk_struct_field_value): Likewise.
(pk_struct_set_field_value): Likewise.
2020-07-02 Kostas Chasialis <sdi1600195@di.uoa.gr>
* libpoke/libpoke.h (pk_array_elem_val): Prototype documentation
now describes what happens in case invalid IDX is passed.
(pk_array_set_elem_val): Likewise.
(pk_array_elem_boffset): Likewise.
(pk_array_set_elem_boffset): Likewise.
* libpoke/pk-val.c (pk_array_elem_val): Check for IDX.
(pk_array_set_elem_val): Likewise.
(pk_array_elem_boffset): Likewise.
(pk_array_set_elem_boffset): Likewise.
2020-07-02 Kostas Chasialis <sdi1600195@di.uoa.gr>
* etc/pk-mi-json-schema.json : JSON Schema
2020-06-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (expression): Finish break statements in the
try-until body.
* libpoke/pkl-gen.c (pkl_gen_pr_try_until_stmt): Use
pkl_asm_loop/pkl_asm_endloop to support `break' statements in the
body.
* doc/poke.texi (try-until): Mention that `break' is allowed in
try-until loops.
* testsuite/poke.pkl/try-until-4.pk: New test.
* testsuite/poke.pkl/try-until-6.pk: Likewise.
* testsuite/poke.pkl/try-until-5.pk: Likewise.
2020-06-30 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_loop_stmt): Use pkl_asm_while_loop
and pkl_asm_while_endloop.
* libpoke/ras: Likewise.
* libpoke/pkl-asm.h (pkl_asm_while_loop): Renamed from
pkl_asm_loop.
(pkl_asm_while_endloop): Renamed from pkl_asm_endloop.
(pkl_asm_loop): New prototype.
(pkl_asm_endloop): Likewise.
* libpoke/pkl-asm.c (pkl_asm_while_loop): Likewise.
(pkl_asm_while_endloop): Likewise.
(pkl_asm_loop): New function.
(pkl_asm_endloop): Likewise.
* testsuite/poke.pkl/while-2.pk: New test.
2020-06-28 Luca Saiu <positron@gnu.org>
do not rely on the unreliable "optimize" GCC function attribute
* libpoke/pvm-env.c (pvm_env_back): New static function.
(pvm_env_lookup, pvm_env_set_var): Rewrite avoiding recursion,
and factor the common logic using the new static function.
Remove __attribute__((optimize ("optimize-sibling-calls"))).
Remove comment, now obsolete.
2020-06-24 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac (PACKAGE_BUGZILLA): ac_define.
* poke/poke.c (print_help): Use PACKAGE_BUGZILLA.
* HACKING (The Bugzilla): Add a note about the bugzilla URL being
defined in configure.ac.
2020-06-19 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am: Pass SHELL as a variable to runtest.
* testsuite/lib/poke-dg.exp (poke-dg-test): Use SHELL to build the
shebang of the test program.
2020-06-10 Aurélien Aptel <aaptel@suse.com>
* HACKING (Maintainers): New section.
(Write After Approval): Add Aurélien Aptel.
* AUTHORS: Likewise.
2020-06-08 Aurélien Aptel <aaptel@suse.com>
* etc/poke-mode.el: New file.
* HACKING (Writing Poke): Mention poke-mode.
2020-06-06 Bruno Haible <bruno@clisp.org>
doc: Give users the freedom to use their own style in the HTML doc.
* doc/Makefile.am (AM_MAKEINFOHTMLFLAGS): Remove variable.
* HACKING (Building): Explain how to set a custom style in the HTML
documentation.
2020-05-30 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Miscellaneous minor corrections.
2020-05-30 John Darrington <john@darrington.wattle.id.au>
* poke/poke.h (pk_fatal): Add noreturn attribute.
2020-05-27 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pk-val.c (pk_make_offset): Return PK_NULL if the
arguments are not of the right type.
2020-05-25 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Compiler Passes and Phases): Update.
(Transformation Phases): Likewise.
(Analysis Phases): Likewise.
2020-05-24 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ctf.pk (CTF_Type): Fix application of bit-concatenation
in pretty_printer.
(ctf_string): Use an Elf64_File instead of a header.
(ctf_get_header): Likewise.
2020-05-17 Tim Rühsen <tim.ruehsen@gmx.de>
* gnulib: Update to master
2020-05-23 John Darrington <john@darrington.wattle.id.au>
* poke/poke.c (pk_fatal): Call abort instead of exit.
* libpoke/pkl.c (pklresolve_module): On lookup failure,
return NULL instead of asserting.
2020-05-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-asm.pks (offset_cast): Operate with integers of
to_base_unit units, to avoid overflows and division by zero.
2020-05-22 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/eq-integers-5.pk: New test.
* testsuite/poke.pkl/eq-offsets-8.pk: Likewise.
2020-05-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.h (pkl_execute_file): Add argument exit_status.
* libpoke/libpoke.h (pk_compile_file): Likewise.
* libpoke/pkl.c (pkl_execute_file): Likewise.
* libpoke/libpoke.c (pk_compile_file): Likewise.
* libpoke/pkl-rt.pk (_pkl_exception_handler): Return the exit
status.
(Exception): Add field exit_status.
(exit): The status code is 0 by default.
* libpoke/pkl-asm.c (pkl_asm_finish): Adapted to the fact the
default signal handler returns the exit status.
* poke/poke.c (parse_args_2): Use the program's exit status as the
exit status of poke when running -L.
* libpoke/pvm-val.h (pvm_make_exception): Get an exit_exception
argument.
* libpoke/pvm-val.c (pvm_make_exception): Handle the exit status
field of exceptions.
* libpoke/pvm.h (PVM_E_EXIT): Define.
(PVM_E_EXIT_MSG): Likewise.
(PVM_E_EXIT_ESTATUS): Likewise.
* libpoke/pvm.jitter (PVM_RAISE_DFL): Define and use through the
file.
* libpoke/ras: Pass the exit status argument to
pvm_make_exception.
* libpoke/pkl-gen.c: Likewise.
* libpoke/pkl-asm.c: Likewise.
2020-05-22 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (EC_exit): Define.
(E_exit): Likewise.
(exit): LIkewise.
(_pkl_exception_handler): Do not print an exception message for
EC_exit.
* libpoke/pvm.h (PVM_E_EXIT): Define.
(PVM_E_EXIT_MSG): Likewise.
2020-05-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (ELFDATANONE): Define.
(ELFDATA2LSB): Likewise.
(ELFDATA2MSB): Likewise.
(Elf64_Ehdr): Set endianness based on ei_data.
2020-05-21 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Shebang): Document the handling of command-line
options in Poke scripts.
(Invoking poke): Document how command-line arguments are processed
after -L SCRIPT.
2020-05-21 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (pk_array_set_elem_val): Prototype.
(pk_array_set_elem_boffset): Likewise.
* libpoke/pk-val.c (pk_array_set_elem_val): Define.
(pk_array_set_elem_boffset): Likewise.
* poke/poke.c (parse_args_2): Change -L SCRIPT so any further
command line option becomes the script's option.
(set_script_args): Define.
* libpoke/pkl.c (pvm_type_to_ast_type): Define.
* libpoke/pkl-anal.c (pkl_anal_ps_default): Disable the location
checker.
2020-05-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y: Include gettext.h and define _.
Internationalize token descriptions.
2020-05-20 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/maps-alien-1.pk: New test.
2020-05-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (yyreport_syntax_error): Handle out-of-memory
condition.
2020-05-20 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-tab.y (parse.error): Use customized syntax errors.
(yyreport_syntax_error): Define.
(ALIEN): New token.
* libpoke/pkl-parser.h (struct pkl_parser): New field
`alien_errmsg'.
* libpoke/pkl-lex.l: Set the alien error message and return ALIEN
for alien tokens not accepted by the client.
* libpoke/libpoke.h: Get an ERRMSG argument in
pk_alien_token_handler_fn.
* libpoke/pkl.h: Likewise.
* poke/pk-map.c (pk_map_alien_token_handler): Adapt accordingly.
2020-05-20 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Bison): Document requirement.
* bootstrap.conf (buildreq): Require bison >= 3.6.0.
* libpoke/pkl-tab.y: Port to bison 3.6.
* libpoke/pkl-lex.l: Likewise.
* poke/pk-map-tab.y: Likewise.
* poke/pk-map-lex.l: Likewise.
2020-05-19 Jose E. Marchesi <jemarch@gnu.org>
* poke/Makefile.am (poke_LDADD): Do not add the jitter library to
the application.
2020-05-19 Luca Saiu <positron@gnu.org>
* libpoke/Makefile.am (libpvmjitter_la_LIBADD): Use the new
JITTER_LIBADD rather than JITTER_LDADD.
* poke/Makefile.am (poke_LDADD): Likewise. Remove now-obsolete
XXX comment.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (entry_name_to_varname): Use cur_map_id instead of
a map.
(pk_map_load_parsed_map): Do not create the map until all the
variables are defined without error.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.pk (auto_map): Escape . in regexps.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-map.c (pk_cmd_map_show): Include the map name while
listing entries.
* testsuite/poke.cmd/maps-4.pk: Adapt accordingly.
* testsuite/poke.cmd/maps-5.pk: Likewise.
* testsuite/poke.cmd/maps-6.pk: Likewise.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* maps/elf.map: Rename entry from elf to file.
2020-05-17 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pkl-env.c (hash_string): Suppress ASAN runtime error
"implicit-signed-integer-truncation-or-sign-change".
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Support :: separators in alien token
identifiers.
* poke/pk-map.c (pk_map_alien_token_handler): Use :: to separate
mapname from entryname in alien tokens.
(pk_map_normalize_name): Do not reduce sequences of _'s.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-lex.l: Change bit-concatenation operator from :: to
:::.
* doc/poke.texi (From Bytes to Integers): Update accordingly.
(Bitwise Operators): Likewise.
* testsuite/poke.pkl/bconc-7.pk: Likewise.
* testsuite/poke.pkl/bconc-6.pk: Likewise.
* testsuite/poke.pkl/bconc-5.pk: Likewise.
* testsuite/poke.pkl/bconc-4.pk: Likewise.
* testsuite/poke.pkl/bconc-3.pk: Likewise.
* testsuite/poke.pkl/bconc-2.pk: Likewise.
* testsuite/poke.pkl/bconc-1.pk: Likewise.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (pk_map_normalize_name): New function.
(pk_map_load_file): Use pk_map_normalize_name.
* poke/pk-cmd-map.c (pk_cmd_map_create): Likewise.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c: Make poke_prompt_maps_p to default to yes.
* poke/pk-ios.c (pk_open_ios): Do not emit an "auto-map: loaded"
message if prompt-maps is enabled.
2020-05-18 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (pk_map_add_entry): Get both name and varname as
arguments.
(pk_map_load_parsed_map): Adjust call accordingly.
* poke/pk-cmd-map.c (pk_cmd_map_entry_add): LIkewise.
(pk_cmd_map_show): Do now show a Variable column.
* testsuite/poke.cmd/maps-4.pk: Adapt accordingly.
* testsuite/poke.cmd/maps-5.pk: Likewise.
* testsuite/poke.cmd/maps-6.pk: Likewise.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.c (pkl_lexical_cuckolding_p): Define.
(pkl_set_lexical_cuckolding_p): Likewise.
(pkl_set_alien_token_fn): Likewise.
(pkl_alien_token_fn): Likewise.
(struct pkl_compiler): New fields `lexical_cuckolding_p' and
`alien_token_fn'.
* libpoke/libpoke.c (pk_set_lexical_cuckolding_p): Define.
(pk_set_alien_token_fn): Likewise.
* poke/pk-cmd.c (pk_cmd_exec): Activate the lexical cuckolding
when executing Poke code in the REPL.
* poke/pk-map.c (pk_map_alien_token_handler): Define.
(pk_map_init): Install pk_map_alien_token_handler in
poke_compiler.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* maps/mp3.map: Fix tag.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.h (struct pk_map): New field `id'.
(struct pk_map_entry): New field `name'.
(PK_MAP_ENTRY_NAME): Define.
* poke/pk-map.c (next_map_id): New variable.
(pk_map_create): Allocate a new map ID and initialize the new map
with it.
(search_map_entry): Search entries by name, not varnames.
(pk_map_add_entry): Initialize the map entry name.
(entry_name_to_varname): New function.
(pk_map_remove_entry): Delete by entry name, not variable name.
* testsuite/poke.cmd/maps-4.pk: Adapt.
* testsuite/poke.cmd/maps-5.pk: Likewise.
* testsuite/poke.cmd/maps-6.pk: Likewise.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (pk_map_load_file): Make sure a map is not already
loaded with the same name.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (pk_map_load_file): Derive the name of the new map
from the filename.
* poke/pk-cmd-map.c (pk_cmd_map_load): Remove spurious comment.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (poke_prompt_maps): Define.
* poke/pk-repl.c (pk_prompt): New function.
* poke/pk-cmd-set.c (set_prompt_maps): Define.
(set_cmds): Add set_prompt_maps.
(pk_cmd_set_prompt_maps): New function.
* poke/pk-cmd-map.c (pk_cmd_map_create): Do not assume a current
IOS exists.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-ios.h: New file.
* poke/pk-ios.c: Likewise.
* poke/Makefile.am (poke_SOURCES): Add pk-ios.h and pk-ios.c.
* poke/pk-cmd-ios.c (pk_cmd_file): Use pk_open_ios.
* poke/poke.c (NO_AUTO_MAP_ARG): Define.
(long_options): Add no-auto-map info.
(parse_args_1): Handle NO_AUTO_MAP_ARG.
(parse_args_2): Likewise.
(print_help): Document --no-auto-map.
(parse_args_2): Use pk_open_ios to open files specified in the
command line.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (poke_auto_map_p): Define.
* poke/poke.h: Likewise.
* poke/pk-cmd-set.c (set_auto_map): Define.
(set_cmds): Add set_auto_map.
(pk_cmd_set_auto_map): New function.
* poke/pk-cmd-ios.c (pk_cmd_file): Acknowledge poke_auto_map_p.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h (pk_array_nelem): Prototype.
* libpoke/pk-val.c (pk_array_nelem): New function.
* poke/poke.pk (auto_map): Define.
* poke/pk-cmd-ios.c (pk_cmd_file): Process auto maps.
* poke/pk-map.c (pk_map_create): Fix chaining of map-ios.
2020-05-17 Bruno Haible <bruno@clisp.org>
build: Bump minimum needed Automake version.
* bootstrap.conf (buildreq): Require automake >= 1.16.
2020-05-16 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pvm.c: Remove include xalloc.h.
(pvm_init): Use calloc instead of xzalloc.
2020-05-16 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pkl-parser.c: Remove include xalloc.h.
(pkl_parser_init): Use calloc instead of xzalloc.
(pkl_parse_file): Use strdup instead of xstrdup.
Allocate and check memory early in the function.
(pkl_parse_buffer): Use strdup instead of xstrdup.
Allocate and check memory early in the function.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* maps/Makefile.am (dist_maps_DATA): Distribute mp3.map.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.c (pk_map_load_parsed_map): Use pk_type_code and
pk_typeof.
(pk_map_resolve_map): Likewise.
(pk_map_load_parsed_map): Likewise.
* libpoke/libpoke.h (pk_make_array): Prototype.
(pk_make_integral_type): Likewise.
(pk_integral_type_size): Likewise.
(pk_integral_type_signed_p): Likewise.
(pk_make_string_type): Likewise.
(pk_make_offset_type): Likewise.
(pk_offset_type_base_type): Likewise.
(pk_offset_type_unit): Likewise.
(pk_make_any_type): Likewise.
(pk_make_array_type): Likewise.
(pk_array_type_etype): Likewise.
(pk_array_type_bound): Likewise.
(pk_val_typeof): Likewise.
(pk_type_code): Rename from pk_val_type.
(pk_array_elem_val): Prototype.
(pk_array_elem_boffset): Likewise.
* libpoke/pk-val.c (pk_make_integral_type): New function.
(pk_integral_type_size): Likewise.
(pk_integral_type_signed_p): Likewise.
(pk_make_array): Likewise.
(pk_make_string_type): Likewise.
(pk_make_offset_type): Likewise.
(pk_offset_type_base_type): Likewise.
(pk_offset_type_unit): Likewise.
(pk_make_any_type): Likewise.
(pk_make_array_type): Likewise.
(pk_array_type_etype): Likewise.
(pk_array_type_bound): Likewise.
(pk_val_typeof): Likewise.
(pk_type_code): Rename from pk_val_type.
(pk_array_elem_val): New function.
(pk_array_elem_boffset): Likewise.
2020-05-17 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.h (pkl_compile_call): Prototype.
* libpoke/pkl.c (pkl_compile_call): Define.
* libpoke/libpoke.h (PK_CLOSURE): Define.
(pk_call): Prototype.
* libpoke/libpoke.c (pk_call): Define.
* libpoke/pk-val.c (pk_val_type): Handle CLS values.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd.c (pk_cmd_init): Use pk_fatal.
* poke/poke.c (initialize): Likewise.
* poke/pk-term.c (pk_term_init): Likewise.
* poke/pk-mi.c (pk_mi_read_from_client): Likewise.
* poke/pk-hserver.c (make_socket): Likewise.
(hserver_thread_worker): Likewise.
(pk_hserver_init): Likewise.
(pk_hserver_shutdown): Likewise.
(pk_hserver_make_hyperlink): Likewise.
* poke/pk-mi.c (pk_mi_loop): Likewise.
(pk_mi_send): Likewise.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_fatal): Add missing newline after message error.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.h (pk_fatal): Prototype.
* poke/poke.c (pk_fatal): New function.
* poke/pk-map.h (pk_map_resolve_map): Prototype.
* poke/pk-map.c (pk_map_resolve_map): New function.
* poke/pk-cmd-map.c (pk_cmd_map_load): use pk_map_resolve_map.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* run.in (POKEMAPSDIR): Define.
* poke/poke.h (poke_mapsdir): Define.
* poke/poke.c (poke_mapsdir): New global.
(initialize): Initialize the value of poke_mapsdir.
(initialize): Load poke.pk.
* poke/poke.pk: New file.
* poke/Makefile.am (dist_pkgdata_DATA): Add poke.pk.
* HACKING: Update to mention poke.pk.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl.h (pkl_defvar): Prototype.
* libpoke/pkl.c (pkl_defvar): Define.
* libpoke/libpoke.h (pk_defvar): Prototype.
* libpoke/libpoke.c (pk_defvar): Define.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_SectionFlags): Improve pretty-printer.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (ltrim): Support character sets.
(rtrim): Likewise.
* doc/poke.texi (ltrim): Update.
(rtrim): Likewise.
* testsuite/poke.std/ltrim-1.pk: Renamed from ltrim.pk.
* testsuite/poke.std/rtrim-1.pk: Renamed from rtrim.pk.
* testsuite/poke.std/ltrim-2.pk: New test.
* testsuite/poke.std/rtrim-2.pk: Likewise.
* testsuite/poke.std/ltrim-3.pk: Likewise.
* testsuite/poke.std/rtrim-3.pk: Likewise.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (strchr): New function.
* doc/poke.texi (strchr): New section.
* testsuite/poke.std/strchr-3.pk: Likewise.
* testsuite/poke.std/strchr-2.pk: Likewise.
* testsuite/poke.std/strchr-1.pk: New test.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-parser.h (struct pkl_parser): New field
in_method_decl_p.
* libpoke/pkl-parser.c (pkl_parser_init): Initialize
in_method_decl_p.
* libpoke/pkl-tab.y (pushlevel_args): New rule.
(function_specifier): Use pushlevel_args.
(declaration): Set in_method_decl_p.
* libpoke/pkl-gen.c (pkl_gen_ps_var): The implicit struct argument
is the first formatl argument registered in the function, not the
last.
(pkl_gen_pr_ass_stmt): Likewise.
(pkl_gen_pr_func): Adapt to the fact the implicit argument is the
last actual passed but the first formal registered.
* testsuite/poke.pkl/struct-method-15.pk: New test.
* testsuite/poke.pkl/struct-method-diag-15.pk: Likewise.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/struct-method-12.pk: New test.
* testsuite/poke.pkl/struct-method-13.pk: Likewise.
* testsuite/poke.pkl/struct-method-14.pk: Likewise.
2020-05-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Rel): New type.
(SHT_REL): Define.
(SHF_WRITE): Likewise.
(SHF_ALLOC): Likewise.
(SHF_EXECINSTR): Likewise.
(SHF_MERGE): Likewise.
(SHF_STRINGS): Likewise.
(SHF_INFO_LINK): Likewise.
(SHF_LINK_ORDER): Likewise.
(SHF_OS_NONCONFORMING): Likewise.
(SHF_GROUP): Likewise.
(SHF_TLS): Likewise.
(SHF_COMPRESSED): Likewise.
(SHF_MASKOS): Likewise.
(SHF_MASKPROC): Likewise.
(Elf64_SectionFlags): New type.
2020-05-15 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pkl.c: Remove include xalloc.h.
(pkl_new): Use calloc instead of xzalloc.
(pkl_new): Free memory when returning NULL.
2020-05-15 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pkl-lex.l: Remove include xalloc.h.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_File): Rename from Elf64.
* maps/elf.map: Updated accordingly.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64.get_string): New method.
(Elf64.get_section_by_name): Likewise.
(Elf64.get_section_by_type): Likewise.
(elf_string): Delete function.
(elf_get_section_by_name): Likewise.
(elf_get_section_by_type): Likewise.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans1_ps_loop_stmt_iterator): New
handler.
(pkl_trans1_ps_loop_stmt): Likewise.
(pkl_phase_trans1): Register handlers.
* testsuite/poke.pkl/struct-method-10.pk: New test.
* testsuite/poke.pkl/struct-method-11.pk: Likewise.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.h: Document in the docstring of the function
pk_map_load_file that ERRMSG can be set to NULL even if an error
code is returned.
* poke/pk-cmd-map.c (pk_cmd_map_load): Adapt accordingly.
2020-05-15 Tim Rühsen <tim.ruehsen@gmx.de>
* cfg.mk: New syntax rule sc_rockdabootism_missing_space.
* common/pk-utils.c (pk_print_binary): Add missing space before
opening bracket.
* common/pk-utils.h (pk_str_concat): Likewise.
* libpoke/ios.c (ios_read_int_common): Likewise.
(ios_read_int). Likewise.
* libpoke/pvm-val.c (pvm_print_val_1): Likewise.
* poke/pk-cmd-set.c (pk_cmd_set_odepth): Likewise.
(pk_cmd_set_oindent): Likewise.
(pk_cmd_set_omode): Likewise.
* poke/pk-hserver.c (pk_hserver_make_hyperlink): Likewise.
* poke/pk-mi.c (pk_mi_fd_set_nonblocking): Likewise.
(pk_mi_fd_restore_blocking): Likewise.
* poke/pk-repl.c (poke_sigint_handler): Likewise.
(pk_repl): Likewise.
* libpoke/pkl-lex.l: Likewise.
* poke/pk-map-lex.l: Likewise.
* poke/poke.c: Slightly amend comment.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64): New type.
* maps/elf.map: Rewritten to use Elf64.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map-tab.y (pk_map_parse_file): Fix call to
pk_map_tab_set_extra.
2020-05-15 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-rt.pk (iosize): Argument defaults to the current
IOS.
* poke/pk-cmd.c (pk_cmd_exec): Use new interface of
pk_compile_statement.
* .x-sc_space_tab: Add poke/pk-map-tab.y and poke/pk-map-lex.l.
* poke/pk-term.h (pk_vprintf): Define.
* poke/pk-term.c (pk_vprintf): Likewise.
* poke/Makefile.am (AM_YFLAGS): Define.
(AM_LFLAGS): Likewise.
(EXTRA_DIST): Likewise.
(BUILT_SOURCES): Likewise.
* poke/pk-map-lex.l: Likewise.
* poke/Makefile.am (poke_SOURCES): Add pk-map-parser.h and
pk-map-tab.y.
* maps/elf.map: Adapted to use %-directives.
* maps/mp3.map: Likewise.
* etc/poke-map-mode.el (poke-map-mode): Highlight %-directives
entries.
* poke/pk-map.c (pk_map_load_file): Define.
* poke/pk-map-tab.y: New file.
* poke/pk-map-parser.h: Likewise.
2020-05-14 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/ios.c: Remove include xalloc.h.
(ios_open): Use malloc with error checking.
(realloc_string): New helper function.
(ios_read_string): Use realloc_string instead xrealloc.
* libpoke/ios.h: New define IOS_ENOMEM.
* libpoke/pvm.jitter: Raise PVM_E_IO when out of memory.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/ios-dev-mem.c (ios_dev_mem_open): Replace
xzalloc by calloc.
(ios_dev_mem_pwrite): Replace xrealloc with realloc.
Remove include xalloc.h.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/ios-dev-nbd.c (ios_dev_nbd_open): Replace
xmalloc and xstrdup by malloc and strdup.
Remove include xalloc.h.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/ios-dev-file.c (ios_dev_file_open): Replace
xmalloc and xstrdup by malloc and strdup.
Remove include xalloc.h.
2020-05-12 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios.c (ios_close): Update the current IOS
only when closing the current IOS.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (libpvmjitter_la_CPPFLAGS): Do not
-D_GNU_SOURCE.
* libpoke/pvm.jitter: Include config.h in initial-header-c,
initial-vm1-c and initial-vm2-c now that Jitter supports it.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Struct Constructors): Fix typo in example.
2020-05-12 Tim Rühsen <tim.ruehsen@gmx.de>
* cfg.mk: Add sc_jemarchism_file_fd syntax-check rule.
2020-05-12 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pkl-ast.c (pkl_ast_lvalue_p): Rename 'FILE *fd'
to 'FILE *fp'.
(pkl_ast_print_1): Likewise.
(pkl_ast_print): Likewise.
* libpoke/pkl-ast.h (pkl_ast_print): Likewise.
* libpoke/pkl-diag.c (pkl_detailed_location): Likewise.
* libpoke/pkl-parser.c (pkl_parse_file): Likewise.
* libpoke/pkl-parser.h (pkl_parse_file): Likewise.
* libpoke/pkl-tab.y (load_module): Likewise.
* libpoke/pkl.c (pkl_compile_file): Likewise.
* poke/pk-cmd-editor.c (pk_cmd_editor): Likewise.
* poke/pk-cmd.c (pk_cmd_exec_script): Likewise.
2020-05-12 Tim Rühsen <tim.ruehsen@gmx.de>
* poke/pk-mi.c (pk_mi_fd_set_nonblocking): New function.
(pk_mi_fd_restore_blocking): New function.
(pk_mi_loop): Set fd to blocking and restore before returning.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-map.h (pk_map_remove): New prototype.
* poke/pk-map.c (pk_map_remove): Define.
(free_map): Likewise.
* poke/pk-cmd-map.c (pk_cmd_map_remove): Define.
(map_remove_cmd): Define.
(map_cmds): Add map_remove_cmd.
* testsuite/poke.cmd/maps-7.pk: New test.
* testsuite/poke.cmd/maps-8.pk: Likewise.
* testsuite/poke.cmd/maps-9.pk: Likewise.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-map.c (map_entry_add_cmd): Rename from map_add_cmd.
(map_entry_remove_cmd): Rename from map_remove_cmd.
(map_entry_cmds): Define.
(map_entry_cmd): Likewise.
* poke/pk-cmd.c (pk_cmd_init): Initialize map_entry_trie.
(pk_cmd_shutdown): Free map_entry_trie.
* testsuite/poke.cmd/maps-4.pk: Adapt.
* testsuite/poke.cmd/maps-6.pk: Likewise.
* testsuite/poke.cmd/maps-5.pk: Likewise.
2020-05-12 Tim Rühsen <tim.ruehsen@gmx.de>
* poke/pk-mi.c (pk_mi_read_from_client): Fix nbytes to ssize_t.
(pk_mi_dispatch_msg): Fix empty else block.
2020-05-12 Tim Rühsen <tim.ruehsen@gmx.de>
* pickles/Makefile.am: Add id3v1.pk to dist_pickles_DATA.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (pk_print_val): New function.
* libpoke/libpoke.c (pk_decl_val): Define.
* (pk_decl_p): New function.
* poke/pk-map.c: New file.
* poke/pk-map.h: Likewise.
* poke/pk-cmd-map.c: Likewise.
* poke/poke.c (initialize): Call pk_map_init.
(finalize): Call pk_map_shutdown.
* poke/Makefile.am (poke_SOURCES): Add pk-map.c and pk-cmd-map.c
* poke/pk-cmd-info.c (info_cmds): Add info_map_cmd.
* maps/Makefile.am: New file.
* maps/elf.map: Likewise.
* maps/mp3.map: Likewise.
* Makefile.am (SUBDIRS): Add maps.
* configure.ac: Add maps/Makefile.
* etc/poke-map-mode.el: Likewise.
* testsuite/poke.cmd/maps-1.pk: New test.
* testsuite/poke.cmd/maps-2.pk: Likewise.
* testsuite/poke.cmd/maps-3.pk: Likewise.
* testsuite/poke.cmd/maps-4.pk: Likewise.
* testsuite/poke.cmd/maps-5.pk: Likewise.
* testsuite/poke.cmd/maps-6.pk: Likewise.
* HACKING: Updated.
2020-05-12 Tim Rühsen <tim.ruehsen@gmx.de>
* gui/Makefile.am: Use dist_guifiles_DATA instead guifiles_DATA.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (EXTRA_DIST): Complete.
2020-05-12 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Import the signal-h gnulib
module.
2020-05-11 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (libpoke_la_SOURCES): Add pk-val.c
* libpoke/pvm-val.h: Include stdint.h.
* libpoke/pk-val.c: New file.
* libpoke/libpoke.h (pk_val): New type.
(PK_NULL): Define.
(pk_make_int): Likewise.
(pk_int_value): Likewise.
(pk_int_size): Likewise.
(pk_make_uint): Likewise.
(pk_uint_value): Likewise.
(pk_uint_size): Likewise.
(pk_make_string): Likewise.
(pk_string_str): Likewise.
(pk_make_offset): Likewise.
(pk_offset_magnitude): Likewise.
(pk_offset_unit): Likewise.
(pk_val_mapped_p): Likewise.
(pk_val_ios): Likewise.
(pk_val_offset): Likewise.
(PK_UNKNOWN): Likewise.
(PK_INT): Likewise.
(PK_UINT): Likewise.
(PK_STRING): Likewise.
(PK_OFFSET): Likewise.
(PK_ARRAY): Likewise.
(PK_STRUCT): Likewise.
(pk_val_type): Likewise.
2020-05-11 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-cmd-misc.c: Renamed from pk-misc.c.
* poke/pk-cmd-info.c: Likewise.
* poke/pk-cmd-ios.c: Likewise.
* poke/pk-cmd-help.c: Likewise.
* poke/pk-cmd-vm.c: Likewise.
* poke/pk-cmd-set.c: Likewise.
* poke/pk-cmd-editor.c: Likewise.
* poke/pk-cmd-def.c: Likewise.
* poke/Makefile.am (poke_SOURCES): Rename files.
2020-05-11 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (picklesdir): Define.
(dist_pickles_DATA): Change from dist_pkgdata_DATA.
* poke/poke.c (initialize): Set poke_picklesdir to
poke_datadir/pickles.
* libpoke/pkl-rt.pk: Add %DATADIR%/pickles to the load-path if
POKEPICKLESDIR is not defined.
2020-05-10 Jose E. Marchesi <jemarch@gnu.org>
* gui/pk-gui.tcl: Expand "about" info with copyright notice and
licensing.
2020-05-10 Bruno Haible <bruno@clisp.org>
Prepare for versioning of libpoke.
* libpoke/Makefile.am (LTV_*): New variables.
(libpoke_la_LDFLAGS): Add -version-info option.
2020-05-10 John Darrington <john@darrington.wattle.id.au>
* poke/poke.c (mi_supported_p): New variable.
* poke/poke.c (POKE_MI): Evaluate this macro once only.
2020-05-10 Bruno Haible <bruno@clisp.org>
Fix wrong rpath in poke/.libs/lt-poke.
* poke/Makefile.am (poke_LDADD): Use LTLIBTEXTSTYLE, not LIBTEXTSTYLE.
2020-05-10 Jose E. Marchesi <jemarch@gnu.org>
* gui: rename scripts.
2020-05-10 Jose E. Marchesi <jemarch@gnu.org>
* m4/tcl.m4: Strip from unneeded macros.
(POKE_TCLTK): New macro.
* configure: Use POKE_TCLTK.
2020-05-10 Jose E. Marchesi <jemarch@gnu.org>
* m4/tcl.m4: New file.
* .x-sc_m4_quote_check: New file.
* .x-sc_prohibit_always_true_header_tests: Likewise.
* .x-sc_prohibit_magic_number_exit: Likewise.
* .x-sc_prohibit_test_minus_ao: Likewise.
* .x-sc_useless_cpp_parens: Likewise.
* .x-sc_space_tab: Add m4/tcl.m4.
2020-05-10 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am (-DLOCALEDIR): Add to CPPFLAGS.
* poke-gui.c (print_version): Call bindtextdomain.
2020-05-10 Jose E. Marchesi <jemarch@gnu.org>
* gui: Renamed from PoK.
* Makefile.am (SUBDIR): Add gui.
* configure.ac (AC_CONFIG_FILES): Add gui/Makefile.
Support for --enable-gui.
* run.in (POKEGUIDIR): Define and export POKEGUIDIR.
* bootstrap.conf (bootstrap_post_import_hook): Create gl-gui.
(gui_modules): Define.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (MI Requests): New section.
(MI Responses): Likewise.
(MI Events): Likewise.
(Event INITIALIZE): Likewise.
(Request EXIT): Likewise.
(Response EXIT): Likewise.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* poke/pk-mi-msg.h (pk_mi_msg_event_initialized_mi_version):
Define.
* poke/pk-mi-msg.c (pk_mi_msg_event_initialized_mi_version):
Likewise.
* poke/pk-mi-msg.c (PK_MI_EVENT_INITIALIZED_MI_VERSION): Define.
(struct pk_mi_event): New field args.initialized.mi_version.
(pk_mi_make_event_initialized): Set the MI version.
* poke/pk-mi-json.c (pk_mi_msg_to_json_object): Do not add a
poke_mi field.
(pk_mi_msg_to_json_object): Add mi_version as an argument to the
initialized event.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (PoK Dependencies): Update.
* poke/pk-mi-msg.h (pk_mi_set_msg_number): Define.
* poke/pk-mi-msg.c (pk_mi_set_msg_number): Likewise.
* poke/pk-mi-json.c (pk_mi_msg_to_json_object): Add the message
number to the json structure.
(pk_mi_json_object_to_msg): Likewise.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/Makefile.am (AUTOMAKE_OPTIONS): Use the subdir-objects
automake option.
* poke/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am (SUBDIRS): Remove libutils-gl and libutils.
* configure.ac (AC_CONFIG_FILES): Remove libutils files.
(AC_CONFIG_MACRO_DIRS): Do not add m4/libutils.
Do not call libutils_EARLY.
* libutils/Makefile.am: Remove.
* bootstrap.conf (bootstrap_post_import_hook): Do not create a
gl-libutils gnulib.
* libpoke/Makefile.am (libpoke_la_LIBADD): Remove libutils.la.
* poke/Makefile.am (poke_LDADD): Likewise.
* common: Renamed from libutils.
* HACKING: Update.
* .gitignore: Update.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libpoke_modules): Import the dirname gnulib
module.
* libpoke/pkl.h (pkl_module_loaded_p): Define.
* libpoke/pkl.c (struct pkl_compiler): New fields `modules' and
`num_modules'.
(pkl_new): Initialize `modules' and `num_modules'.
(pkl_load): Do not re-load already loaded modules.
(pkl_add_module): New function.
(pkl_free): Free memory occupied by the list of loaded modules.
* libpoke/pkl-tab.y (load_module): Likewise.
* testsuite/poke.pkl/load-3.pk: Amended.
* poke/pk-ios.c (pk_cmd_load_file): Use pk_load instead of
pk_compile_file.
2020-05-09 Jose E. Marchesi <jemarch@gnu.org>
* MI foundations.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* poke/pk-ios.c (pk_cmd_load_file): Amend OOM message to
be the same everywhere ("No memory" to "Out of memory").
(pk_cmd_mem): Likewise.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* poke/pk-cmd.c: Do not include gettext.h and pk-term.h.
* poke/pk-def.c: Likewise.
* poke/pk-ios.c: Likewise.
* poke/pk-repl.c: Likewise.
* poke/pk-set.c: Likewise.
* poke/pk-editor.c: Do not include pk-term.h.
* poke/pk-hserver.c: Likewise.
* poke/pk-misc.c: Likewise.
* poke/pk-vm.c: Likewise.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* poke/poke.h: New function pk_assert_alloc.
Include stdlib.h, gettext.h and pk-term.h.
* poke/poke.c (initialize_user): Make use of pk_assert_alloc.
Remove including gettext.h and pk-term.h.
2020-05-07 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/ios.c (ios_open): Initialize error variable.
* libpoke/ios-dev-file.c (ios_dev_file_handler_normalize):
Return NULL on memory allocation error.
* libpoke/ios-dev-mem.c (ios_dev_mem_handler_normalize): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_handler_normalize): Likewise.
2020-05-06 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Remove xstrndup from libpoke_modules.
* libpoke/pkl-trans.c (pkl_trans1_ps_print_stmt): Use strndup
instead of xstrndup.
2020-05-06 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pkl-fold.c (OP_BINARY_SSS): Check return value of
pk_str_concat.
* libpoke/pkl.c (pkl_new): Likewise.
* poke/pk-cmd.c (pk_cmd_exec): Likewise.
* poke/poke.c (initialize_user): Likewise.
2020-05-06 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Remove xalloc from libutils_modules.
* libutils/pk-utils.c (pk_str_concat): Use malloc instead of xmalloc.
2020-05-05 Tim Rühsen <tim.ruehsen@gmx.de>
* .gitignore: Add /gl-libpoke.
* Makefile.am: Add gl-libpoke to SUBDIRS.
* bootstrap.conf: Invoke gnulib-tool to generate gl-libpoke.
Cleanup gnulib module lists.
Remove --lgpl=3 from gnulib-tool invocation.
* configure.ac: Add m4/libpoke to AC_CONFIG_MACRO_DIRS.
Add libpoke_EARLY.
Add gl-libpoke/Makefile to AC_CONFIG_FILES.
* libpoke/Makefile.am: Use gl-libpoke/libgnu.la in libpoke_la_LIBADD.
2020-05-05 Jose E. Marchesi <jose.marchesi@oracle.com>
* bootstrap.conf: libutils is GPLv3+.
2020-05-05 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (libutils_modules): Add xalloc.
2020-05-05 Tim Rühsen <tim.ruehsen@gmx.de>
* .gitignore: Add /gl-libutils.
* Makefile.am: Add gl-libutils to SUBDIRS.
* bootstrap.conf: Invoke gnulib-tool to generate gl-libutils.
* configure.ac: Add m4/libutils to AC_CONFIG_MACRO_DIRS.
Add libutils_EARLY.
Add gl-libutils/Makefile to AC_CONFIG_FILES.
* libutils/Makefile.am: Use gl-libutils/libgnu.la in libutils_la_LIBADD.
2020-05-05 Darshit Shah <darnir@gnu.org>
* poke/Makefile.am: Merge two ifdef blocks into one. (Purely cosmetic)
2020-05-05 Darshit Shah <darnir@gnu.org>
* m4/libtextstyle-hyperlink.m4: Use an action-if-true to prevent adding it to LIBS
AC_SEARCH_LIBS will add the library to LIBS if action-if-true is empty.
We prevent that by adding an action-if-true, and manually including
LTLIBTEXTSTYLE in the libraries for Poke. This allows libpoke.so to be
build without linking against libtextstle.
2020-05-05 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (complete_struct): Add parentheses in
expression to avoid a compiler warning.
2020-05-05 Jose E. Marchesi <jemarch@gnu.org>
* pickles/future/bson.pk: Minor fixes.
2020-05-04 Tim Rühsen <tim.ruehsen@gmx.de>
* HACKING: Fix some URLs from http: to https:
2020-05-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.c (complete_struct): Fix completion of normal
fields, and add support for completing method names as well.
* libpoke/pkl-ast.c (pkl_struct_type_traverse): Revert changes
from commit 9e0206681.
* testsuite/poke.repl/repl.exp (tab-completion-struct-field-1):
New test.
(tab-completion-struct-field-2): Likewise.
(tab-completion-struct-field-3): Likewise.
2020-05-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-anal.h (struct pkl_anal_payload): New fields context
and next_context.
(pkl_anal_init_payload): Define.
(PKL_ANAL_NO_CONTEXT): Likewise.
(PKL_ANAL_CONTEXT_STRUCT_TYPE): Likewise.
(PKL_ANAL_CONTEXT_METHOD): Likewise.
* libpoke/pkl.c (rest_of_compilation): Use pkl_anal_init_payload.
* libpoke/pkl-lex.l: Process METHOD.
* lib/pkl-tab.y (declaration): Use defun_or_method and annotate
function nodes as methods accordingly.
(defun_or_method): New rule.
(IS_DEFUN): Define.
(IS_METHOD): Likewise.
* libpoke/pkl-ast.h (PKL_AST_DECL_IN_STRUCT_P): Define.
(struct pkl_ast_decl): New field in_struct_p.
* libpoke/pkl-trans.c (pkl_trans1_pr_decl): Do not annotate
functions as methods.
Annotate declarations in struct types.
* libpoke/std.pk (POSIX_Time64): Turn defun into method.
(POSIX_Time32): Likewise.
* pickles/id3v1.pk: Likewise.
* pickles/bpf.pk: Likewise.
* pickles/btf.pk: Likewise.
* pickles/ctf.pk: Likewise.
* pickles/elf.pk: Likewise.
* pickles/leb128.pk: Likewise.
* libpoke/pkl-anal.c (pkl_anal1_pr_decl): New handler.
(pkl_phase_anal1): Register handler.
(pkl_anal1_ps_var): methods can only be referenced as variables
from other methods, nor other defuns. Allow for regular functions
to refer to struct fields as variables.
(pkl_anal1_ps_ass_stmt): New handler.
(pkl_phase_anal1): Install handler.
(pkl_anal1_ps_type_struct): Update error message to reflect
methods.
(PKL_ANAL_CONTEXT): Define.
(PKL_ANAL_CONTEXT_PUSH_STRUCT_TYPE): Likewise.
(PKL_ANAL_POP_CONTEXT): Likewise.
(pkl_anal1_pr_type_struct): New handler.
(pkl_anal1_ps_type_struct): Pop analysis context.
(pkl_anal1_pr_func): New handler.
(pkl_phase_anal1): Register new handlers.
* libpoke/pkl-gen.pks (struct_mapper): Do not register regular
defuns as methods.
(struct_constructor): Likewise.
* libpoke/pkl-typify.c (pkl_typify1_ps_struct_ref): Do not allow
referring to non-methods in srefs.
* doc/poke.texi: Update.
* testsuite/poke.map/maps-structs-methods-11.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-10.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-9.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-8.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-7.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-6.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-5.pk (ULEB_128): Likewise.
* testsuite/poke.map/maps-structs-methods-4.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-3.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-2.pk (Foo): Likewise.
* testsuite/poke.map/maps-structs-methods-1.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-pretty-print-4.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-pretty-print-3.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-pretty-print-2.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-pretty-print-1.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-6.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-5.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-4.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-3.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-2.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-1.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-8.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-7.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-6.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-5.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-4.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-3.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-2.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-1.pk (Foo): Likewise.
* testsuite/poke.pkl/scons-23.pk (Bar): Likewise.
* testsuite/poke.pkl/scons-19.pk (Foo): Likewise.
* testsuite/poke.pkl/scons-18.pk (BPF_Reg): Likewise.
* testsuite/poke.pkl/optcond-17.pk (Foo): Likewise.
* testsuite/poke.pkl/optcond-16.pk (Foo): Likewise.
* testsuite/poke.pkl/optcond-12.pk (Foo): Likewise.
* testsuite/poke.pkl/struct-method-diag-7.pk: New test.
* testsuite/poke.pkl/struct-method-diag-8.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-9.pk: Likewise.
* testsuite/poke.pkl/sref-diag-1.pk: Likewise.
* testsuite/poke.pkl/sref-diag-2.pk: Likewise.
* testsuite/poke.pkl/struct-types-defun-1.pk: Likeiwse.
* testsuite/poke.pkl/struct-types-defun-2.pk: Likewise.
* testsuite/poke.pkl/struct-types-defun-3.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-10.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-11.pk: Likewise.
* testsuite/poke.pkl/optcond-18.pk: Likewise.
* testsuite/poke.pkl/optcond-19.pk: Likewise.
* testsuite/poke.pkl/optcond-20.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-5.pk: Likewise.
* testsuite/poke.pkl/struct-types-defun-diag-1.pk: Likewise.
* testsuite/poke.pkl/struct-types-defun-diag-2.pk: Likewise.
* testsuite/poke.pkl/struct-method-9.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-12.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-13.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-14.pk: Likewise.
2020-05-04 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (initialize): Exit if there is an error initializing
the poke incremental compiler.
* libpoke/libpoke.c (pk_compiler_new): Acknowledge errors from
pvm_init and pkl_new.
2020-05-04 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/libpoke.h: Little fixes in comments.
2020-05-03 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/pk-utils.c (pk_print_binary): Format args GNU-style.
2020-05-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/Makefile.am (poke.text): Generate in builddir, not in
srcdir.
(nodelist): Likewise. Also avoid $@.
(clean-local): Remove nodelist and poke.text.
* poke/poke.c (poke_docdir): New variable.
(initialize): Initialize poke_docdir.
* poke/pk-misc.c (doc_completion_function): Use poke_docdir to
find the nodelist file.
(pk_cmd_doc): Likewise for the poke.text file.
* run.in (POKEDOCDIR): Set to top_builddir/doc.
* testsuite/Makefile.am (check-DEJAGNU): Set POKEDOCDIR.
2020-05-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-trans.c (pkl_trans3_ps_of_sizeof): Remove stale
debugging trace.
2020-05-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.h (struct pkl_gen_payload): New field
generating_pvm_struct_type.
* libpoke/pkl-gen.c (pkl_gen_pr_decl): Break the pass if
generating a pvm struct type.
(pkl_gen_pr_type_struct): Set generating_pvm_struct_type.
(pkl_gen_ps_type_struct): Clear generating_pvm_struct_type.
* testsuite/poke.pkl/arrays-13.pk: New test.
2020-05-03 Tim Rühsen <tim.ruehsen@gmx.de>
* libutils/Makefile.am: New file.
2020-05-03 Tim Rühsen <tim.ruehsen@gmx.de>
* Makefile.am: Add libutils to SUBDIRS.
* configure.ac: Add libutils/Makefile to AC_CONFIG_FILES.
* libutils/Makefile.am: New file.
* libpoke/pk-utils.c: Move to libutils/.
* libpoke/pk-utils.h: Likewise.
* libpoke/Makefile.am: Use libutils/libutils.la instead of
libpoke/libpokeutils.la.
* poke/Makefile.am: Likewise.
* po/POTFILES.in: Add libutils/pk-utils.[ch].
2020-05-03 Jose E. Marchesi <jemarch@gnu.org>
* pickles/id3v1.pk (ID3V1_Tag): Add setter and getter methods.
* testsuite/poke.id3v1/id3v1.exp: New testsuite.
* testsuite/poke.id3v1/id3v1-1.pk: New test.
* testsuite/poke.id3v1/id3v1-2.pk: Likewise.
* testsuite/poke.id3v1/id3v1-3.pk: Likewise.
* testsuite/poke.id3v1/id3v1-4.pk: Likewise.
* testsuite/poke.id3v1/id3v1-5.pk: Likewise.
* testsuite/poke.id3v1/id3v1-6.pk: Likewise.
* testsuite/poke.id3v1/id3v1-7.pk: Likewise.
* testsuite/poke.id3v1/id3v1-8.pk: Likewise.
* testsuite/poke.id3v1/id3v1-9.pk: Likewise.
* doc/poke.texi (Audio): New chapter.
(MP3): New section.
(ID3V1 Tags): New subsection.
2020-05-03 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/Makefile.am: Add libgnu.la to libpoke_la_LIBADD.
* libpoke/pkl-fold.c: Use fold_gcd instead gcd.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* libpoke/libpoke.h: Remove include of pk-utils.h.
Add include of stdint.h.
* libpoke/Makefile.am: Add libpokeutils.la to ib_LTLIBRARIES.
Remove pk-utils.h pk-utils.c from libpoke_la_SOURCES.
Add libpokeutils.la to libpoke_la_LIBADD.
Add assignments for libpokeutils_la.
* poke/Makefile.am: Add libpokeutils.la to poke_LDADD.
* poke/pk-cmd.c: Add include of pk-utils.h.
* poke/pk-cmd.h: Add include of stddef.h.
* poke/pk-editor.c: Add include of pk-utils.h.
* poke/pk-info.c: Likewise.
* poke/pk-ios.c: Likewise.
* poke/pk-misc.c: Likewise.
* poke/pk-set.c: Likewise.
* poke/poke.c: Likewise.
2020-05-03 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/std.pk (stoca): Define.
* testsuite/poke.std/stoca-1.pk: New test.
* testsuite/poke.std/stoca-2.pk: Likewise.
* testsuite/poke.std/stoca-3.pk: Likewise.
* testsuite/poke.std/stoca-4.pk: Likewise.
* doc/poke.texi (stoca): New section.
2020-05-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Writing Pickles): New chapter.
(Setters and Getters): Likewise.
2020-05-03 John Darrington <john@darrington.wattle.id.au>
* poke/pk-cmd.c: Reduce scope of local variables.
2020-05-03 John Darrington <john@darrington.wattle.id.au>
* poke/pk-cmd.c (pk_cmd_get_next_match): Fix bug in completer.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/id3v1.pk (ID3V1_Tag): Text-stylize the output of the
pretty-printer.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Support field variables
in l-values in methods.
* testsuite/poke.pkl/struct-method-8.pk: New test.
* testsuite/poke.map/maps-structs-methods-11.pk: Likewise.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/id3v1.pk: Moved from future/.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* poke/Makefile.am (poke_CPPFLAGS): Adjust to lib->libpoke.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* poke: renamed from src.
* libpoke: renamed from lib.
* Makefile.am (SUBDIRS): Update accordingly.
* configure.ac: Likewise.
* doc/Makefile.am: Likewise.
* poke/Makefile.am: Likewise.
* run.in: Likewise.
* testsuite/lib/poke.exp: Likewise.
* testsuite/Makefile.am: Likewise.
* HACKING: Likewise.
* .gitignore: Likewise.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* lib/pk-utils.c: Remove pkt.h from includes.
(pk_print_binary): Add string output function as first param.
* lib/pk-utils.h (pk_print_binary): Likewise.
* lib/pvm-val.c (pvm_print_val_1): Add pk_puts as first param
when calling pk_print_binary.
* lib/pvm.jitter: Likewise.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm.jitter (PVM_POKE): Use the current IO space if PVM_NULL
is passed as the IOS.
(PVM_PEEK): Likewise.
* testsuite/poke.pkl/ios-cur-1.pk: New test.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c: Add macro is_command.
(pk_cmd_exec): Use IS_COMMAND to check for command.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (pk_cmd_exec): Fix params to strncmp.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-gen.c (pkl_gen_pr_func): Fix typo in comment.
2020-05-02 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-anal.c (pkl_anal1_ps_var): New handler.
(pkl_phase_anal1): Register handler.
* lib/pkl-trans.h (struct pkl_trans_payload): New field
`function_back'.
* lib/pkl-ast.h (PKL_AST_FUNC_METHOD_P): Define.
(struct pkl_ast_func): New field method_p.
(PKL_AST_VAR_FUNCTION): Define.
(PKL_AST_VAR_FUNCTION_BACK): Likewise.
(struct pkl_ast_var): New fields `function' and `function_back'.
* lib/pkl-ast.c (pkl_ast_print_1): Print the method_p attribute of
function ast nodes.
* lib/pkl-tab.y (function_specifier): Always introduce a lexical
environment for function arguments.
* lib/pkl-trans.c (pkl_trans1_pr_decl): Annotate functions as
methods whenever appropriate.
(PKL_TRANS_PUSH_FUNCTION): reset the function_back to 0.
(PKL_TRANS_FUNCTION_BACK): Define.
(PKL_TRANS_INCR_FUNCTION_BACK): Likewise.
(PKL_TRANS_DECR_FUNCTION_BACK): Likewise.
(pkl_trans1_pr_comp_stmt): New handler.
* lib/pkl-gen.c (pkl_gen_pr_func): Acknowledge the implicit first
argument in methods.
(pkl_gen_ps_func): Likewise.
* lib/pvm-val.c (pvm_call_pretty_printer): Pass the struct as an
argument to the pretty-printer.
* pickles/bpf.pk: Adap to obey new rules for methods.
* testsuite/poke.pkl/struct-method-2.pk: New test.
* testsuite/poke.pkl/struct-method-3.pk: Likewise.
* testsuite/poke.pkl/struct-method-4.pk: Likewise.
* testsuite/poke.pkl/struct-method-5.pk: Likewise.
* testsuite/poke.pkl/struct-method-6.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-1.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-2.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-3.pk: Likewise.
* testsuite/poke.pkl/struct-types-5.pk: Adapt.
* testsuite/poke.pkl/struct-types-4.pk: Likewise.
* testsuite/poke.map/maps-unions-6.pk: Likewise.
* testsuite/poke.map/maps-structs-12.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-10.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-9.pk: Likewise.
* testsuite/poke.pkl/struct-method-8.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-4.pk: Likewise.
* testsuite/poke.pkl/struct-method-7.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-5.pk: Likewise.
* testsuite/poke.pkl/struct-method-diag-6.pk (Foo): Likewise.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Remove useless code.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* src/pk-misc.c (pk_cmd_doc): Reduce scope of local variables.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-repl.c (pk_repl): Remove unused variable.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (pk_cmd_exec_1): Narrow variable scope
and fix compiler warning with it.
2020-05-02 Tim Rühsen <tim.ruehsen@gmx.de>
* etc/git-hooks/pre_push: Make syntax-check only if needed.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Conditional Expressions): Add indices.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Use @dots{} instead of ...
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Add italic markup on latin loan words.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Don't indent in the middle of a paragraph
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* src/pk-repl.c (escape_metacharacters): Add comment.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* lib/libpoke.c (pk_completion_function): Improve comments and
parameter naming.
* lib/libpoke.c (pk_ios_completion_function): Ditto.
* lib/libpoke.h (pk_completion_function): Ditto.
* lib/libpoke.h (pk_ios_completion_function): Ditto.
* src/pk-rep.c (poke_completion_function): Ditto.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (pk_cmd_get_next_match): Remove parameter
idx and use a static local instead.
* src/pk-cmd.h (pk_cmd_get_next_match): Remove parameter
idx.
* src/pk-repl.c (poke_completion_function): Adjust call
to pk_cmd_get_next_match.
2020-05-02 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Poking Structs): Replace "Lets" with "Let's".
* cfg.mk (sc_jemarchism.z): New rule.
* cfg.mk (local-checks-available): Add it.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/optcond-16.pk: New test.
* testsuite/poke.pkl/optcond-17.pk: Likewise.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (The Color Registry): Fix example.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/color.pk: Reduce, and add comments.
* pickles/rgb24.pk: New file.
* pickles/Makefile.am (dist_pkgdata_DATA): Add rgb24.pk.
* testsuite/poke.rgb24/rgb24.exp: New testsuite.
* testsuite/poke.rgb24/rgb24-1.pk: New test.
* doc/poke.texi (RGB24 Encoding): New section.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/color.pk: New file.
* pickles/Makefile.am (dist_pkgdata_DATA): Add color.pk.
* testsuite/poke.color/color.exp: New testsuite.
* testsuite/poke.color/color-1.pk: New test.
* testsuite/poke.color/color-2.pk: Likewise.
* testsuite/poke.color/color-3.pk: Likewise.
* testsuite/poke.color/color-4.pk: Likewise.
* doc/poke.texi (Colors): New chapter.
(The Color Registry): New section.
* HACKING (Testing Pickles): New section.
(Writing Documentation): New chapter.
(Documenting Pickles): New section.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: update the libtool call for gdb line.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Poking Structs): New section.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-gen.c: Remove trailing whitespaces.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-gen.c (pkl_gen_pr_if_stmt): Optimize constant
expressions in conditional statements.
* testsuite/poke.pkl/if-4.pk: New test.
* testsuite/poke.pkl/if-5.pk: Likewise.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* lib/libpoke.c (pk_disassemble_function): Do not destroy the
disassembled program.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-gen.c (pkl_gen_pr_comp_stmt): Optimize empty compound
statements away.
2020-05-01 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-gen.c (pkl_gen_pr_loop_stmt): Optimize while(0) and
while(1).
2020-05-01 Tim Rühsen <tim.ruehsen@gmx.de>
* po/POTFILES.in: Move lib/pk-term.[ch] to src/
2020-04-30 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: Document lib/pkt.h.
2020-04-30 Jose E. Marchesi <jemarch@gnu.org>
* lib/libpoke.h (pk_compiler_new): Remove the term_payload
argument.
* lib/libpoke.c (pk_compiler_new): Likewise.
* src/poke.c (initialize): Likewise.
2020-04-30 Jose E. Marchesi <jemarch@gnu.org>
* lib/libpoke.c (pk_compiler_new): Get new arguments term_if and
term_payload.
* lib/libpoke.h (pk_term_flush_fn): New type.
(pk_term_puts_fn): Likewise.
(pk_term_printf_fn): Likewise.
(pk_term_class_fn): Likewise.
(pk_term_end_class_fn): Likewise.
(pk_term_hyperlink_fn): Likewise.
(pk_term_end_hyperlink_fn): Likewise.
* src/pk-term.h: Moved from lib.
* src/pk-term.c: Likewise.
* src/Makefile.am (poke_SOURCES): Add pk-term.h and pk-term.c.
(poke_LDADD): Add libtextstyle.
* lib/Makefile.am (libpoke_la_LIBADD): Remove libtextstyle.
* lib/Makefile.am (libpoke_la_SOURCES): Remove pk-term.h and
pk-term.c.
(include_HEADERS): Remove pk-term.h.
* HACKING: Updated to reflect relocated sources.
* lib/pkt.h: New file.
* src/pk-cmd.c: Include pk-term.h.
* src/poke.c: Likewise.
* src/pk-vm.c: Likewise.
* src/pk-set.c: Likewise.
* src/pk-repl.c: Likewise.
* src/pk-misc.c: Likewise.
* src/pk-ios.c: Likewise.
* src/pk-hserver.c: Likewise.
* src/pk-editor.c: Likewise.
* src/pk-def.c: Likewise.
2020-04-30 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: Add lib/libpoke.[ch] to the source tree appendix.
2020-04-29 Jose E. Marchesi <jemarch@gnu.org>
* lib/Makefile.am (include_HEADERS): Add missing pk-utils.h and
pk-term.h.
2020-04-17 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.h (poke_compiler): Switch to type pk_compiler.
(poke_vm): Remove extern.
Do not include pkl.h.
Include libpoke.h.
* src/poke.c (finalize): Use pk_free_compiler.
(initialize): Use pk_compiler_new.
(poke_compiler): Switch to type pk_compiler.
(poke_vm): Remove global.
* lib/libpoke.h (pk_compiler): New type.
* lib/libpoke.c (pk_compiler_new): New function.
(pk_compiler_free): Likewise.
2020-04-15 Jose E. Marchesi <jemarch@gnu.org>
* lib/libpoke.h: New file.
* lib/libpoke.c: Likewise.
* lib/Makefile.am (include_HEADERS): Distribute libpoke.h.
(libpoke_la_SOURCES): Add libpoke.h and libpoke.c and remove
pkl-compiler.h.
* lib/pkl-compiler.h: Remove.
* lib/pvm.h: Mark function prototypes as hidden.
* lib/pkl.h: Likewise.
* lib/ios.h: Likewise.
2020-04-15 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl.h: Fix typo.
2020-04-15 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-compiler.h: New file.
* lib/pkl-asm.c: Include pkl-compiler.h
2020-04-15 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-tab.y (pkl_tab_error): Mark as static.
(pkl_register_arg): Likewise.
(pkl_register_args): likewise.
* lib/pkl-ast.h (pkl_ast_chainon): Set ELF visibility to hidden.
(pkl_ast_make_program): Likewise.
(pkl_ast_make_identifier): Likewise.
(pkl_ast_make_integer): Likewise.
(pkl_ast_make_string): Likewise.
(pkl_ast_make_array): Likewise.
(pkl_ast_make_array_initializer): Likewise.
(pkl_ast_make_struct): Likewise.
(pkl_ast_make_struct_field): Likewise.
(pkl_ast_make_unary_exp): Likewise.
(pkl_ast_make_binary_exp): Likewise.
(pkl_ast_make_cond_exp): Likewise.
(pkl_ast_make_enumerator): Likewise.
(pkl_ast_make_enum): Likewise.
(pkl_ast_make_func): Likewise.
(pkl_ast_make_func_arg): Likewise.
(pkl_ast_make_trimmer): Likewise.
(pkl_ast_make_indexer): Likewise.
(pkl_ast_make_struct_ref): Likewise.
(pkl_ast_make_struct_field_type): Likewise.
(pkl_ast_make_func_type_arg): Likewise.
(pkl_ast_make_named_type): Likewise.
(pkl_ast_make_integral_type): Likewise.
(pkl_ast_make_void_type): Likewise.
(pkl_ast_make_string_type): Likewise.
(pkl_ast_make_array_type): Likewise.
(pkl_ast_make_struct_type): Likewise.
(pkl_ast_make_offset_type): Likewise.
(pkl_ast_make_function_type): Likewise.
(pkl_ast_make_any_type): Likewise.
(pkl_ast_dup_type): Likewise.
(pkl_ast_type_promoteable): Likewise.
(pkl_ast_sizeof_type): Likewise.
(pkl_ast_type_is_complete): Likewise.
(pkl_ast_array_type_remove_bounders): Likewise.
(pkl_ast_make_decl): Likewise.
(pkl_ast_make_offset): Likewise.
(pkl_ast_make_cast): Likewise.
(pkl_ast_make_isa): Likewise.
(pkl_ast_make_map): Likewise.
(pkl_ast_make_scons): Likewise.
(pkl_ast_make_funcall): Likewise.
(pkl_ast_make_funcall_arg): Likewise.
(pkl_ast_make_var): Likewise.
(pkl_ast_make_comp_stmt): Likewise.
(pkl_ast_make_builtin): Likewise.
(pkl_ast_make_null_stmt): Likewise.
(pkl_ast_make_ass_stmt): Likewise.
(pkl_ast_make_if_stmt): Likewise.
(pkl_ast_make_loop_stmt): Likewise.
(pkl_ast_make_loop_stmt_iterator): Likewise.
(pkl_ast_make_return_stmt): Likewise.
(pkl_ast_finish_returns): Likewise.
(pkl_ast_make_exp_stmt): Likewise.
(pkl_ast_make_try_until_stmt): Likewise.
(pkl_ast_make_try_catch_stmt): Likewise.
(pkl_ast_make_print_stmt): Likewise.
(pkl_ast_make_print_stmt_arg): Likewise.
(pkl_ast_make_break_stmt): Likewise.
(pkl_ast_finish_breaks): Likewise.
(pkl_ast_make_raise_stmt): Likewise.
(pkl_ast_init): Likewise.
(pkl_ast_free): Likewise.
(pkl_ast_node_free): Likewise.
(pkl_ast_node_free_chain): Likewise.
(pkl_ast_reverse): Likewise.
(pkl_ast_type_equal): Likewise.
(pkl_ast_type_is_exception): Likewise.
(pkl_ast_lvalue_p): Likewise.
(pkl_ast_print): Likewise.
(pkl_print_type): Likewise.
(pkl_type_str): Likewise.
(pkl_ast_func_all_optargs): Likewise.
(pkl_ast_type_mappable_p): Likewise.
* lib/pkl-env.h (pkl_env_free): Likewise.
(pkl_env_free): Likewise.
(pkl_env_push_frame): Likewise.
(pkl_env_pop_frame): Likewise.
(pkl_env_register): Likewise.
(pkl_env_toplevel_p): Likewise.
(pkl_env_dup_toplevel): Likewise.
* lib/pkl-diag.h (pkl_error): Likewise.
(pkl_warning): Likewise.
(pkl_ice): Likewise.
* lib/pkl-asm.h (pkl_asm_new): Likewise.
(pkl_asm_finish): Likewise.
(pkl_asm_insn): Likewise.
(pkl_asm_call): Likewise.
(pkl_asm_if): Likewise.
(pkl_asm_then): Likewise.
(pkl_asm_else): Likewise.
(pkl_asm_endif): Likewise.
(pkl_asm_while): Likewise.
(pkl_asm_loop): Likewise.
(pkl_asm_endloop): Likewise.
(pkl_asm_for): Likewise.
(pkl_asm_for_where): Likewise.
(pkl_asm_for_loop): Likewise.
(pkl_asm_for_endloop): Likewise.
(pkl_asm_try): Likewise.
(pkl_asm_catch): Likewise.
(pkl_asm_endtry): Likewise.
(pkl_asm_break_label): Likewise.
(pkl_asm_note): Likewise.
(pkl_asm_fresh_label): Likewise.
(pkl_asm_label): Likewise.
* lib/pkl-parser.h (pkl_parse_file): Likewise.
(pkl_parse_buffer): Likewise.
* lib/pkl-pass.h (pkl_do_pass): Likewise.
(pkl_do_subpass): Likewise.
* lib/pkl.h (pkl_struct_type_traverse): Moved from pkl-ast.h.
* lib/Makefile.am (pkginclude_HEADERS): Do not distribute
pkl-ast.h.
* lib/pkl-env.c: Include pkl-ast.h
* lib/pkl-diag.h: Likewise.
2020-04-26 John Darrington <john@darrington.wattle.id.au>
* src/pk-hserver.c (pk_hserver_init): Change signature to take void.
* src/pk-hserver.c (pk_hserver_shutdown): Ditto
* src/poke.c (print_help): Ditto
* src/poke.c (pk_print_version): Ditto
* src/poke.c (finalize): Ditto
* src/poke.c (initialize_user): Ditto
* src/poke.h (initialize_user): Ditto
2020-04-25 John Darrington <john@darrington.wattle.id.au>
* src/poke.c (pk_print_version): Add comment for translators.
2020-04-25 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (pk_cmd_exec): Use pk_str_concat.
2020-04-25 John Darrington <john@darrington.wattle.id.au>
* src/poke.c (parse_args): Remove redundant variable "ret".
* src/poke.c (initialize_user): Ditto.
2020-04-18 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Array maps bounded by number of elements): New node.
* doc/poke.texi (Array maps bounded by size): New node.
* doc/poke.texi (Unbounded array maps): New node.
* doc/poke.texi (Mapped bounds in bounded arrays): New node.
2020-04-14 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-program.h (pvm_program_routine): Set ELF visibility to
hidden.
(pvm_program_beginning): Likewise.
* lib/pkl-fold.c (pkl_phase_fold): Likewise.
* lib/pkl-trans.c (pkl_phase_trans1): Likewise.
(pkl_phase_trans2): Likewise.
(pkl_phase_trans3): Likewise.
(pkl_phase_trans4): Likewise.
* lib/pkl-typify.c (pkl_phase_typify1): Likewise.
(pkl_phase_typify2): Likewise.
(GCD): Likewise.
* lib/pkl-promo.c (pkl_phase_promo): Likewise.
* lib/pkl-gen.c (pkl_phase_gen): Likewise.
* lib/pkl-anal.c (pkl_phase_anal1): Likewise.
(pkl_phase_anal2): Likewise.
(pkl_phase_analf): Likewise.
* lib/ios-dev-nbd.c (ios_dev_nbd): Likewise.
* lib/ios-dev-file.c (ios_dev_file): Likewise.
* lib/ios-dev-mem.c (ios_dev_mem): Likewise.
* lib/pvm-val.h (pvm_allocate_struct_attrs): Likewise.
(pvm_allocate_closure_attrs): Likewise.
* lib/pvm-alloc.h (pvm_alloc_initialize): Likewise.
(pvm_alloc_finalize): Likewise.
(pvm_alloc_add_gc_roots): Likewise.
(pvm_alloc_remove_gc_roots): Likewise.
(pvm_alloc): Likewise.
(pvm_realloc): Likewise.
(pvm_alloc_cls): Likewise.
(pvm_alloc_strdup): Likewise.
(pvm_alloc_gc): Likewise.
* lib/pvm.jitter (nenc_printer): Mark as static.
(endian_printer): Likewise.
(bits_printer): Likewise.
(popf_printer): Likewise.
(pvm_literal_printer_lo): Likewise.
(pvm_literal_printer_hi): Likewise.
(pvm_literal_printer): Likewise.
(pvm_literal_printer_cast): Likewise.
(printer_hi): Likewise.
2020-04-14 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-trans.c (pkl_trans1_ps_print_stmt): Fix memory leak.
2020-04-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-set.c: Include stdlib.h.
2020-04-13 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (poke_doc_viewer): New global.
* src/poke.h: Likewise.
* src/pk-set.c (set_doc_viewer): Define.
(set_cmds): Add set_doc_viewer.
* src/pk-misc.c (pk_cmd_doc): Support for `less' as documentation
viewer.
* doc/poke.texi (doc command): Update.
2020-04-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/Makefile.am (text): New target.
($(builddir)/doc/poke.text): Likewise.
2020-04-13 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-diag.c (pkl_detailed_location): Do not use off64_t.
2020-04-13 Jose E. Marchesi <jemarch@gnu.org>
* lib/ras: Fix ambiguous grouping in regexps.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-insn.def: Do not use a white space between PKL_DEF_INSN
and the open parenthesis in macro invocations, as a special case.
Add explicative note.
2020-04-12 John Darrington <john@darrington.wattle.id.au>
* doc/Makefile.am (nodelist): Change its directory.
* testsuite/poke.repl/repl.exp (tab-completion-subcommand-2): New test.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/optcond-13.pk: New test.
* testsuite/poke.pkl/optcond-14.pk: Likewise.
* testsuite/poke.pkl/optcond-15.pk: Likewise.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp (tab-completion_type-1): New test.
(tab-completion-var-1): Likewise.
(tab-completion-fun-1): Likewise.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp (sigint-returns-to-prompt-2): New
test.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp (slashes-are-preserved-1): Renamed
from "slashes are preserved".
(ctrl-c-returns-to-prompt-1): Remove.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (poke_send_signal): New proc.
* testsuite/poke.repl/repl.exp (sigint-returns-to-prompt): New
test.
* testsuite/poke.repl/repl.exp (ctrl-c-returns-to-prompt):
Likewise.
* HACKING (Writing REPL tests): Document poke_send_signal.
2020-04-12 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Don't capitalise or indent "Where ..."
2020-04-12 John Darrington <john@darrington.wattle.id.au>
* src/pk-set.c (set_completion_function): Fix bug which was
exposed by recent test: tab-completion-subcommand-1.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp (tab-completion-subcommand-1): Use
poke_send instead of poke_test_cmd.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (poke_exit): Make sure to discard any
previous input before issuing the `exit' command.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Writing REPL tests): Mention poke_send.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (poke_send): New proc.
* testsuite/poke.repl/repl.exp (tab-completion-2): New test.
* HACKING (Command REPL tests): New subsection.
(General REPL tests): Likewise.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (poke_test_cmd): Fail and return if poke
has been killed.
(poke_killed): New global.
(poke_exit): Reset poke_killed whenever appropriate.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp (tab-completion-subcommand-1): New
test
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp: Rewrite tests to be more
self-contained, and add some notes.
* HACKING (Writing REPL tests): Updated.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Writing REPL tests): New section.
2020-04-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.repl/repl.exp (tab-completion-1): New test.
2020-04-10 Tim Rühsen <tim.ruehsen@gmx.de>
* lib/pkl.c (pkl_new): Return NULL instead of calling exit.
* lib/pkl.h (pkl_new): Add function description.
2020-04-11 Jose E. Marchesi <jemarch@gnu.org>
* lib/Makefile.am (.pks.pkc): Cause make to stop with an error if
ras fails.
2020-04-11 Bruno Haible <bruno@clisp.org>
Make 'git status' empty after "make distclean".
* .gitignore: Ignore generated files that are distributed in the
tarball.
2020-04-11 Bruno Haible <bruno@clisp.org>
Clean some generated files.
* lib/Makefile.am: Delete pkl-tab.output during 'make mostlyclean'.
* src/Makefile.am: Delete nodelist during 'make mostlyclean'.
* .gitignore: Update accordingly.
2020-04-11 Jose E. Marchesi <jemarch@gnu.org>
* lib/Makefile.am (.pks.pkc): Remove partially generated .pks
files when ras fails for some reason.
2020-04-11 Jose E. Marchesi <jemarch@gnu.org>
* lib/pk-utils.c: Include stdlib.h.
2020-04-11 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm.h (PVM_OK): Define.
(PVM_ERROR): Likewise.
* lib/pvm-val.c: Include pvm-program.h.
* lib/pvm-program.h: Move program point definitions here from
pvm.h.
* lib/pvm-program.c (pvm_program_append_instruction): Return
status codes.
(pvm_program_append_label): Likewise.
(pvm_program_append_label_parameter): Likewise.
(pvm_program_append_register_parameter): Likewise.
(pvm_program_append_unsigned_parameter): Liikewise.
(pvm_program_append_val_parameter): Likewise.
(pvm_program_append_push_instruction): Likewise.
(pvm_program_make_executable): Likewise.
2020-04-11 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: Updates on coding conventions.
* lib/pvm.h (pvm_obase): Document.
(pvm_set_obase): Likewise.
(pvm_omode): Likewise.
(pvm_set_omode): Likewise.
(pvm_omaps): Likewise.
(pvm_set_omaps): Likewise.
(pvm_oindent): Likewise.
(pvm_set_oindent): Likewise.
(pvm_odepth): Likewise.
(pvm_set_odepth): Likewise.
(pvm_oacutoff): Likewise.
(pvm_set_oacutoff): Likewise.
(pvm_compiler): Likewise.
(pvm_set_compiler): Likewise.
(pvm_pretty_print): Likewise.
(pvm_set_pretty_print): Likewise.
(pvm_val_cls_program): New function.
* lib/pvm-val.c (pvm_val_cls_program): Likewise.
* src/pk-vm.c (pk_cmd_vm_disas_fun): Use pvm_val_cls_program
instead of PVM_VAL_CLS_PROGRAM.
(pk_cmd_vm_disas_map): Likewise.
(pk_cmd_vm_disas_writ): Likewise.
* lib/pvm-val.h: Reinstate.
* lib/Makefile.am (libpoke_la_SOURCES): Add pvm-val.h.
* lib/pkl.c: Include pvm-val.h
* lib/pvm-program.c: Likewise.
* lib/pvm-val.c: Likewise.
* lib/pvm-alloc.c: Likewise.
* lib/pvm.jitter: Likewise.
* lib/pkl-gen.c: Likewise.
2020-04-10 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Avoid bool): New subsection.
(Use _p for Predicates): Likewise.
(Documenting Functions in Public Headers): Likewise.
2020-04-09 Tim Rühsen <tim.ruehsen@gmx.de>
* lib/pkl-ast.c (pkl_struct_type_traverse): Use
non-destructive parsing without memory allocations.
2020-04-10 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm.jitter (strace): Use pvm_print_val_with_params instead
of pvm_print_val.
2020-04-10 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-val.c (pvm_sizeof): Fix for absent struct fields.
2020-04-10 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-insn.def (nnn): New instruction.
* lib/pvm.jitter (nnn): Likewise.
* lib/pkl-gen.pks (struct_comparator): Support absent fields in
structs.
* testsuite/poke.pkl/eq-structs-10.pk: New test.
* testsuite/poke.pkl/eq-structs-11.pk: Likewise.
* testsuite/poke.pkl/eq-structs-12.pk: Likewise.
2020-04-10 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Dumping File Contents): Fix typos.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/optcond-12.pk: New test.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/eq-structs-9.pk: New test.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-ast.h (struct pkl_ast_decl): New field `in_struct_p'.
(PKL_AST_DECL_IN_STRUCT_P): Define.
* lib/pkl-tab.y (struct_type_field_identifier): Annotate the
declarations of struct fields as struct fields.
* lib/pkl-gen.c (pkl_gen_ps_var): If the variable is a struct
field, raise E_elem if we get null as its value.
* lib/pkl-gen.pks (struct_constructor): Amend the regvar to
install null as the value of field-variables.
(struct_mapper): Likewise.
(struct_field_mapper): Likewise.
* testsuite/poke.pkl/optcond-5.pk: Amend.
* testsuite/poke.pkl/sref-4.pk: Likewise.
* testsuite/poke.map/map-optcond-6.pk: Likewise.
* testsuite/poke.map/map-optcond-7.pk: Likewise.
* testsuite/poke.pkl/optcond-6.pk: New test.
* testsuite/poke.pkl/optcond-7.pk: Likewise.
* testsuite/poke.pkl/optcond-8.pk: Likewise.
* testsuite/poke.pkl/optcond-9.pk: Likewise.
* testsuite/poke.map/map-optcond-9.pk: Likewise.
* testsuite/poke.pkl/optcond-11.pk: Likewise.
* testsuite/poke.map/map-optcond-11.pk: Likewise.
* testsuite/poke.pkl/optcond-10.pk: Likewise.
* testsuite/poke.map/map-optcond-10.pk: Likewise.
2020-04-09 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-repl.c: Include xstrndup.h.
(poke_getc): Use xstrndup instead of xzmalloc+strncpy.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-val.c (pvm_print_val_1): Remove trailing whitespaces.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm.h: Note that if both NAME and VALUE are PVM_NULL in a
struct field, the field is absent.
* lib/pvm-val.c (pvm_sizeof): Be aware of absent fields.
(pvm_print_val_1): Likewise.
(pvm_elemsof): Likewise.
(pvm_ref_struct): Return NULL if the referred field is absent.
* lib/pkl-gen.pks (struct_constructor): Support optional fields.
(struct_mapper): Likewise.
(struct_field_mapper): Likewise.
(struct_field_writer): Likewise.
* lib/pkl-insn.def (srefia): New instruction.
* lib/pvm.jitter (srefia): Likewise.
* testsuite/poke.pkl/attr-length-8.pk: New test.
* testsuite/poke.pkl/sref-3.pk: Likewise.
* testsuite/poke.pkl/sref-4.pk: Likewise.
* testsuite/poke.map/map-opcond-write-1.pk: Likewise.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-env.c: Include string.h
* lib/pkl-gen.c: Remove spurious XXX marks.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-ast.h (PKL_AST_FUNC_NARGS): Define.
* lib/pkl-ast.c (pkl_ast_print_1): Print the nargs attribute of
func nodes.
* lib/pkl-trans.c (pkl_trans1_ps_func): Count the number of formal
arguments.
* lib/pkl-gen.c (pkl_gen_pr_func): Do not count arguments and
provide a hint with the number of formals to pushf.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-ast.h (PKL_AST_COMP_STMT_NUMVARS): Define.
* lib/pkl-ast.c (pkl_ast_print_1): Print the numvars attribute of
comp_stmt nodes.
* lib/pkl-trans.c (pkl_trans1_ps_comp_stmt): New handler.
(pkl_phase_trans1): Register handler.
* lib/pkl-gen.c (pkl_gen_pr_comp_stmt): Pass the number of
variables defined in the compound statement as a hint to pushf.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-insn.def (pushf): Get a numeric argument.
* lib/pvm.jitter (pushf): Likewise.
* lib/pvm.h (pvm_env_new): Get a `hint' argument.
(pvm_env_push_frame): Likewise.
* lib/pvm-env.c (pvm_env_new): Likewise.
(pvm_env_push_frame): Likewise.
(pvm_env_register): Allocate new space for entries as needed.
* lib/pvm.c (pvm_init): Pass a hint to pvm_env_new.
* lib/pkl-asm.pks: Add hints to pushf instructions.
* lib/pkl-gen.c: Likewise.
* lib/pkl-gen.pks: Likewise.
2020-04-09 Tim Rühsen <tim.ruehsen@gmx.de>
* lib/pk-utils.h: Add declaration of pk_str_replace.
* lib/pk-utils.c: Add implementation of pk_str_replace.
* lib/pkl.c (pkl_resolve_module): Make use of pk_str_replace.
2020-04-09 Tim Rühsen <tim.ruehsen@gmx.de>
* lib/pkl.c (pkl_resolve_module): Use non-destructive parsing.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Load Path): Mention POKE_LOAD_PATH.
2020-04-09 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl.c (pkl_load): New function.
(pkl_resolve_module): Likewise.
* lib/pkl-tab.y (load_module): Use pkl_resolve_module.
* src/pk-cmd.c (pk_cmd_init): Likewise.
* src/poke.c (poke_cmdsdir): Remove.
(initialize): Do not initialize poke_cmdsdir.
* run.in (POKECMDSDIR): Do not set POKECMDSDIR.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-val.c (pvm_sizeof): Return zero for type values.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-asm.c (pkl_asm_insn): Clarify the situation on 32-bit
and add an assert.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* lib/pkl-diag.h: Really add file in git, grrr.
* lib/pkl-diag.c: Likewise.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* lib/Makefile.am (libpoke_la_SOURCES): Add pkl_diag.h and
pkl_diag.c.
* lib/pkl-diag.h: New file.
(pkl_error): Moved from pkl.h.
(pkl_warning): Likewise.
(pkl_ice): Likewise.
* lib/pkl-diag.c: New file.
(pkl_detailed_location): Moved from pkl.c.
(pkl_error_internal): Likewise.
(pkl_error): Likewise.
(pkl_warning): Likewise.
* lib/pkl-anal.c: Include pkl-diag.h.
* lib/pkl-pass.h: Likewise.
* lib/pkl-typify.c: Likewise.
* lib/pkl-trans.c: Likewise.
* lib/pkl-tab.y: Likewise.
* lib/pkl-fold.c: Likewise.
* lib/pkl-lex.l: Likewise.
* HACKING (The Source Tree): Add pkl_diag.h and pkl_diag.c.
2020-04-08 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Add gnulib module pathmax.
* src/pk-editor.c: Include pathmax.h.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-val.c (pvm_print_val_1): Use default printer if no
pretty-printer is available in structs, even if pretty-print is
`yes'.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* src/Makefile.am (poke_CFLAGS): Remove LIBNBD_CFLAGS.
(poke_LDADD): Remove LIBNBD_LIBS.
* lib/Makefile.am (libpoke_la_CFLAGS): Add LIBNBD_CFLAGS.
(libpoke_la_LIBADD): Add LIBNBD_LIBS.
2020-04-08 Jose E. Marchesi <jemarch@gnu.org>
* lib/pvm-program.c: Remove trailing whitespaces.
2020-04-08 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (pk_cmd_get_next_match): Fix endless loop
introduced in commit c576c04c3.
2020-04-07 Jose E. Marchesi <jemarch@gnu.org>
* The big lib-ization.
2020-04-06 Jose E. Marchesi <jemarch@gnu.org>
* run.in (POKEDATADIR): Point to lib.
* src/Makefile.am (poke_LDADD): Link with libpoke.
* configure.ac: Add lib/Makefile to AC_CONFIG_FILES.
* Makefile.am (SUBDIRS): Add lib.
2020-04-07 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pkl-fold.c (OP_BINARY_SSS): Use pk_str_concat instead of
strlen/xmalloc/strcpy/strcat.
* src/pkl.c (pkl_new): Likewise.
2020-04-06 Tim Rühsen <tim.ruehsen@gmx.de>
* src/poke.c (initialize): Use pk_str_concat instead of
strlen/xmalloc/strcpy/strcat.
(initialize_user): Likewise.
2020-04-06 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Add gnulib module stdarg.
* src/pk-utils.h: Declaration of pk_str_concat.
* src/pk-utils.c: Implementation of pk_str_concat.
2020-04-06 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pkl-tab.y (load_module): Fix check for empty string.
* src/poke.c (initialize_user): Likewise.
2020-04-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.c (pvm_print_val_1): Update to new interface.
(pvm_print_val): Use new pvm_print_val_1 interface.
(pvm_print_val_with_params): New function.
Do not include poke.h
(pvm_call_pretty_printer): Get a vm argument and use it instead of
poke_vm.
* src/pvm.h (PVM_PRINT_F_PPRINT): Define.
(PVM_PRINT_F_GET_PPRINT): Likewise.
(pvm_print_val): Moved from pvm-val.h
(pvm_obase): New function.
(pvm_set_obase): Likewise.
* src/pvm.c (pvm_init): Initialize PVM_STATE_VM.
(PVM_STATE_VM): Define.
(PVM_STATE_OBASE): Likewise.
(pvm_obase): New function.
(pvm_set_obase): Likewise.
* src/pk-cmd.c (pk_cmd_exec): Adapt to new interface.
* src/pvm.jitter (pvm_literal_printer): Likewise.
2020-04-04 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Add gnulib module strchrnul.
* src/pkl-trans.c: Include string.h and xstrndup.h.
(pkl_trans1_ps_print_stmt): Code cleanup using strchrnul.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Load Path): Add an example on updating the
load_path.
(pokerc): Document the support for the XDG base directory
specification.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_op_binary_intoffstrarr): Renamed
from pkl_promo_op_binary_intoffstr.
Do not promote array arguments.
* src/pkl-typify.c (TYPIFY_BIN): Add a case CASE_ARRAY.
(CASE_ARRAY): Define.
* src/pkl-gen.c (pkl_gen_ps_op_add): Handle array operands.
* src/pkl-insn.def (PKL_INSN_ACONC): New macro-instruction.
* src/pkl-asm.c (pkl_asm_insn_aconc): Define.
(pkl_asm_insn): Handle PKL_INSN_ACONC.
* doc/poke.texi (Array Concatenation): New section.
* testsuite/poke.pkl/add-arrays-diag-1.pk: New test.
* testsuite/poke.pkl/add-arrays-diag-2.pk: Likewise.
* testsuite/poke.pkl/add-arrays-diag-3.pk: Likewise.
* testsuite/poke.pkl/add-arrays-3.pk: Likewise.
* testsuite/poke.pkl/add-arrays-2.pk: Likewise.
* testsuite/poke.pkl/add-arrays-1.pk: Likewise.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (initialize_user): Use `poke' subdirectories in the
XDG config dirs.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (initialize_user): Acknowledge XDG configuration
files if ~/.pokerc is not found.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk (atoi): Raise E_inval instead of E_generic when the
provided base is not supported.
* doc/poke.texi (atoi): Update accordingly.
* testsuite/poke.std/atoi-14.pk: New test.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk: Further simplifications.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk: Simply the setting of load_path.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.h (pkl_get_vm): New prototype.
* src/pkl.c (pkl_get_vm): New function.
* src/pkl-rt.pk: Define load_path and compute its initial value.
* src/pkl-tab.y: Do not include poke.h.
(load_module): Use load_path to locate modules.
* doc/poke.texi (Load Path): New section.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c: Remove trailing blanks.
* src/pkl-tab.y: Likewise.
2020-04-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_BUILTIN_GETENV): Define.
* src/pkl-tab.y (BUILTIN_GETENV): New token.
(builtin): Add rule for getenv.
* src/pkl-lex.l: Recognize __PKL_BUILTIN_GETENV__ tokens.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Implement the getenv
builtin.
* src/pkl-insn.def (PKL_INSN_GETENV): Define.
* src/Makefile.am (libpvmjitter_a_CPPFLAGS): Define _GNU_SOURCE.
* src/pvm.jitter (getenv): New instruction.
* src/pvm.h (PVM_E_INVAL): Define.
(PVM_E_INVAL_MSG): Likewise.
* src/pkl-rt.pk (getenv): Define.
(EC_inval): Likewise.
(E_inval): Likewise.
* doc/poke.texi (System): New section.
(getenv): New subsection.
* testsuite/poke.pkl/getenv-1.pk: New test.
* testsuite/poke.pkl/getenv-2.pk: Likewise.
2020-04-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.h (pkl_new): New argument `vm'.
(pkl_quiet_p): New prototype.
(pkl_set_quiet_p): Likewise.
(pkl_ice): Get an argument `compiler'.
* src/pkl.c (struct pkl_compiler): New fields `vm' and `quiet_p'.
(pkl_new): Get a VM as an argument.
(pkl_compile_buffer): Use the compiler's vm instead of the global
poke_vm.
(pkl_compile_statement): Likewise.
(pkl_compile_file): Likewise.
Do not include poke.h.
(rest_of_compilation): Do not use poke_compiler.
(rest_of_compilation): Likewise.
(rest_of_compilation): Likewise.
(pkl_new): Initialize quiet_p;
(pkl_quiet_p): Define.
(pkl_set_quiet_p): Likewise.
(pkl_error_internal): Do not use poke_quiet_p.
(pkl_warning): Likewise.
(pkl_ice): Likewise.
* src/poke.c (initialize): Pass the PVM and poke_datadir when
initializing the compiler.
(parse_args): Set compiler verbosity when processing QUIET_ARG.
* src/pkl-pass.h (PKL_ICE): Define.
* src/pkl-anal.c (pkl_anal1_ps_comp_stmt): Use PKL_ICE instead of
pkl_ice.
(pkl_anal_ps_default): Likewise.
(pkl_anal2_ps_checktype): Likewise.
(pkl_anal2_ps_checktype): Likewise.
(pkl_anal2_ps_offset): Likewise.
(pkl_analf_ps_array_initializer): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_var): Likewise.
(pkl_typify1_ps_attr): Likewise.
* src/pkl-promo.c (pkl_promo_ps_op_div): Likewise.
(pkl_promo_ps-op_binary_intoffstr): Likewise.
(pkl_promo_ps_op_mul): Likewise.
(pkl_promo_ps_op_rela): Likewise.
(pkl_promo_ps_op_bshiftpow): Likewise.
(pkl_promo_ps_op_binary): Likewise.
(pkl_promo_ps_op_unary): Likewise.
(pkl_promo_ps_indexer): Likewise.
(pkl_promo_ps_trimmer): Likewise.
(pkl_promo_ps_type_array): Likewise.
(pkl_promo_ps_ass_stmt): Likewise.
(pkl_promo_ps_funcall): Likewise.
(pkl_promo_ps_return_stmt): Likewise.
(pkl_promo_ps_print_stmt): Likewise.
(pkl_promo_ps_func_arg): Likewise.
(pkl_promo_ps_map): Likewise.
(pkl_promo_ps_cond_exp): Likewise.
* src/pkl-gen.c (pkl_gen_ps_op_attr): Likewise.
(pkl_gen_noimpl): Likewise.
* src/pkl-lex.l (YY_FATAL_ERROR): Pass extra->compiler to pkl_ice.
2020-04-04 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pkl-trans.c (pkl_trans1_ps_string): Avoid malloc if string
does not need escaping.
2020-04-04 Bruno Haible <bruno@clisp.org>
doc: Tweak formatting of ASCII table.
* doc/poke.texi (Table of ASCII Codes): Use TeXinfo markup. Use a single
table, not two tables.
2020-04-04 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Building Release Tarballs): New section.
2020-04-04 Bruno Haible <bruno@clisp.org>
Fix 'make distcheck'.
* doc/Makefile.am (EXTRA_DIST): New variable.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pkl-asm.c (pkl_asm_insn):
Remove obsolete code.
2020-04-04 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Pickles): Note how pickles can load other
pickles.
2020-04-04 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Pickles): New section.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (skip_blanks): Take const char *,
return const char *.
(pk_atoi): Add const to p.
(pk_cmd_exec_1): Add const to str param and to several vars.
(pk_cmd_exec): Add const to param and several vars,
use cmd_alloc for allocation.
* src/pk-cmd.h (pk_cmd_exec): Add const to param.
* pkl-parser.c (pkl_parse_buffer): Add const to 'buffer'
and 'end'.
* src/pkl-parser.h (pkl_parse_buffer): Likewise.
* src/pkl.c (pkl_compile_buffer): Add const to 'buffer'
and 'end'.
(pkl_compile_statement): Likewise.
(pkl_compile_expression): Likewise.
* src/pkl.h (pkl_compile_buffer): Add const to 'buffer'
and 'end'.
(pkl_compile_statement): Likewise.
(pkl_compile_expression): Likewise.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Poking Bytes): Improve wording.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Weird Integers): Fix typo.
(From Bytes to Integers): Likewise.
(Defining Types): Add a mention to the poke standard library.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Modifying SBM Images): Fix sectioning of a
subsection.
(Defining Types): Renamed from `Named Types'.
(Defining Types): Add contents.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* src/ios-dev-file.c (ios_dev_file_pread): Fix type of variable.
(ios_dev_file_pwrite): Likewise.
* src/pk-cmd.c (pk_cmd_exec_1): Likewise.
* src/pvm.jitter (aref): Remove unneeded check.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-dump.pk (dump): Avoid generating a spurious blank
character after the ASCII ruler.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-set.c (set_completion_function):
Remove superfluous malloc within loop.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-repl.c (pk_repl):
Simplify malloc/strlen/strcpy/strcat with asprintf.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-repl.c (pkl_complete_struct):
Remove superfluous malloc within loop.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/Makefile.am (AM_MAKEINFOHTMLFLAGS): Define.
(html-local): Refine the generated html files.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-ios.c (pk_cmd_mem): Fix memleak.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-ios.c (pk_cmd_mem):
Simplify malloc/strlen/strcpy/strcat with asprintf.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-ios.c (pk_cmd_load_file):
Simplify malloc/strlen/strcpy/strcat with asprintf.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-ios.c (pk_cmd_load_file): Fix reading file from
POKEDATADIR.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Sectioning changes.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Sectioning changes.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (pk_cmd_get_next_match):
Remove superfluous malloc within loop.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: syntax-check fixes.
2020-04-03 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Modifying SBM Images): Updated to cover mapped
vs. non-mapped values.
2020-04-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Modifying SBM Images): Renamed from `Cropping SBM
Images'.
2020-04-03 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (pk_cmd_init):
Simplify malloc/strlen/strcpy/strcat with asprintf.
2020-04-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-hserver.c (pk_hserver_make_hyperlink):
Simplify malloc/strlen/strcpy/strcat with asprintf.
(pk_hserver_init): Remove writing to hserver_port_str.
(hserver_port_str): Remove variable.
2020-04-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Flatten the sectioning, removing superfluous
nodes containing only menus.
2020-04-02 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (The Bugzilla): New section.
(Dealing with spam in the Bugzilla): Likewise.
2020-04-02 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Add gnulib module stdbool.
2020-04-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-hserver.c (hserver_tokens): Fix type to bool.
2020-04-02 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: List gnulib modules in alphabetical order.
2020-04-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (pk_cmd_exec): Reduce memory allocations.
2020-04-02 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pkl-parser.c (pkl_parse_buffer): Add const to buffer param.
* src/pkl-parser.h (pkl_parse_buffer): Likewise.
2020-04-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Poking a SBM Image): Expanded.
(Cropping SBM Images): New section.
2020-04-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (The SBM Format): Do not use @acronym{}.
2020-04-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Poking Arrays): New section.
(The SBM Format): New subsection.
(Poking a SBM Image): Likewise.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_ps_decl): Complete assert expression.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bmp.pk (IHS_BMP_V2): Define.
(IHS_BMP_V3): Likewise.
(BMP_Info_Header): Allow info_header_size to be any of the
supported IHS_* values.
(BMP_Header): Fix the size of the reserved fields.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pkgdata_DATA): Add bmp.pk.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Fix handling of anonymous
fields.
* testsuite/poke.pkl/scons-54.pk: New test.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-arrays-16.pk: Add missing semicolon.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bmp.pk: Moved from future/ and translated to actual
Poke.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_trans2_ps_struct_ref): Set the type of the
newly inserted funcall, since typify1 happens before trans2.
* testsuite/poke.pkl/struct-method-1.pk: New test.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* etc/git-hooks/pre-push: Try to locate top_builddir and jump
there before executing make targets.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Debugging Poke Programs): Relocated.
2020-04-01 Tim Rühsen <tim.ruehsen@gmx.de>
* .x-sc_space_tab: Remove wildcards, list single files.
* src/ios.c: Replace indenting tabs by 8 spaces each.
* src/pk-cmd.c: Likewise.
* src/pk-editor.c: Likewise.
* src/pk-info.c: Likewise.
* src/pk-ios.c: Likewise.
* src/pk-misc.c: Likewise.
* src/pk-repl.c: Likewise.
* src/pk-set.c: Likewise.
* src/pk-utils.c: Likewise.
* src/pkl-env.c: Likewise.
* src/pkl-env.h: Likewise.
* src/pkl-gen.pks: Likewise.
2020-04-01 Tim Rühsen <tim.ruehsen@gmx.de>
* HACKING: Mention pre-push git hook in Maintenance section.
* etc/git-hooks/pre-push: New file, pre-push git hook.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (From Bytes to Characters): New section.
(Buffers as IO Spaces): Likewise.
(Saving Buffers in Files): Likewise.
(Copying Bytes): Likewise.
(copy): The to_ios argument defaults to the current IOS, no
from_ios.
2020-04-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-copy.pk (copy): to_ios defaults to the current IO space.
2020-03-31 Tim Rühsen <tim.ruehsen@gmx.de>
* doc/poke.texi: Remove trailing spaces.
2020-03-31 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Big and Little Endians): New section.
(Negative Integers): Likewise.
(Weird Integers): Likewise.
(Unaligned Integers): Likewise.
(Integers of Different Sizes): Likewise.
2020-03-30 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Binary Files): New section.
(Dumping File Contents): Improved.
(Working with Bytes): Likewise.
2020-03-30 Tim Rühsen <tim.ruehsen@gmx.de>
* INSTALL: Remove from repository.
* .gitignore: Add /INSTALL.
2020-03-29 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Add gnulib module xstrndup.
* src/pk-cmd.c (pk_cmd_exec_1): Fix code to use xstrndup.
2020-03-29 Tim Rühsen <tim.ruehsen@gmx.de>
* src/pk-cmd.c (skip_blanks): Remove superfluous check.
2020-03-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: Change the sectioning and add a detailed menu.
* doc/gen-pvm-insns.sh: Adapt accordingly.
2020-03-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (basic Editing): New chapter.
2020-03-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_cast): Allow casts from structs
to structs.
* src/pkl-gen.c (pkl_gen_ps_cast): Support struct-to-struct casts.
* doc/poke.texi (Casting Structs): New section.
* testsuite/poke.pkl/cast-struct-1.pk: New test.
* testsuite/poke.pkl/cast-struct-4.pk: Likewise.
* testsuite/poke.pkl/cast-struct-3.pk: Likewise.
* testsuite/poke.pkl/cast-struct-2.pk: Likewise.
* testsuite/poke.pkl/csat-struct-6.pk: Likewise.
* testsuite/poke.pkl/cast-struct-5.pk: Likewise.
2020-03-29 John Darrington <john@darrington.wattle.id.au>
*doc/poke.texi: Miscellaneous minor fixes.
2020-03-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/Makefile.am (pvm-insns.texi): New rule.
(poke_TEXINFOS): Add pvm-insns.texi.
* doc/gen-pvm-insns.sh: New file.
* src/pvm.jitter: Document instructions.
* doc/poke.texi (PVM Instructions): New chapter.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-parser.h (struct pkl_parser): New field `bootstrapped'.
* src/pkl-parser.c (pkl_parse_file): Set parser->bootstrapped.
(pkl_parse_buffer): Likewise.
(pkl_parser_init): Initialize parser->bootstrapped.
* src/pkl-lex.l: Do not acknowledge built-in identifiers if the
compiler has been already bootstrapped.
* testsuite/poke.pkl/builtins-1.pk: New test.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_var): Turn assert into ICE.
* src/pk-def.c: Do not include stdio.h.
(print_var_decl): Pass poke_obase to pvm_print_val.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_op_in): Remove unneeded check.
* testsuite/poke.pkl/in-4.pk: Renamed from in-diag-4.pk and
adapted.
* testsuite/poke.pkl/in-5.pk: New test.
* testsuite/poke.pkl/in-6.pk: Likewise.
* testsuite/poke.pkl/in-7.pk: Likewise.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.h: New extern for poke_hserver_p.
* src/poke.c: New global poke_hserver_p.
(initialize): Initialize poke_hserver_p.
(finalize): Use poke_hserver_p.
* src/pk-repl.c (banner): Print `hserver listening..' only if the
hyperserver is used.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Loop Statements): New subsection.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
BZ 25395
* src/pkl-ast.h (enum pkl_ast_code): New value
PKL_AST_LOOP_STMT_ITERATOR.
(struct pkl_ast_loop_stmt_iterator): Define.
(PKL_AST_LOOP_STMT_ITERATOR_DECL): Define.
(PKL_AST_LOOP_STMT_ITERATOR_CONTAINER): Likewise.
(PKL_AST_LOOP_STMT_ITERATOR): Likewise.
* src/pkl-ast.c (pkl_ast_make_loop_stmt_iterator): New function.
(pkl_ast_node_free): Update to new topology.
(pkl_ast_finish_breaks_1): Likewise.
(pkl_ast_finish_returns_1): Likewise.
(pkl_ast_print_1): Likewise.
* src/pkl-pass.c (pkl_do_pass_1): Likewise.
* src/pkl-gen.c (pkl_gen_pr_loop_stmt): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_loop_stmt_iterator): Renamed from
pkl_typify1_pr_loop_stmt.
* testsuite/poke.pkl/while-1.pk: New test.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* src/Makefile.am: the .pkc files depend on pkl-insn.def.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/field-init-8.pk: New test.
2020-03-28 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ctf.pk (CTF_Preamble): Use field initialization.
2020-03-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_make_struct_type_field): Handle
initializer.
(pkl_ast_dup_type): Likewise.
(pkl_ast_node_free): Likewise.
(pkl_ast_print_1): Likewise.
* src/pkl-ast.h (PKL_AST_EXP_FLAG): Define.
(PKL_AST_STRUCT_TYPE_FIELD_INITIALIZER): Define.
(struct pkl_ast_struct_type_field): New field `initializer'.
* src/pkl-tab.y (struct_type_field_constraint_or_init): Renamed
from struct_type_field_constraint.
* src/pkl-pass.c (pkl_do_pass_1): Traverse struct field
initializers.
* src/pkl-typify.c (pkl_typify1_ps_struct): Pass a NULL
initializer when constructing a struct type field.
(pkl_typify1_ps_struct_type_field): Check the type of the field
initializer, if specified.
* src/pkl-promo.c (pkl_promo_ps_struct_type_field): Promote field
initializers.
* src/pkl-gen.pks (struct_constructor): Use field initializers.
* pickles/elf.pk (Elf64_Ehdr): Use an initialization value for the
magic field.
* doc/poke.texi (Field Initializers): New section.
* testsuite/poke.pkl/field-init-diag-1.pk: New test.
* testsuite/poke.pkl/field-init-diag-2.pk: Likewise.
* testsuite/poke.pkl/field-init-diag-3.pk: Likewise.
* testsuite/poke.pkl/field-init-1.pk: Likewise.
* testsuite/poke.pkl/field-init-2.pk: Likewise.
* testsuite/poke.pkl/field-init-3.pk: Likewise.
* testsuite/poke.pkl/field-init-diag-4.pk: Likewise.
* testsuite/poke.map/maps-structs-init-1.pk: Likewise.
* testsuite/poke.map/maps-structs-init-2.pk: Likewise.
* testsuite/poke.pkl/field-init-4.pk: Likewise.
* testsuite/poke.pkl/field-init-7.pk: Likewise.
* testsuite/poke.pkl/field-init-6.pk: Likewise.
* testsuite/poke.pkl/field-init-5.pk: Likewise.
2020-03-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (struct pkl_ast_type): New field `comparator' for
structs.
(PKL_AST_TYPE_S_COMPARATOR): Define.
* src/pkl-ast.c (pkl_ast_make_struct_type): Initialize the struct
type comparator closure, and add it as a GC root.
(pkl_ast_node_free): Deregister the struct type comparator as a GC
root.
* src/pkl-typify.c (pkl_typify1_ps_op_rela): Accept struct
operands in EQ and NE operators.
* src/pkl-promo.c (pkl_promo_ps_op_rela): Likewise.
* src/pkl-gen.h (struct pkl_gen_payload): New field
`in_comparator'.
* src/pkl-gen.c (pkl_gen_ps_op_rela): Likewise.
(pkl_gen_pr_decl): Build comparator closures for named struct
types.
(pkl_gen_pr_type_struct): Handle in_comparator contexts.
* src/pkl-asm.c (pkl_asm_insn_cmp): Handle structs.
* src/pkl-gen.pks (struct_comparator): New RAS function.
* doc/poke.texi (Struct Comparison): New section.
* testsuite/poke.pkl/eq-structs-diag-1.pk: New test.
* testsuite/poke.pkl/ne-structs-diag-1.pk: Likewise.
* testsuite/poke.pkl/eq-structs-8.pk: Likewise.
* testsuite/poke.pkl/eq-structs-7.pk: Likewise.
* testsuite/poke.pkl/eq-structs-6.pk: Likewise.
* testsuite/poke.pkl/eq-structs-5.pk: Likewise.
* testsuite/poke.pkl/eq-structs-4.pk: Likewise.
* testsuite/poke.pkl/eq-structs-3.pk: Likewise.
* testsuite/poke.pkl/ne-structs-2.pk: Likewise.
* testsuite/poke.pkl/ne-structs-1.pk: Likewise.
* testsuite/poke.pkl/eq-structs-1.pk: Likewise.
2020-03-27 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Ehdr): Use arrays equality.
* testsuite/poke.pkl/eq-arrays-11.pk: New test.
* testsuite/poke.pkl/eq-arrays-12.pk: Likewise.
2020-03-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_op_rela): The array operands
must have the same kind of elements.
* src/pkl-asm.pks (eqa): New macro.
* src/pkl-asm.c (pkl_asm_insn_cmp): Cover EQ and NE for arrays.
* doc/poke.texi (Array Comparison): New section.
* testsuite/poke.pkl/eq-arrays-1.pk: New test.
* testsuite/poke.pkl/ne-arrays-1.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-diag-4.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-diag-2.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-2.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-2.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-3.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-3.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-4.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-4.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-10.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-10.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-8.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-8.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-7.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-7.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-6.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-6.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-5.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-5.pk: Likewise.
2020-03-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_op_rela): Accept array
arguments in EQ and NE operators.
* src/pkl-promo.c (pkl_promo_ps_op_rela): Likewise.
* testsuite/poke.pkl/le-arrays-diag-1.pk: New test.
* testsuite/poke.pkl/ge-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/gt-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/lt-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/eq-arrays-diag-2.pk: Likewise.
* testsuite/poke.pkl/ne-arrays-diag-1.pk: Likewise.
2020-03-26 Tim Rühsen <tim.ruehsen@gmx.de>
* bootstrap.conf: Set gnulib_name=libgnu
* src/Makefile.am: Rename libpoke to libgnu.
2020-03-26 Tim Rühsen <tim.ruehsen@gmx.de>
* Makefile.am: Rename lib to gl.
* bootstrap.conf: Set source_base=gl.
* configure.ac: Rename lib/ to gl/.
* src/Makefile.am: Rename lib to gl.
2020-03-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-utils.h: Prototype for pk_print_binary moved from
pvm-val.h.
* src/pk-utils.c (pk_print_binary): Moved from pvm-val.c
* src/pvm.jitter (PVM_PRINTI): Call pk_print_binary instead of
pvm_print_binary.
(PVM_PRINTL): Likewise.
* src/pvm-val.c (pvm_print_val_1): Likewise.
2020-03-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (smodi): Check that the provided index is
in-range.
2020-03-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk: Do not define `true' nor `false'.
2020-03-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_try_catch_stmt): Fix locations
of errors.
* testsuite/poke.pkl/try-catch-diag-4.pk: New test.
* testsuite/poke.pkl/try-catch-diag-5.pk: Likewise.
2020-03-26 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/scons-53.pk: New test.
* testsuite/poke.pkl/promo-array-arg-10.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-11.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-diag-8.pk: Likewise.
2020-03-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Sym): fix type of st_name.
Adjust labels in st_info for endianness.
2020-03-25 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h: Prototype for pkl_ast_array_type_remove_bounders.
* src/pkl-ast.c (pkl_ast_array_type_remove_bounders): Define.
* src/pkl-gen.c (pkl_gen_pr_type_array): Use
pkl_ast_array_type_remove_bounders.
2020-03-25 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/scons-46.pk: New test.
* testsuite/poke.pkl/scons-48.pk: Likewise.
* testsuite/poke.pkl/scons-49.pk: Likewise.
* testsuite/poke.pkl/scons-50.pk: Likewise.
* testsuite/poke.pkl/scons-51.pk: Likewise.
* testsuite/poke.pkl/scons-52.pk: Likewise.
2020-03-25 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Promote struct constructor
initializers that are arrays.
2020-03-24 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_transl_pr_type_array): Remove.
(pkl_transl_ps_type_array): Likewise.
(pkl_transl_ps_var): Likewise.
(pkl_phase_transl): Likewise.
* src/pkl.c (rest_of_compilation): Remove lex pass.
* src/pkl-ast.c (pkl_ast_type_promoteable): Handle general array
types.
* src/pkl-promo.c (pkl_promo_ps_scons): Promote array initializers
in struct constructors.
* testsuite/poke.pkl/promo-array-scons-diag-1.pk: New test.
* testsuite/poke.pkl/scons-42.pk: Likewise.
* testsuite/poke.pkl/scons-43.pk: Likewise.
* testsuite/poke.pkl/scons-44.pk: Likewise.
* testsuite/poke.pkl/scons-45.pk: Likewise.
* testsuite/poke.pkl/cast-array-7.pk: Likewise.
2020-03-24 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_node_free): Remove incorrect fallthrough
comment.
2020-03-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.h (struct pkl_trans_payload): Remove field in_map.
* src/pkl-trans.c (pkl_transl_pr_map): Remove.
(pkl_transl_ps_map): Likewise.
(pkl_transl_pr_type_struct): Likewise.
(pkl_phase_transl): Update accordingly.
* testsuite/poke.pkl/scons-40.pk: New test.
* testsuite/poke.pkl/scons-41.pk: Likewise.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_type_array): Use the array bounder, if
available, instead of subpassing.
* testsuite/poke.map/maps-arrays-20.pk: New test.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (array_constructor): Optimize calculation of
bounds at run-time.
* src/pkl-gen.c (pkl_gen_pr_type_array): Pass EBOUND and SBOUND as
two arguments to the array constructor.
* testsuite/poke.pkl/scons-36.pk: New test.
* testsuite/poke.pkl/scons-37.pk: Likewise.
* testsuite/poke.pkl/scons-38.pk: Likewise.
* testsuite/poke.pkl/scons-39.pk: Likewise.
* testsuite/poke.pkl/scons-40.pk: Likewise.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (array_constructor): Implement with full support
for both unbounded and bounded arrays.
* testsuite/poke.pkl/scons-diag-5.pk: Remove.
* testsuite/poke.pkl/scons-32.pk: New test.
* testsuite/poke.pkl/scons-33.pk: Likewise.
* testsuite/poke.pkl/scons-34.pk: Likewise.
* testsuite/poke.pkl/scons-35.pk: Likewise.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_type_array): Handle in_constructor
cases.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_node_free): Remove GC roots for array
constructor closures.
(pkl_ast_make_array_type): Initialize array type constructor
closures to null and add GC roots for them.
* src/pkl-ast.h (struct pkl_ast_type): New field `constructor' for
array types.
(PKL_AST_TYPE_S_CONSTRUCTOR): Define.
* src/pkl-gen.c (pkl_gen_pr_decl): Compile constructor closures
for array types.
* src/pkl-gen.pks (array_constructor): New RAS function.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h: Remove prototype for pkl_ast_complete_scons.
(struct pkl_ast_struct_field): Remove field `dummy'.
(PKL_AST_STRUCT_FIELD_DUMMY): Delete.
* src/pkl-ast.c (pkl_ast_complete_scons): Delete.
(pkl_ast_type_defval): Delete.
* src/pkl-trans.c (pkl_trans3_ps_scons): Delete.
(pkl_phase_trans3): Deregister handler.
* src/pkl-promo.c (pkl_promo_ps_scons): There is no more need to
handle `dummy' fields in structs.
* src/pkl-typify.c (pkl_typify1_ps_scons): Likewise.
* src/pkl-gen.c (pkl_gen_pr_type_struct): If a constructor
receives a null, turn it into an empty struct of the proper type.
(pkl_gen_ps_scons): Struct constructors always have named types.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def (PKL_INSN_SREFNT): Define.
* src/pvm.jitter (srefnt): New instruction.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_ps_type_integral): Handle in_constructor.
(pkl_gen_ps_type_offset): Likewise.
(pkl_gen_ps_type_string): Likewise.
2020-03-21 John Darrington <john@darrington.wattle.id.au>
*src/pk-cmd.c (pk_cmd_exec_1): Check that cmd_name
does not overflow.
2020-03-21 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ctf.pk: Updates.
2020-03-20 John Darrington <john@darrington.wattle.id.au>
* src/pk-misc.c (strings): Declare as const and deal
with consequences.
* src/pkl-asm.c (cast_table): Declare as const.
* src/pkl-asm.c (peek_table): Declare as const.
* src/pkl-asm.c (peekd_table): Declare as const.
* src/pkl-asm.c (print_table): Declare as const.
2020-03-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_defval): Handle unbounded arrays.
* src/pkl-pass.c (pkl_do_pass_1): An array AST node can have 0
elements.
* testsuite/poke.pkl/scons-31.pk: New test.
2020-03-17 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk (_pkl_exception_handler): fix typo in message.
2020-03-14 John Darrington <john@darrington.wattle.id.au>
* doc/Makefile.am (pkgdata_DATA): New variable.
* doc/Makefile.am (INFO_DEPS): Remove nodelist.
* doc/Makefile.am (nodelist): Move to $(top_srcdir)/src,
* src/pk-misc.c (doc_completion_dunction): Expect nodelist
in poke_datadir instead of poke_infodir.
2020-03-10 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_defval): Add missing locations to
built offsets.
* testsuite/poke.pkl/attr-size-13.pk: New test.
* testsuite/poke.pkl/attr-length-7.pk: Likewise.
2020-03-09 Jose E. Marchesi <jemarch@gnu.org>
* src/Makefile.am: Make files compiled by ras to depend on ras
itself.
2020-03-09 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_mapper): Fix the handling of EOF while
mapping unions.
* testsuite/poke.map/maps-unions-9.pk: New test.
* testsuite/poke.map/maps-unions-10.pk: Likewise.
2020-03-09 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_STRUCT_TYPE_FIELD_OPTCOND): Define.
(struct pkl_ast_struct_type_field): New field optcond.
* src/pkl-ast.c (pkl_ast_make_struct_type_field): Get an argument
optcond.
(pkl_ast_dup_type): Handle optcond.
(pkl_ast_node_free): Likewise.
(pkl_ast_type_is_complete): Struct types with optional fields are
not complete.
(pkl_ast_print_1): Likewise.
* src/pkl-pass.c (pkl_do_pass_1): Traverse optcond nodes.
* src/pkl-tab.y (struct_type_field_optcond): New rule.
(struct_type_field): Add conditional expression.
* src/pkl-anal.c (pkl_anal2_ps_type_struct): Optional fields are
not allowed in unions.
* src/pkl-typify.c (pkl_typify1_ps_struct_type_field): Make sure
that optcond expressions in fields evaluate to a boolean.
* src/pkl-promo.c (pkl_promo_ps_struct_type_field): Promote
optcond expressions to boolean.
* src/pkl-gen.pks (struct_mapper): Use the optcond expression in
optional fields.
(struct_constructor): Likewise.
* testsuite/poke.pkl/optcond-1.pk: New test.
* testsuite/poke.pkl/optcond-2-diag.pk: Likewise.
* testsuite/poke.map/map-optcond-6.pk: Likewise.
* testsuite/poke.map/map-optcond-5.pk: Likewise.
* testsuite/poke.map/map-optcond-4.pk: Likewise.
* testsuite/poke.map/map-optcond-3.pk: Likewise.
* testsuite/poke.map/map-optcond-2.pk: Likewise.
* testsuite/poke.map/map-optcond-1.pk: Likewise.
* testsuite/poke.map/map-optcond-7.pk: Likewise.
* testsuite/poke.map/map-optcond-8.pk: Likewise.
* testsuite/poke.pkl/optcond-2.pk: Likewise.
* testsuite/poke.pkl/optcond-5.pk: Likewise.
* testsuite/poke.pkl/optcond-4.pk: Likewise.
* testsuite/poke.pkl/optcond-3.pk: Likewise.
* doc/poke.texi (Optional Fields): Document optional fields.
2020-03-07 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Spell check.
* src/pk-ios.c (load_cmd, file_cmd): Change "filename" to be two
words per GNU Coding Standards.
2020-03-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Remove assert.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_decl): New handler.
(pkl_phase_typify1): Register handler.
* testsuite/poke.pkl/struct-pretty-print-diag-1.pk: New test.
* testsuite/poke.pkl/struct-pretty-print-diag-2.pk: Likewise.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_cond_exp): Set the type of the
conditional expression node!
* src/pkl-rt.pk: Simplify.
* testsuite/poke.pkl/cond-exp-3.pk: New test.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/isa-1.pk: Split from isa.pk.
* testsuite/poke.pkl/isa-9.pk: Likewise.
* testsuite/poke.pkl/isa-8.pk: Likewise.
* testsuite/poke.pkl/isa-7.pk: Likewise.
* testsuite/poke.pkl/isa-6.pk: Likewise.
* testsuite/poke.pkl/isa-5.pk: Likewise.
* testsuite/poke.pkl/isa-4.pk: Likewise.
* testsuite/poke.pkl/isa-3.pk: Likewise.
* testsuite/poke.pkl/isa-2.pk: Likewise.
2020-03-06 Eric Blake <eblake@redhat.com>
* configure.ac: Check for nbdkit in /usr/[local/]sbin.
* testsuite/lib/poke-dg.exp (dg-nbd): Actually use $NBDKIT from
environment.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk: Remove obsolete/spurious comments.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* TODO: Update.
* HACKING: Likewise.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk (Exception): Define as a struct.
(EC_generic): Define.
(EC_div_by_zero): Likewise.
(EC_no_ios): Likewise.
(EC_no_return): Likewise.
(EC_out_of_bounds): Likewise.
(EC_map_bounds): Likewise.
(EC_eof): Likewise.
(EC_map): Likewise.
(EC_conv): Likewise.
(EC_elem): Likewise.
(EC_constraint): Likewise.
(EC_io): Likewise.
(EC_signal): Likewise.
(EC_io_flags): Likewise.
(_pkl_exception_handler): Adapt to new exceptions.
* src/pvm-val.h: Prototype for pvm_make_exception.
* src/pvm-val.c (pvm_make_exception): New function.
* src/pkl-ast.h: Prototype for pkl_ast_type_is_exception.
* src/pkl-ast.c (pkl_ast_type_is_exception): New function.
* src/pvm.jitter (PVM_CHECKED_BINOP): Pass a message to PVM_RAISE.
(PVM_BINOP_SL): Likewise.
(PVM_PEEK): Likewise.
(PVM_POKE): Likewise.
(sync): Likewise.
(open): Likewise.
(close): Likewise.
(pushios): Likewise.
(popios): Likewise.
(iosize): Likewise.
(iogetb): Likewise.
(iosetb): Likewise.
(strref): Likewise.
(substr): Likewise.
(aset): Likewise.
(aseto): Likewise.
(aref): Likewise.
(arefo): Likewise.
(sset): Likewise.
(sref): Likewise.
(srefi): Likewise.
(srefio): Likewise.
(peeks): Likewise.
(pokes): Likewise.
(PVM_RAISE_DIRECT): Define.
(PVM_RAISE): Re-define in terms of PVM_RAISE_DIRECT.
(raise): Use PVM_RAISE_DIRECT.
(pushe): Get an Exception.
* src/pvm.h (PVM_E_GENERIC_MSG): Define.
(PVM_E_DIV_BY_ZERO_MSG): Likewise.
(PVM_E_NO_IOS_MSG): Likewise.
(PVM_E_NO_RETURN_MSG): Likewise.
(PVM_E_OUT_OF_BOUNDS_MSG): Likewise.
(PVM_E_MAP_BOUNDS_MSG): Likewise.
(PVM_E_EOF_MSG): Likewise.
(PVM_E_MAP_MSG): Likewise.
(PVM_E_CONV_MSG): Likewise.
(PVM_E_ELEM_MSG): Likewise.
(PVM_E_CONSTRAINT_MSG): Likewise.
(PVM_E_IO_MSG): Likewise.
(PVM_E_SIGNAL_MSG): Likewise.
(PVM_E_IOFLAGS_MSG): Likewise.
* src/pkl-asm.c (pkl_asm_finish): Adapt to new exceptions.
* src/pkl-typify.c (pkl_typify1_ps_raise_stmt): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_try_until_stmt): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_try_catch_stmt): Likewise.
* src/pkl-gen.c (pkl_gen_ps_raise_stmt): Likewise.
* src/pkl-gen.c (pkl_gen_pr_try_catch_stmt): Likewise.
* src/pkl-promo.c (pkl_promo_ps_raise_stmt): Remove handler.
(pkl_promo_ps_try_until_stmt): Likewise.
(pkl_promo_ps_try_catch_stmt): Likewise.
* src/ras: Adapt handling of PVM_E_* arguments to generate
Exceptions instead of integers.
* testsuite/poke.pkl/raise-2.pk: Adapt to new exceptions.
* testsuite/poke.pkl/try-until-3.pk: Likewise.
* testsuite/poke.pkl/try-until-2.pk: Likewise.
* testsuite/poke.pkl/try-catch-diag-2.pk: Likewise.
* testsuite/poke.pkl/try-catch-diag-1.pk: Likewise.
* testsuite/poke.pkl/try-catch-7.pk: Likewise.
* testsuite/poke.pkl/raise-5.pk: Likewise.
* testsuite/poke.pkl/raise-4.pk: Likewise.
* testsuite/poke.pkl/raise-3.pk: Likewise.
* testsuite/poke.pkl/raise-6.pk: New test.
* doc/poke.texi (Exceptions): Update.
(try-until): Likewise.
(try-catch): Likewise.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_STRUCT_FIELD_DUMMY): Define.
(struct pkl_ast_struct_field): Add field `dummy'.
* src/pkl-ast.c (pkl_ast_complete_scons): Annotate the dummy
property in struct fields.
* src/pkl-typify.c (pkl_typify1_ps_scons): Acknowledge the dummy
annotation.
* src/pkl-promo.c (pkl_promo_ps_scons): Likewise.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: Mention non-restartable passes.
2020-03-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_struct): Avoid restarting the
pass.
* src/pkl-typify.c (pkl_typify1_ps_array): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_isa): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_cast): Likewise.
* src/pkl-trans.c (pkl_trans1_ps_offset): Likewise.
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Likewise.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke.exp (poke_start): Pass -q to poke to avoid
acknowledging the user init file.
* testsuite/poke.repl/repl.exp: Use a more meaningful test name.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_STRUCT_FIELD_COMPLETED): Remove.
(struct pkl_ast_struct_field): Remove field `completed'.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_defval): This function cannot
calculate the default value for structs and unions.
* src/pkl-ast.h: Prototype for pkl_ast_complete_scons.
* src/pkl-ast.c: New function.
* src/pkl-trans.c (pkl_trans3_ps_scons): Call
pkl_ast_complete_scons.
* src/pkl-gen.c (pkl_gen_ps_scons): Compile ad-hoc struct
constructors for anonymous structs/unions.
* src/pkl-gen.pks (struct_constructor): handle completed struct
fields properly.
* src/pvm.jitter (tyissct): New instruction.
* src/pkl-insn.def (PKL_INSN_TYISSCT): Define.
* testsuite/poke.pkl/scons-26.pk: New test.
* testsuite/poke.pkl/scons-27.pk: Likewise.
* testsuite/poke.pkl/scons-28.pk: Likewise.
* testsuite/poke.pkl/scons-29.pk: Likewise.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Support unions.
* testsuite/poke.pkl/scons-union-1.pk: New test.
* testsuite/poke.pkl/scons-union-2.pk: Likewise.
* testsuite/poke.pkl/scons-union-8.pk: Likewise.
* testsuite/poke.pkl/scons-union-6.pk: Likewise.
* testsuite/poke.pkl/scons-union-5.pk: Likewise.
* testsuite/poke.pkl/scons-union-4.pk: Likewise.
* testsuite/poke.pkl/scons-union-3.pk: Likewise.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_indexer): No need to restart
the pass.
(pkl_typify1_ps_struct_field): Likewise.
(pkl_typify1_ps_struct_ref): Likewise.
(pkl_typify1_ps_type_array): Likewise.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.h (PVM_PRINT_F_GET_MAPS): Define.
* src/pk-cmd.c (pk_cmd_exec): Use PVM_PRINT_F_MAPS.
* src/pvm.jitter (printv): Likewise.
(strace): Likewise.
(state-struct-runtime-c): Add field omaps.
(state-initialization-c): omaps is 0 by default.
* src/pvm.c (pvm_omaps): New function.
(pvm_set_omaps): Likewise.
(PVM_STATE_OMAPS): Define.
* src/pvm.h: Prototypes for pvm_omaps and pvm_set_omaps.
* src/pk-set.c (pk_cmd_set_omaps): New function.
(set_cmds): Add set_omaps_cmd.
* src/pvm-val.c (pvm_print_val_1): Do not print offsets of array
elements or struct fields.
Use PVM_PRINT_F_GET_MAPS.
* testsuite/poke.cmd/set-omaps-1.pk: New test.
* doc/poke.texi (set command): Document omaps.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.c (pvm_print_val): Print struct offsets when invoked
with F_MAPS.
(pvm_print_val_1): Renamed from pvm_print_val, and added new
argument `depth'.
(pvm_print_val): New function.
(pk_odepth): Remove.
2020-03-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (struct): Remove rule.
(expression): Remove corresponding alternative.
* src/pkl-trans.c (pkl_trans3_ps_scons): Fix logic in loop.
* src/pkl-gen.pks (struct_constructor): Fix offsets, and make sure
the number of fields is stored in an ulong<64>.
(struct_mapper): Likewise, for nfields.
* testsuite/poke.pkl/ass-diag-6.pk: Remove.
* testsuite/poke.pkl/structs-1.pk: Likewise.
* testsuite/poke.pkl/structs-2.pk: Likewise.
* testsuite/poke.pkl/arrays-3.pk: Adapt.
* testsuite/poke.map/mapped-attr.pk: Likewise.
* testsuite/poke.pkl/ass-1.pk: Likewise.
* testsuite/poke.pkl/attr-length-1.pk: Likewise.
* testsuite/poke.pkl/attr-length-2.pk: Likewise.
* testsuite/poke.pkl/attr-size-10.pk: Likewise.
* testsuite/poke.pkl/attr-size-11.pk: Likewise.
* testsuite/poke.pkl/cast-struct-diag-2.pk: Likewise.
* testsuite/poke.pkl/defvar-5.pk: Likewise.
* testsuite/poke.pkl/isa.pk: Likewise.
* testsuite/poke.pkl/printf-20.pk: Likewise.
* testsuite/poke.pkl/printf-21.pk: Likewise.
* testsuite/poke.pkl/printf-22.pk: Likewise.
* testsuite/poke.pkl/printf-23.pk: Likewise.
* testsuite/poke.pkl/printf-24.pk: Likewise.
* testsuite/poke.pkl/printf-25.pk: Likewise.
* testsuite/poke.pkl/printf-value-3.pk: Likewise.
* testsuite/poke.pkl/printf-value-4.pk: Likewise.
* testsuite/poke.pkl/sref-1.pk: Renamed from structs-3.pk
* testsuite/poke.pkl/sref-2.pk: Renamed from structs-4.pk
* testsuite/poke.pkl/scons-25.pk: Renamed from structs-5.pk.
* testsuite/poke.pkl/scons-diag-6.pk: Renamed from
structs-diag-1.pk.
* testsuite/poke.pkl/attr-length-6.pk: New test.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Check field constraints in
struct constructors.
* testsuite/poke.pkl/scons-20.pk: New test.
* testsuite/poke.pkl/scons-21.pk: Likewise.
* testsuite/poke.pkl/scons-22.pk: Likewise.
* testsuite/poke.pkl/scons-23.pk: Likewise.
* testsuite/poke.pkl/scons-24.pk: Likewise.
* doc/poke.texi (Struct Literals): Remove section.
(Struct Constructors): Document that struct constructors take data
integrity into account.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Handle the struct methods.
* testsuite/poke.pkl/scons-18.pk: New test.
* testsuite/poke.pkl/scons-19.pk: New test.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c: Remove trailing whitespaces.
* src/pkl-promo.c: Likewise.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Struct Constructors): New section.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_scons): New handler.
(pkl_phase_promo): Install new handler.
* testsuite/poke.pkl/scons-17.pk: New test.
* testsuite/poke.pkl/scons-diag-4.pk: Adjust.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_defval): Fix the index of elements
in array defvals.
* src/pkl-trans.c (pkl_trans3_ps_scons): Set the number of
elements in the created struct value.
* src/pkl-gen.c (pkl_gen_pr_type_struct): Fix comment.
* src/pkl-gen.pks (struct_constructor): Handle compile-time built
fields.
* testsuite/poke.pkl/scons-1.pk: New test.
* testsuite/poke.pkl/scons-13.pk: Likewise.
* testsuite/poke.pkl/scons-12.pk: Likewise.
* testsuite/poke.pkl/scons-11.pk: Likewise.
* testsuite/poke.pkl/scons-10.pk: Likewise.
* testsuite/poke.pkl/scons-9.pk: Likewise.
* testsuite/poke.pkl/scons-8.pk: Likewise.
* testsuite/poke.pkl/scons-7.pk: Likewise.
* testsuite/poke.pkl/scons-6.pk: Likewise.
* testsuite/poke.pkl/scons-5.pk: Likewise.
* testsuite/poke.pkl/scons-4.pk: Likewise.
* testsuite/poke.pkl/scons-diag-5.pk: Likewise.
* testsuite/poke.pkl/scons-3.pk: Likewise.
* testsuite/poke.pkl/scons-2.pk: Likewise.
* testsuite/poke.pkl/scons-14.pk: Likewise.
* testsuite/poke.pkl/scons-16.pk: Likewise.
* testsuite/poke.pkl/scons-15.pk: Likewise.
2020-03-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_defval): ASTREF the type of the
index of new array elements.
(pkl_ast_type_defval): Add missing `break'.
2020-03-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_trans3_ps_scons): New handler.
(pkl_phase_trans3): Likewise.
2020-03-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h: Prototype for pkl_at_type_defval.
* src/pkl-ast.c (pkl_ast_type_defval): New function.
2020-03-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_writer): Use the mapping attributes from
the mapped objects instead of getting them as arguments.
(array_writer): Likewise.
* src/pkl-asm.pks (write): Adjust accordingly.
* src/pkl-gen.c (pkl_gen_pr_type_array): Clarify why the offset
and ios are not used in a comment.
(pkl_gen_pr_type_struct): Likewise.
2020-03-03 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-nbd): Run nbdkit only when
available.
(dg-command): Do not append to poke_commands if the current test
is being skipped as UNSUPPORTED.
* testsuite/poke.pkl/ios-nbd-1.pk: dg-require nbd.
* testsuite/poke.pkl/open-3.pk: Likewise.
* testsuite/poke.cmd/nbd-1.pk: Likewise.
* HACKING: Note that dg-require should be used before dg-command
directives.
2020-03-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-utils.h (STREQ): Define.
(STRNEQ): Likewise.
* src/ios.c: Include pk-uttils.h.
(STREQ): Remove.
* src/pvm-val.c: Likewise.
* src/pvm.jitter: Likewise.
* src/pk-set.c: Likewise.
* src/pk-hserver.c: Likewise.
* src/pk-editor.c: Likewise.
* src/pkl-typify.c: Likewise.
* src/pkl-trans.c: Likewise.
* src/pkl-fold.c: Likewise.
* src/pkl-env.c: Likewise.
* src/pkl-ast.c: Likewise.
* src/pkl-anal.c: Likewise.
* src/pk-misc.c: Likewise.
* src/ios-dev-mem.c: Do not include assert.h.
* src/ios-dev-nbd.c: Likewise.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Add Size to '.info ios'.
* src/pk-ios.c (pk_cmd_info_ios, print_info_ios): Add Size
column.
* doc/poke.texi (info command): Document the addition.
* testsuite/poke.cmd/file-mode.pk: Adjust expected output.
* testsuite/poke.cmd/file-relative.pk: Likewise.
2020-03-02 Eric Blake <eblake@redhat.com>
* src/pk-ios.c (print_info_ios): Correct hyperlink.
2020-03-02 Eric Blake <eblake@redhat.com>
* .gitignore: Implementing '.doc' creates another file.
2020-03-02 Eric Blake <eblake@redhat.com>
nbd: Add testsuite coverage
* HACKING (Using NBD connections in tests): New section.
(Writing tests that depend on a certain capability): New capability.
* testsuite/Makefile.am (check-DEJAGNU): Expose NBD witnesses.
* configure.ac (AC_CHECK_PROGS): Check for nbdkit.
* testsuite/lib/poke-dg.exp (dg-require): Add 'nbd' capability.
(dg-tmpdir): New command to create safe short temp dir.
(dg-nbd): New command to spawn nbdkit server.
(poke_finish): Clean up nbdkit.
* testsuite/poke.cmd/nbd-1.pk: New test of '.nbd'.
* testsuite/poke.pkl/open-3.pk: New test of open("nbd...").
* testsuite/poke.pkl/ios-nbd-1.pk: New test of nbd I/O.
2020-03-02 Eric Blake <eblake@redhat.com>
Add optional nbd:// io space support
* configure.ac (PKG_CHECK_MODULES): Check for libnbd.
* src/ios-dev-nbd.c: New file.
* src/Makefile.am (poke_SOURCES): Optionally build it.
* src/ios.c (ios_dev_ifs): Expose it through 'open'.
* src/pk-ios.c (pk_cmd_nbd): Add .nbd command.
* src/pk-cmd.c (dot_cmds): Load it.
* doc/poke.texi (nbd command): New section.
(open): Document nbd handler.
* HACKING (libnbd): Mention it.
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (array_mapper): Set the IOS of the mapped value.
(struct_mapper): Likewise.
* src/pvm.jitter (PVM_PEEK): Do not support ios == PVM_NULL.
(PVM_POKE): Likewise.
(peeks): Likewise.
(pokes): Likewise.
* src/pkl-gen.c (pkl_gen_pr_map): Push the current IOS if no IOS
was specified in the map, instead of pushing PVM_NULL.
* src/pkl-typify.c (pkl_typify1_ps_attr): Allow 'offset in any
type.
* src/pkl-gen.c (pkl_gen_ps_op_attr): Handle 'offset and 'ios in
values of type any, checking at run-time.
* testsuite/poke.pkl/attr-ios-diag-3.pk: New test.
* testsuite/poke.map/maps-ios-8.pk: Likewise.
* testsuite/poke.pkl/attr-ios-2.pk: Likewise.
* testsuite/poke.pkl/attr-offset-diag-3.pk: Likewise.
* testsuite/poke.pkl/attr-offset-diag-2.pk: Likewise.
* testsuite/poke.pkl/attr-offset-3.pk: Likewise.
* testsuite/poke.pkl/attr-offset-2.pk: Likewise.
* testsuite/poke.pkl/attr-offset-diag-1.pk: Likewise.
* testsuite/poke.pkl/attr-offset-1.pk: Likewise.
* testsuite/poke.pkl/attr-ios-1.pk: Likewise.
* testsuite/poke.pkl/attr-mapped-4.pk: Likewise.
* testsuite/poke.pkl/attr-mapped-3.pk: Likewise.
* testsuite/poke.pkl/attr-mapped-2.pk: Likewise.
* testsuite/poke.pkl/attr-mapped-1.pk: Likewise.
* TODO (or): Update.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Utilize buffer writes.
* src/ios.c (IOS_PUT_C_ERR_CHCK): Add parameter.
(ios_write_int_fast, ios_write_int_common): Consolidate writes.
(ios_size): Drop useless ().
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Utilize buffer reads.
* src/ios.c (ios_read_int_common, ios_read_int, ios_read_uint):
Consolidate reads.
(IOS_READ_INTO_CHARRAY_1BYTE, IOS_READ_INTO_CHARRAY_2BYTES)
(IOS_READ_INTO_CHARRAY_3BYTES, IOS_READ_INTO_CHARRAY_4BYTES)
(IOS_READ_INTO_CHARRAY_5BYTES, IOS_READ_INTO_CHARRAY_6BYTES)
(IOS_READ_INTO_CHARRAY_7BYTES, IOS_READ_INTO_CHARRAY_8BYTES)
(IOS_READ_INTO_CHARRAY_9BYTES): Delete unused macros.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Change from getchar to pread device interface.
* src/ios-dev.h (struct ios_dev_if): Replace get_c/put_c with
pread/pwrite.
* src/ios.c (IOS_GET_C_ERR_CHCK, IOS_PUT_C_ERR_CHCK)
(ios_read_string, ios_write_string): Use the new interface.
* src/ios-dev-file.c (ios_dev_file_getc, ios_dev_file_putc):
Rewrite to...
(ios_dev_file_pread, ios_dev_file_pwrite): ...this.
* src/ios-dev-mem.c (ios_dev_mem_getc, ios_dev_mem_putc): Rewrite
to...
(ios_dev_mem_pread, ios_dev_mem_pwrite): ...this.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Drop unused seek/tell callbacks.
* src/ios.c (ios_read_int, ios_read_uint, ios_read_string)
(ios_write_int_common, ios_write_int, ios_write_uint)
(ios_write_string): Drop redundant seek calls.
* src/ios-dev.h (struct ios_dev_if): Drop unused seek and tell.
* src/ios-dev-file.c (ios_dev_file_getc, ios_dev_file_putc): Set
rather than assert offset.
(ios_dev_file_tell, ios_dev_file_seek): Delete.
* src/ios-dev-mem.c (ios_dev_mem_getc, ios_dev_mem_putc): Simplify.
(ios_dev_mem_tell, ios_dev_mem_seek): Delete.
* testsuite/poke.pkl/ios-mem-5.pk: Update the test.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Prove we don't need seek.
* src/ios-dev.h (struct ios_dev_if): Add offset parameter to get_c
and put_c.
* src/ios.c (IOS_GET_C_ERR_CHCK, IOS_PUT_C_ERR_CHCK)
(ios_read_string, ios_write_string): Pass offset through.
* src/ios-dev-file.c (ios_dev_file_getc, ios_dev_file_putc):
Update signature and add assertion.
* src/ios-dev-mem.c (ios_dev_mem_getc, ios_dev_mem_putc):
Likewise.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Pass offset to low-level macros.
* src/ios.c (IOS_GET_C_ERR_CHCK, IOS_PUT_C_ERR_CHCK)
(IOS_READ_INTO_CHARRAY_1BYTE, IOS_READ_INTO_CHARRAY_2BYTES)
(IOS_READ_INTO_CHARRAY_3BYTES, IOS_READ_INTO_CHARRAY_4BYTES)
(IOS_READ_INTO_CHARRAY_5BYTES, IOS_READ_INTO_CHARRAY_6BYTES)
(IOS_READ_INTO_CHARRAY_7BYTES, IOS_READ_INTO_CHARRAY_8BYTES)
(IOS_READ_INTO_CHARRAY_9BYTES): Add parameter (unused until next
patch).
(ios_write_int_fast): Add parameter.
(ios_read_int_common, ios_read_int, ios_read_uint)
(ios_write_int_common, ios_write_int, ios_write_uint): Adjust
callers.
2020-03-02 Eric Blake <eblake@redhat.com>
ios: Avoid data leak and write-beyond-bounds in mem.
* src/ios-dev-mem.c (ios_dev_mem_putc): Zero the added bytes, and
track the updated size.
(ios_dev_mem_seek): Forbid seeks beyond our desired growth amount.
(ios_dev_mem_open): Zero the initial bytes.
* testsuite/poke.pkl/ios-mem-2.pk: Actually obey comment.
* testsuite/poke.pkl/ios-mem-3.pk: New test.
* testsuite/poke.pkl/ios-mem-4.pk: Likewise.
* testsuite/poke.pkl/ios-mem-5.pk: Likewise.
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/funcall-vararg-1.pk: Split from
funcall-vararg.pk
* testsuite/poke.pkl/funcall-vararg-6.pk: Likewise.
* testsuite/poke.pkl/funcall-vararg-5.pk: Likewise.
* testsuite/poke.pkl/funcall-vararg-4.pk: Likewise.
* testsuite/poke.pkl/funcall-vararg-3.pk: Likewise.
* testsuite/poke.pkl/funcall-vararg-2.pk: Likewise.
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/arrays-10.pk: s/catched/caught.
* testsuite/poke.map/maps-unions-3.pk: Likewise.
* testsuite/poke.map/maps-uint-diag-1.pk: Likewise.
* testsuite/poke.map/maps-structs-constraints-1.pk: Likewise.
* testsuite/poke.map/maps-strings-diag-4.pk: Likewise.
* testsuite/poke.map/maps-strings-diag-2.pk: Likewise.
* testsuite/poke.map/maps-strings-diag-1.pk: Likewise.
* testsuite/poke.map/maps-simple-9.pk: Likewise.
* testsuite/poke.map/maps-arrays-11.pk: Likewise.
* testsuite/poke.map/maps-arrays-3.pk: Likewise.
* testsuite/poke.pkl/try-until-3.pk: Likewise.
* testsuite/poke.pkl/try-catch-diag-3.pk: Likewise.
* testsuite/poke.pkl/try-catch-7.pk: Likewise.
* testsuite/poke.pkl/try-catch-6.pk: Likewise.
* testsuite/poke.pkl/trim-15.pk: Likewise.
* testsuite/poke.pkl/trim-14.pk: Likewise.
* testsuite/poke.pkl/trim-13.pk: Likewise.
* testsuite/poke.pkl/trim-12.pk: Likewise.
* testsuite/poke.pkl/trim-11.pk: Likewise.
* testsuite/poke.pkl/sl-integers-12.pk: Likewise.
* testsuite/poke.pkl/sl-integers-11.pk: Likewise.
* testsuite/poke.pkl/sl-integers-10.pk: Likewise.
* testsuite/poke.pkl/sl-integers-9.pk: Likewise.
* testsuite/poke.pkl/sl-integers-6.pk: Likewise.
* testsuite/poke.pkl/sl-integers-5.pk: Likewise.
* testsuite/poke.pkl/promo-array-return-diag-2.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-diag-7.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-diag-4.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-diag-3.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-diag-2.pk: Likewise.
* testsuite/poke.pkl/iosize-diag-1.pk: Likewise.
* testsuite/poke.pkl/funcal-vararg.pk: Likewise.
* testsuite/poke.pkl/funcall-vararg.pk: Likewise.
* testsuite/poke.pkl/defun-12.pk: Likewise.
* testsuite/poke.pkl/cast-array-siz-diag-3.pk: Likewise.
* testsuite/poke.pkl/cast-array-siz-diag-2.pk: Likewise.
* testsuite/poke.pkl/cast-array-siz-diag-1.pk: Likewise.
* testsuite/poke.pkl/cast-array-diag-6.pk: Likewise.
* testsuite/poke.pkl/cast-array-diag-3.pk: Likewise.
* testsuite/poke.pkl/cast-array-diag-2.pk: Likewise.
* testsuite/poke.pkl/attr-size-12.pk: Likewise.
* testsuite/poke.pkl/attr-ios-diag-2.pk: Likewise.
* testsuite/poke.pkl/attr-ios-diag-1.pk: Likewise.
* testsuite/poke.pkl/ass-9.pk: Likewise.
* testsuite/poke.pkl/array-siz-diag-1.pk: Likewise.
* testsuite/poke.pkl/arrays-12.pk: Likewise.
* testsuite/poke.pkl/arrays-11.pk: Likewise.
2020-03-02 Eric Blake <eblake@redhat.com>
* .gitignore: Broaden exclusion to cover all build objects.
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (PKL_PHASE_HANDLER_BIN_LOGIC): Renamed from
PKL_PHASE_BIN_INT.
(PKL_PHASE_HANDLER_BIN_INTOFF): Define.
(PKL_PHASE_HANDLER_BIN_SHIFTPOW): Likewise.
(ioro): Define semantic routines.
(xoro): Likewise.
(bando): Likewise.
(slo): Likewise.
(sro): Likewise.
(powo): Likewise.
(poso): Likewise.
(nego): Likewise.
(bonoto): Likewise.
(OP_UNARY_OO): Define.
* testsuite/poke.pkl/pos-offsets-1.pk: New test.
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* src/Makefile.am (poke_SOURCES): Remove jitter generated sources.
(poke_LDADD): Add libpvmjitter.a.
(noinst_LIBRARIES): Define.
(libpvmjitter_a_SOURCES): Likewise.
(libpvmjitter_a_CPPFLAGS): Likewise.
(libpvmjitter_a_CFLAGS): Likewise.
* TODO: Another task bites the dust!
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/sl-integers-1.pk: Rename from sl-1.pk
* testsuite/poke.pkl/sl-integers-2.pk: Rename from sl-2.pk
* testsuite/poke.pkl/sl-integers-3.pk: Rename from sl-3.pk
* testsuite/poke.pkl/sl-integers-4.pk: Rename from sl-4.pk
* testsuite/poke.pkl/sl-integers-5.pk: Rename from sl-5.pk
* testsuite/poke.pkl/sl-integers-6.pk: Rename from sl-6.pk
* testsuite/poke.pkl/sl-integers-7.pk: Rename from sl-7.pk
* testsuite/poke.pkl/sl-integers-8.pk: Rename from sl-8.pk
* testsuite/poke.pkl/sl-integers-9.pk: Rename from sl-9.pk
* testsuite/poke.pkl/sl-integers-10.pk: Rename from sl-10.pk
* testsuite/poke.pkl/sl-integers-11.pk: Rename from sl-11.pk
* testsuite/poke.pkl/sl-integers-12.pk: Rename from sl-12.pk
* testsuite/poke.pkl/sl-offsets-1.pk: New test.
* testsuite/poke.pkl/sr-offsets-2.pk: Likewise.
* testsuite/poke.pkl/sr-offsets-1.pk: Likewise.
* testsuite/poke.pkl/sr-integers-2.pk: Likewise.
* testsuite/poke.pkl/sr-integers-1.pk: Likewise.
* testsuite/poke.pkl/sl-offsets-2.pk: Likewise.
2020-03-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.c (pkl_asm_insn_binop): Remove gratuitous
conditional.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* TODO: New task.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk (BPF_Insn_Offset): Fix offset type.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (parse_args): Emit an error message if the specified
data file cannot be opened.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_op_binary_intoffstr): Renamed from
pkl_promo_ps_op_add_sub_mod.
(pkl_promo_ps_op_bshiftpow): Promote offset operand.
* src/pkl-typify.c: ior, xor and band accept both integers and
offsets as arguments.
* src/pkl-gen.c (pkl_gen_ps_op_binexp): Renamed from
pkl_gen_ps_op_intexp, and allow offsets for all operations.
(pkl_gen_ps_op_pow): Remove.
* src/pkl-asm.c (pkl_asm_insn_binop): Renamed from
pkl_asm_insn_binop, and expanded to support binary offset
macro-instructions.
* src/pkl-typify.c (pkl_typify1_ps_bshift_pow): New handler.
* testsuite/poke.pkl/pow-integers-1.pk: Renamed from pow-1.pk.
* testsuite/poke.pkl/pow-integers-2.pk: Renamed from pow-2.pk.
* testsuite/poke.pkl/pow-integers-3.pk: Renamed from pow-3.pk.
* testsuite/poke.pkl/xor-integers-1.pk: Renamed from xor-1.pk
* testsuite/poke.pkl/xor-integers-2.pk: Renamed from xor-2.pk
* testsuite/poke.pkl/ior-integers-1.pk: Renamed from ior-1.pk.
* testsuite/poke.pkl/ior-integers-2.pk: Renamed from ior-2.pk.
* testsuite/poke.pkl/band-integers-1.pk: Renamed from band-1.pk.
* testsuite/poke.pkl/band-integers-2.pk: Renamed from band-2.pk.
* testsuite/poke.pkl/band-offsets-1.pk: New test.
* testsuite/poke.pkl/band-offsets-2.pk: Likewise.
* testsuite/poke.pkl/ior-offsets-1.pk: Likewise.
* testsuite/poke.pkl/ior-offsets-2.pk: Likewise.
* testsuite/poke.pkl/xor-offsets-1.pk: Likewise.
* testsuite/poke.pkl/xor-offsets-2.pk: Likewise.
* testsuite/poke.pkl/pow-diag-1.pk: Likewise.
* testsuite/poke.pkl/sr-diag-1.pk: Likewise.
* testsuite/poke.pkl/sl-diag-4.pk: Likewise.
* testsuite/poke.pkl/sr-diag-2.pk: Likewise.
* testsuite/poke.pkl/sl-diag-5.pk: Likewise.
* testsuite/poke.pkl/pow-diag-2.pk: Likewise.
* testsuite/poke.pkl/pow-offsets-1.pk: Likewise.
* testsuite/poke.pkl/pow-offsets-2.pk: Likewise.
* testsuite/poke.pkl/pow-offsets-3.pk: Likewise.
* TODO: Update.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter: Remove trailing whitespaces.
* src/pkl-fold.c: Likewise.
* src/pk-editor.c (STREQ): Define.
(pk_cmd_editor): use STREQ instead of strcmp.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk: Define standard units using the power operator, and
use the same prefixes than coreutils.
* src/pvm-val.h (PVM_VAL_OFF_UNIT_GIGABYTES): Define.
(PVM_VAL_OFF_UNIT_KIBIBITS): Likewise.
(PVM_VAL_OFF_UNIT_KIBIBYTES): Likewise.
(PVM_VAL_OFF_UNIT_MEBIBITS): Likewise.
(PVM_VAL_OFF_UNIT_MEBIBYTES): Likewise.
(PVM_VAL_OFF_UNIT_KILOBITS): Changed to base 10.
(PVM_VAL_OFF_UNIT_KILOBYTES): Likewise.
(PVM_VAL_OFF_UNIT_MEGABITS): Likewise.
(PVM_VAL_OFF_UNIT_MEGABYTES): Likewise.
(PVM_VAL_OFF_UNIT_GIGABITS): Likewise.
* src/pvm-val.c (pvm_print_val): Fix unit names.
(print_unit_name): New function.
(pvm_print_val): Use print_unit_name.
* testsuite/poke.pkl/ass-offset-1.pk: Adjust test to new units.
* testsuite/poke.pkl/promo-offset-arg-2.pk: Likewise.
* testsuite/poke.pkl/promo-offset-arg-1.pk: Likewise.
* testsuite/poke.pkl/offsets-53.pk: Likewise.
* testsuite/poke.pkl/mod-offsets-diag-1.pk: Likewise.
* testsuite/poke.pkl/div-offsets-diag-2.pk: Likewise.
* testsuite/poke.pkl/units-8.pk: New test.
2020-03-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ops.def (PKL_AST_OP_POW): New operator.
* src/pkl-tab.y (POW): New token.
(expression): New rule alternative for exponentiation.
* src/pkl-lex.l: Handle POW.
* src/pkl-typify.c: Handle the exponent operator.
* src/pkl-fold.c: Likewise.
* src/pkl-promo.c: Likewise.
(pkl_promo_ps_op_bshiftpow): Renamed from pkl_promo_ps_op_bshift.
* src/pvm.jitter (PVM_POWOP): Define.
(powi): New instruction.
(powiu): Likewise.
(powl): Likewise.
(powlu): Likewise.
* src/pkl-insn.def (PKL_INSN_POWI): Define
(PKL_INSN_POWIU): Likewise.
(PKL_INSN_POWL): Likewise.
(PKL_INSN_POWLU): Likewise.
(PKL_INSN_POW): Likewise.
* src/pkl-asm.c (pkl_asm_insn_intop): Implement the pow
macro-instruction.
(pkl_asm_insn): Handle PKL_INSN_POW.
* src/pkl-gen.c (pkl_gen_ps_op_pow): New handler.
* src/pk-utils.h: Prototypes for pk_ipow and pk_upow.
* src/pk-utils.c (pk_ipow): New function.
(pk_upow): Likewise.
* testsuite/poke.pkl/pow-1.pk: New test.
* testsuite/poke.pkl/pow-2.pk: Likewise.
* testsuite/poke.pkl/pow-3.pk: Likewise.
* doc/poke.texi (Arithmetic Operators): Mention the exponentiation
operator.
2020-02-29 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Correctly test
the output from find_in_path: if the program is not
found, it returns its argument verbatim.
2020-02-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (DEFUNIT): New token.
* src/pkl-lex.l (DEFUNIT): Likewise.
* src/pk-cmd.c (pk_cmd_exec): Recognize defunit.
* src/pkl-env.h (PKL_ENV_NS_MAIN): Define.
(PKL_ENV_NS_UNITS): Likewise.
* src/pkl-env.c (struct pkl_env): New field units_hash_table.
(pkl_env_free): Handle units_hash_table.
(pkl_env_dup_toplevel): Handle the units hash table.
(pkl_env_lookup): Get a new argument `namespace'.
(pkl_env_lookup_1): Likewise.
(pkl_env_register): Likewise.
(get_ns_table): New function.
(pkl_env_lookup_1): Handle `namespace'.
(struct pkl_env): New field num_units.
* src/pkl-lex.l: Pass namespace to pkl_env_lookup.
* src/pkl-tab.y: Likewise.
* src/pk-def.c (print_var_decl): Likewise.
* src/pk-repl.c (pkl_complete_struct): Likewise.
* src/pk-vm.c (pk_cmd_vm_disas_fun): Likewise.
(pk_cmd_vm_disas_fun): Likewise.
* src/pkl-ast.h (PKL_AST_DECL_KIND_UNIT): Define.
* src/pkl-ast.c (pkl_ast_id_to_offset_unit): Remove function.
* src/pkl-anal.c (pkl_anal1_ps_decl): New handler.
(pkl_phase_anal1): Install new handler.
* src/pkl-typify.c (pkl_typify1_ps_decl): New handler.
(pkl_phase_typify1): Install new handler.
* src/pkl-trans.c (pkl_trans1_ps_offset): Do not handle
identifiers in offset units.
(pkl_trans1_ps_type_offset): Remove.
(pkl_trans2_ps_offset_type): Fix error location.
* src/pkl-fold.c (pkl_fold_ps_cast): Do not overwrite unit nodes
while constant-folding offset casts. Create a new node instead.
* src/pkl-gen.c (pkl_gen_pr_decl): Handle PKL_AST_DECL_KIND_UNIT.
* src/pkl-asm.c (pkl_asm_call): Pass a namespace to
pkl_env_lookup.
* src/std.pk (b,N,B,Kb,KB,Mb,MB,Gb,GB): Define units.
* testsuite/poke.pkl/units-1.pk: New test.
* testsuite/poke.pkl/units-2.pk: Likewise.
* testsuite/poke.pkl/units-3.pk: Likewise.
* testsuite/poke.pkl/units-4.pk: Likewise.
* testsuite/poke.pkl/units-5.pk: Likewise.
* testsuite/poke.pkl/units-6.pk: Likewise.
* testsuite/poke.pkl/units-diag-1.pk: Likewise.
* testsuite/poke.pkl/units-diag-2.pk: Likewise.
* testsuite/poke.pkl/units-diag-3.pk: Likewise.
* doc/poke.texi (Offset Units): New section.
(Standard Units): New chapter.
2020-02-29 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Do nothing if poke is not running
interactively.
2020-02-29 John Darrington <john@darrington.wattle.id.au>
* src/poke.c (parse_args): Set poke_interactive_p before any statements
which might want to test it.
2020-02-27 Eric Blake <eblake@redhat.com>
ios: Drop Position column from .info ios
* src/pk-ios.c (pk_cmd_info_ios, print_info_ios): Simplify.
* src/ios.c (ios_tell): Delete.
* src/ios.h (ios_tell): Likewise.
* doc/poke.texi (info command): Update output.
* testsuite/poke.cmd/file-mode.pk: Likewise.
* testsuite/poke.cmd/file-relative.pk: Likewise.
2020-02-23 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (pk_cmd_exec_1)[case 'f']: Remove a lot
of code which seems to serve no useful purpose.
* src/pk-repl.c (escape_metacharacters): New function.
* src/pk-repl.c (pk_repl): Initialize various readling
parameters.
2020-02-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l: Set errno to 0 before calling strtoull.
2020-02-27 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Add module strtoull.
* src/pkl-lex.l: Use strtoull instead of strtoll.
* src/pkl-tab.y: Improve error message on integer overflow.
2020-02-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (INTEGER_OVERFLOW): New token.
(primary): Accept INTEGER_OVERFLOW as a primary.
* src/pkl-lex.l: Return INTEGER_OVERFLOW whenever appropriate.
* testsuite/poke.pkl/integers-diag-1.pk: New test.
2020-02-27 Jose E. Marchesi <jemarch@gnu.org>
* TODO: Update.
2020-02-26 Eric Blake <eblake@redhat.com>
open: Normalize tricky .file names.
* src/ios-dev.h (struct ios_dev_if): Replace handler_p with
handler_noramlize callback.
* src/ios.c (ios_open): Store normalized name per ios.
* src/ios-dev-file.c (ios_dev_file_handler_p): Rename...
(ios_dev_file_handler_normalize): ...and prepend ./ to risky
relative file names.
* src/ios-dev-mem.c (ios_dev_mem_handler_p): Rename...
(ios_dev_mem_handler_normalize): ...to this.
(ios_dev_mem_open, ios_dev_mem_close): Drop unused handler member.
* testsuite/poke.cmd/file-relative.pk: New test.
2020-02-26 Eric Blake <eblake@redhat.com>
* src/ios.c (ios_close): Avoid side-effect inside assert.
* src/pk-def.c (print_var_decl, print_fun_decl): Likewise.
* src/pk-term.c (pk_printf): Likewise.
* src/pkl-asm.c (pkl_asm_call): Likewise.
* src/pkl-tab.y (pkl_register_dummies): Likewise.
* src/pkl.c (pkl_detailed_location): Likewise.
2020-02-26 Eric Blake <eblake@redhat.com>
* etc/git.orderfile (ChangeLog): Always list first.
(Documentation): Correct spelling of doc/.
(Build files): build-aux is not stored in git.
2020-02-25 Eric Blake <eblake@redhat.com>
* .gitignore: Ignore more testsuite leftovers.
2020-02-25 Eric Blake <eblake@redhat.com>
* src/pkl-tab.y (opt_comma): New rule.
(array): Use it to simplify trailing comma in arrays.
(struct, expression): Allow trailing comma in struct literals.
* doc/poke.texi (Struct Literals): Document it.
* testsuite/poke.pkl/structs-5.pk: Test it.
* etc/poke.g4 (array, struct): Match the real grammar.
2020-02-25 Eric Blake <eblake@redhat.com>
maint: Fix syntax-check
* .x-sc_prohibit_strncpy: Exempt pk-repl.c.
* etc/poke.g4 (expression): Whitespace cleanups.
* doc/poke.texi (String Concatenation): Likewise.
* src/ios-dev-file.c (ios_dev_file_close): Likewise.
* src/ios-dev-mem.c (ios_dev_mem_getc): Likewise.
* src/ios.c: Likewise.
* src/pk-hserver.c: Likewise.
* src/pk-ios.c: Likewise.
* src/pk-set.c: Likewise.
* src/pkl-ast.c: Likewise.
* src/pkl-ast.h: Likewise.
* src/pkl-fold.c: Likewise.
* src/pkl-insn.def: Likewise.
* src/pkl-tab.y: Likewise.
* src/pkl-typify.c: Likewise.
* src/pvm.jitter: Likewise.
* testsuite/poke.pkl/structs-diag-1.pk: Likewise.
2020-02-25 Eric Blake <eblake@redhat.com>
maint: Saner diff output
* .gitattributes: New file.
* etc/git.orderfile: New file.
* bootstrap.conf (bootstrap_post_import_hook): Set it up.
2020-02-25 Eric Blake <eblake@redhat.com>
* .gitignore: Allow './configure -C'.
2020-02-25 Eric Blake <eblake@redhat.com>
* doc/poke.texi (Assignments): Typo fix.
2020-02-25 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-ios.c (mem_cmd): Do not accept IOS tags in the .mem
command.
* doc/poke.texi (mem command): Update accordingly.
(file command): Likewise, for .file.
(info command): Use .ios instead of .file in example.
2020-02-25 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Write After Approval): Add Eric Blake.
2020-02-24 Eric Blake <eblake@redhat.com>
* src/pkl-tab.y (array): Allow trailing comma in arrays.
* doc/poke.texi (Array Literals): Document it.
* testsuite/poke.pkl/arrays-9.pk: New file, to test it.
2020-02-24 Eric Blake <eblake@redhat.com>
* .gitignore: Ignore files created during 'make check'.
2020-02-24 Eric Blake <eblake@redhat.com>
maint: add run script for easier uninstalled usage
* run.in: New file.
* configure.ac (AC_CONFIG_FILES): Use it to build 'run'.
* Makefile.am (noinst_SCRIPTS): Include template in tarball.
* HACKING (Running an Uninstalled Poke): Document it.
* .gitignore: Exempt new file.
2020-02-24 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Running and Uninstalled Poke): Update to cover
POKEPICKLESDIR.
2020-02-23 Bruno Haible <bruno@clisp.org>
HACKING: Tell where to find the DejaGnu documentation.
* HACKING (Test framework): New section.
2020-02-23 Bruno Haible <bruno@clisp.org>
Avoid a test failure, when running the test suite as root.
* testsuite/poke.cmd/file-mode.pk: Allow /etc/passwd to be opened
read-write.
2020-02-23 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.g4 (funcall_stmt_arg): Remove empty lines at EOF.
* testsuite/poke.pkl/funcall-13.pk: Likewise.
* testsuite/poke.pkl/close-2.pk: Likewise.
* src/pk-utils.c: Likewise.
2020-02-22 John Darrington <john@darrington.wattle.id.au>
* src/pk-ios.c (count_io_spaces): delete.
* src/pk-ios.c (close_completion_function): Rename
to ios_completion_function.
* src/pk-ios.c (ios_completion_function): Do not
assume that IO tags are consecutive integers.
* src/pk-ios.c (ios_cmd): Add new completer.
2020-02-22 John Darrington <john@darrington.wattle.id.au>
* src/ios.c (ios_begin): New function.
* src/ios.c (ios_end): New function.
* src/ios.c (ios_next): New function.
* src/ios.h (ios_begin): New declaration.
* src/ios.h (ios_end): New declaration.
* src/ios.h (ios_next): New declaration.
2020-02-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/sizeof-1.pk: New test.
* testsuite/poke.pkl/sizeof-2.pk: Likewise.
* testsuite/poke.pkl/sizeof-3.pk: Likewise.
* testsuite/poke.pkl/sizeof-12.pk: Likewise.
* testsuite/poke.pkl/sizeof-11.pk: Likewise.
* testsuite/poke.pkl/sizeof-10.pk: Likewise.
* testsuite/poke.pkl/sizeof-9.pk: Likewise.
* testsuite/poke.pkl/sizeof-8.pk: Likewise.
* testsuite/poke.pkl/sizeof-7.pk: Likewise.
* testsuite/poke.pkl/sizeof-6.pk: Likewise.
* testsuite/poke.pkl/sizeof-5.pk: Likewise.
* testsuite/poke.pkl/sizeof-4.pk: Likewise.
2020-02-16 John Darrington <john@darrington.wattle.id.au>
* src/pk-repl.c (poke_getc): Revert to poke_completion_function
if no complete command is on the repl's command line.
2020-02-16 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (null_complete_function): delete
* src/pk-repl.c (null_complete_function): add (move from above)
* src/pk-repl.c (poke_getc): Use null_complete_function as the
default completer.
2020-02-16 John Darrington <john@darrington.wattle.id.au>
* src/pk-def.c: Explicitly set completer member of struct pk_cmd
typed variables to NULL.
* src/pk-help.c: ditto
* src/pk-ios.c: ditto
* src/pk-misc.c: ditto
* src/pk-set.c: ditto
* src/pk-vm.c: ditto
2020-02-19 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_try_until_stmt): Emit sync instruction
before jumping back.
2020-02-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_op_mul): Support multiplication of
an integer by string.
* src/pkl-typify.c (pkl_typify1_ps_mul): Likewise.
* src/pkl-gen.c (pkl_gen_ps_op_mul): Likewise.
* src/pkl-fold.c (OP_BINARY_SIS): Define.
(EMUL_SIS): Likewise.
(pkl_fold_mul): Use OP_BINARY_SIS.
* src/pkl-insn.def (PKL_INSN_MULS): Define.
* src/pvm.jitter (muls): New instruction.
* testsuite/poke.pkl/mul-strings-1.pk: New test.
* testsuite/poke.pkl/mul-strings-2.pk: Likewise.
* testsuite/poke.pkl/mul-strings-3.pk: Likewise.
* testsuite/poke.pkl/mul-strings-4.pk: Likewise.
* testsuite/poke.pkl/mul-strings-5.pk: Likewise.
* doc/poke.texi (String Concatenation): Document the * operator
for strings.
2020-02-18 Carlo Caione <ccaione@baylibre.com>
* .gitignore: ignore more files
* .gitmodules: ignore dirty sub-repo
2020-02-18 Carlo Caione <ccaione@baylibre.com>
* src/pk-repl.c: Rework poke_sigint_handler()
2020-02-17 Carlo Caione <ccaione@baylibre.com>
* src/pk-repl.c (pkl_complete_struct): new auto-complete function
* src/pkl-ast.c (pkl_struct_type_traverse): new helper function
* src/pkl-ast.h: likewise
2020-02-14 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/set-oacutoff-2.pk: New test.
* src/pvm-val.c (pvm_print_val): Apply acutoff also in arrays that
are not inside other structs.
2020-02-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-set.c (pk_cmd_set_endian): Fix handling of optional
argument.
(pk_cmd_set_nenc): Likewise.
(pk_cmd_set_omode): Likewise.
2020-02-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-cmd.c (pk_cmd_exec): Honour pvm_oacutoff when calling
pvm_print_val.
2020-02-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-set.c (set_oacutoff_cmd): Make argument optional.
(set_oindent_cmd): Likewise.
(set_odepth_cmd): Likewise.
(pk_cmd_set_oacutoff): Print the current array cutoff if the set
command is invoked without arguments.
(pk_cmd_set_odepth): Likewise.
(pk_cmd_set_obase): Likewise.
* testsuite/poke.cmd/set-oacutoff-1.pk: New test.
* testsuite/poke.cmd/set-odepth-2.pk: Likewise.
* testsuite/poke.cmd/set-obase-1.pk: Likewise.
* testsuite/poke.cmd/set-obase-2.pk: Likewise.
* testsuite/poke.cmd/set-obase-4.pk: Likewise.
* testsuite/poke.cmd/set-obase-3.pk: Likewise.
* testsuite/poke.cmd/set-obase-5.pk: Renamed from set-obase.pk.
2020-02-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_PRINT_STMT_ARG_PRINT_MODE): Define.
(struct pkl_ast_print_stmt_arg): New field print_mode.
(PKL_AST_PRINT_STMT_ARG_PRINT_DEPTH): Define.
(struct pkl_ast_print_stmt_arg): New field print_depth.
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Support for
numerical prefix and flag T for the %v format tag.
* src/pvm.jitter (printv): Accept two arguments MODE and DEPTH.
* src/pkl-insn.def: Annotate printv to get two numerical
arguments.
* src/pkl-gen.c (pkl_gen_pr_print_stmt): Emit a printv
instruction with the right mode and depth.
* src/pvm-val.h (PVM_PRINT_F_DEPTH): Define.
(PVM_PRINT_F_GET_DEPTH): Likewise.
(PVM_PRINT_F_MODE): Likewise.
(PVM_PRINT_F_GET_MODE): Likewise.
(PVM_PRINT_F_INDENT): Likewise.
(PVM_PRINT_F_GET_INDENT): Likewise.
(PVM_PRINT_F_ACUTOFF): Likewise.
(PVM_PRINT_F_GET_ACUTOFF): Likewise.
* src/pvm-val.c (pvm_print_val): `flags' is an unsigned 32-bit
integer.
(pvm_print_val): Extract the desired printing depth from the
`flags', `mode', `acutoff' and `indent' arguments.
* src/pk-cmd.c (pk_cmd_exec): Pass mode/depth/indent to
pvm_print_val.
* src/pk-set.c (pk_cmd_set_odepth): Check that the odepth is
between 0 and 15.
(pk_cmd_set_oacutoff): Likewise for oacutoff.
* doc/poke.texi (printf): Document the additional options for %v.
* testsuite/poke.pkl/printf-diag-14.pk: Adjust.
* testsuite/poke.pkl/printf-diag-15.pk: New test.
* testsuite/poke.pkl/printf-diag-16.pk: Likewise.
* testsuite/poke.pkl/printf-20.pk: Likewise.
* testsuite/poke.pkl/printf-21.pk: Likewise.
* testsuite/poke.pkl/printf-22.pk: Likewise.
* testsuite/poke.pkl/printf-23.pk: Likewise.
* testsuite/poke.pkl/printf-24.pk: Likewise.
* testsuite/poke.pkl/printf-25.pk: Likewise.
2020-02-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-term.c (pk_term_indent): Get a new argument `step'.
* src/pvm-val.c (pvm_print_val): Call pk_term_indent only if
output mode is `tree', and pass the indentation step.
2020-02-13 Carlo Caione <ccaione@baylibre.com>
* doc/poke.texi: add documentation
* src/pk-set.c: new set oacutoff command
* testsuite/poke.cmd/set-oacutoff.pk: new test file
* src/pvm.c: helpers to retrieve oacutoff flag
* src/pvm.h: likewise
* src/pvm.jitter: new flag in the PVM state struct
* src/pvm-val.c: support new array cutoff parameter
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (initialize): Initialize the hyperserver only if poke
is used interactively.
(finalize): Ditto for finalize.
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* src/ras (pop_frame): Fix typo.
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Write After Approval): Added Carlo Caione.
* AUTHORS: Likewise.
2020-02-13 Carlo Caione <ccaione@baylibre.com>
* testsuite/poke.cmd/set-odepth.pk: new test
* testsuite/poke.cmd/set-oindent.pk: likewise
* testsuite/poke.cmd/set-odepth.pk: likewise
* src/pvm.jitter: new flags in the PVM state struct
* src/pvm.c: helpers to retrieve tree-related flags
* src/pvm.h: likewise
* src/pvm-val.c: support new printing modes
* src/pk-term.c: new function to print indentation
* src/pk-term.h: likewise
* src/pk-set.c: new .set sub-commands
* doc/poke.texi: updated documentation
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (load_module): Try to load modules from both
poke_datadir and poke_picklesdir.
* src/pk-cmd.c (pk_cmd_init): Do not load commands written in Poke
from C. Do it in pk-cmd.pk instead.
* src/pk-cmd.pk: Load commands written in Poke.
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (load): Add a LOAD STRING syntactic variant.
(load_module): Get a filename_p argument.
* doc/poke.texi (Modules): Document the alternate syntax for
`load'.
* testsuite/poke.pkl/load-4.pk: New test.
* testsuite/poke.pkl/load-diag-2.pk: Likewise.
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/funcall-3.pk: Split from funcall.pk.
* testsuite/poke.pkl/funcall-14.pk: Likewise.
* testsuite/poke.pkl/funcall-13.pk: Likewise.
* testsuite/poke.pkl/funcall-12.pk: Likewise.
* testsuite/poke.pkl/funcall-11.pk: Likewise.
* testsuite/poke.pkl/funcall-10.pk: Likewise.
* testsuite/poke.pkl/funcall-9.pk: Likewise.
* testsuite/poke.pkl/funcall-8.pk: Likewise.
* testsuite/poke.pkl/funcall-7.pk: Likewise.
* testsuite/poke.pkl/funcall-6.pk: Likewise.
* testsuite/poke.pkl/funcall-5.pk: Likewise.
* testsuite/poke.pkl/funcall-4.pk: Likewise.
2020-02-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Shebang): Document the shebang style that allows
passing more arguments to poke.
2020-02-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (POKEDATADIR): Define.
2020-02-12 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (parse_args): Handle -L after the data files
specified in the command line are loaded.
2020-02-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/load-1.pk: New test.
* testsuite/poke.pkl/load-2.pk: Likewise.
* testsuite/poke.pkl/load-3.pk: Likewise.
* testsuite/poke.pkl/load-diag-1.pk: Likewise.
* doc/poke.texi (Modules): New chapter.
2020-02-12 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.h (poke_picklesdir): New variable.
* src/poke.c (initialize): Initialize poke_picklesdir.
* src/pkl-lex.l: Recognize the token LOAD.
* src/pkl-tab.y (load): New rule.
(program_elem): New alternative `load'.
(LOAD): New token.
(load_module): New auxiliary function.
* src/pk-ios.c: Include pk-utils.h.
(pk_file_readable): Moved to pk-utils.c.
* src/Makefile.am (poke_SOURCES): Add pk-utils.[hc].
* src/pk-utils.h: New file.
* src/pk-utils.c: Likewise.
* pickles/ctf.pk: load elf.
* HACKING (Appendix): List pk-utils.c and pk-utils.h.
2020-02-11 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Bitwise Operators): Document the behavior of the
shifting operators.
2020-02-11 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal1_ps_op_sl): New handler.
(pkl_phase_anal1): Install handler.
* testsuite/poke.pkl/sl-diag-1.pk: New test.
* testsuite/poke.pkl/sl-diag-2.pk: Likewise.
* testsuite/poke.pkl/sl-diag-3.pk: Likewise.
* testsuite/poke.pkl/sl-9.pk: Likewise.
* testsuite/poke.pkl/sl-10.pk: Likewise.
* testsuite/poke.pkl/sl-11.pk: Likewise.
* testsuite/poke.pkl/sl-12.pk: Likewise.
* testsuite/poke.pkl/sl-5.pk: Adapt to new semantics.
* testsuite/poke.pkl/sl-6.pk: Likewise.
* src/pvm.jitter (PVM_BINOP_SL): Define.
2020-02-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c: Constant folding for bit shifts.
* testsuite/poke.pkl/sl-1.pk: Test constant folding.
* testsuite/poke.pkl/sl-2.pk: Likewise.
* testsuite/poke.pkl/sl-3.pk: Likewise.
* testsuite/poke.pkl/sl-4.pk: Likewise.
* testsuite/poke.pkl/sl-5.pk: Likewise.
* testsuite/poke.pkl/sl-6.pk: Likewise.
* testsuite/poke.pkl/sl-7.pk: Likewise.
* testsuite/poke.pkl/sl-8.pk: Likewise.
2020-02-11 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/arrays-8.pk: New test
* testsuite/poke.pkl/arrays-diag-1.pk: Likewise.
* testsuite/poke.pkl/arrays-diag-2.pk: Likewise.
* testsuite/poke.pkl/arrays-diag-3.pk: Likewise.
2020-02-10 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (array_initializer): Support expressions in .[]
constructions in array initializers.
* src/pkl-anal.c (pkl_anal2_ps_array): New handler.
* src/pkl-trans.c (pkl_trans2_ps_array): Moved from trans1.
* src/pkl-typify.c (pkl_typify2_ps_ass_stmt): Moved from typify1.
* testsuite/poke.pkl/arrays-6.pk: New test.
2020-02-08 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Fix memory leak.
2020-02-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter: Add comments to instruction definitions.
2020-02-07 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/ass-2.pk: New file.
* testsuite/poke.pkl/ass-8.pk: Likewise.
* testsuite/poke.pkl/ass-7.pk: Likewise.
* testsuite/poke.pkl/ass-6.pk: Likewise.
* testsuite/poke.pkl/ass-5.pk: Likewise.
* testsuite/poke.pkl/ass-4.pk: Likewise.
* testsuite/poke.pkl/ass-3.pk: Likewise.
2020-02-07 Jose E. Marchesi <jemarch@gnu.org>
* TODO (fold bconc expressions): Task done.
(fold array subscripts): Likewise.
(fold .<< and .>> expressions): Likewise.
2020-02-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (enum pkl_ast_code): Define PKL_AST_LAST_EXP.
2020-02-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_lvalue_p): Fix logic to avoid assignments
to values.
* testsuite/poke.pkl/ass-diag-6.pk: New test.
* testsuite/poke.pkl/ass-1.pk: Likewise
* testsuite/poke.pkl/ass-diag-7.pk: Likewise..
* testsuite/poke.pkl/ass-diag-8.pk: Likewise.
2020-02-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (pkl_fold_ps_cond_exp): New handler.
2020-02-06 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Conditional Expression): New section.
2020-02-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_cond_exp): New handler.
(pkl_phase_gen): Install handler.
* testsuite/poke.pkl/cond-exp-1.pk: New file.
* testsuite/poke.pkl/cond-exp-2.pk: Likewise.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_cond_exp): New handler.
(pkl_phase_typify1): Install it.
* src/pkl-tab.y (expression): New rule for the ternary conditional
operator.
* src/pkl-promo.c (pkl_promo_ps_cond_exp): New handler.
(pkl_phase_promo): Install handler.
* testsuite/poke.pkl/cond-exp-diag-1.pk: New file.
* testsuite/poke.pkl/cond-exp-diag-3.pk: Likewise.
* testsuite/poke.pkl/cond-exp-diag-2.pk: Likewise.
2020-02-05 Jose E. Marchesi <jose.marchesi@oracle.com>
* testsuite/poke.pkl/structs-diag-1.pk: New test.
* testsuite/poke.pkl/struct-types-diag-11.pk: Likewise.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_map): Add missing ICE.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/printf-diag-9.pk: New test.
* testsuite/poke.pkl/printf-diag-10.pk: Likewise.
* testsuite/poke.pkl/printf-diag-11.pk: Likewise.
* testsuite/poke.pkl/printf-diag-12.pk: Likewise.
* testsuite/poke.pkl/printf-diag-13.pk: Likewise.
* testsuite/poke.pkl/printf-1.pk: Likewise.
* testsuite/poke.pkl/printf-18.pk: Likewise.
* testsuite/poke.pkl/printf-17.pk: Likewise.
* testsuite/poke.pkl/printf-16.pk: Likewise.
* testsuite/poke.pkl/printf-15.pk: Likewise.
* testsuite/poke.pkl/printf-14.pk: Likewise.
* testsuite/poke.pkl/printf-13.pk: Likewise.
* testsuite/poke.pkl/printf-12.pk: Likewise.
* testsuite/poke.pkl/printf-11.pk: Likewise.
* testsuite/poke.pkl/printf-10.pk: Likewise.
* testsuite/poke.pkl/printf-9.pk: Likewise.
* testsuite/poke.pkl/printf-8.pk: Likewise.
* testsuite/poke.pkl/printf-7.pk: Likewise.
* testsuite/poke.pkl/printf-6.pk: Likewise.
* testsuite/poke.pkl/printf-5.pk: Likewise.
* testsuite/poke.pkl/printf-4.pk: Likewise.
* testsuite/poke.pkl/printf-3.pk: Likewise.
* testsuite/poke.pkl/printf-2.pk: Likewise.
* testsuite/poke.pkl/offset-type-diag-4.pk: Likewise.
* testsuite/poke.pkl/string-diag-1.pk: Likewise.
* testsuite/poke.pkl/printf-class-diag-1.pk: Likewise.
* testsuite/poke.pkl/printf-diag-14.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-8.pk: Likewise.
* testsuite/poke.pkl/offset-type-diag-5.pk: Likewise.
* testsuite/poke.pkl/structs-3.pk: Likewise.
* testsuite/poke.pkl/structs-2.pk: Likewise.
* testsuite/poke.pkl/structs-1.pk: Likewise.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/attr-size-12.pk: Renamed from attrs.pk
* testsuite/poke.pkl/attr-size-1.pk: New test.
* testsuite/poke.pkl/attr-length-5.pk: Likewise.
* testsuite/poke.pkl/attr-length-4.pk: Likewise.
* testsuite/poke.pkl/attr-length-3.pk: Likewise.
* testsuite/poke.pkl/attr-length-2.pk: Likewise.
* testsuite/poke.pkl/attr-length-1.pk: Likewise.
* testsuite/poke.pkl/attr-signed-2.pk: Likewise.
* testsuite/poke.pkl/attr-signed-1.pk: Likewise.
* testsuite/poke.pkl/attr-magnitude-1.pk: Likewise.
* testsuite/poke.pkl/attr-unit-1.pk: Likewise.
* testsuite/poke.pkl/attr-size-11.pk: Likewise.
* testsuite/poke.pkl/attr-size-10.pk: Likewise.
* testsuite/poke.pkl/attr-size-9.pk: Likewise.
* testsuite/poke.pkl/attr-size-8.pk: Likewise.
* testsuite/poke.pkl/attr-size-7.pk: Likewise.
* testsuite/poke.pkl/attr-size-6.pk: Likewise.
* testsuite/poke.pkl/attr-size-5.pk: Likewise.
* testsuite/poke.pkl/attr-size-4.pk: Likewise.
* testsuite/poke.pkl/attr-size-3.pk: Likewise.
* testsuite/poke.pkl/attr-size-2.pk: Likewise.
* testsuite/poke.pkl/attr-diag-1.pk: Likewise.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/strings-4.pk: New test.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-structs-endian-2.pk: New test.
* src/pkl-gen.pks (struct_field_writer): Honour the struct field
endianness while writing.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_decl): Fix bug that causes to rebuild
array writers at every usage.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def: Entries for iogetb and iosetb.
* src/pvm.jitter (iogetb): New instruction.
2020-02-05 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.h: Prototypes for ios_get_bias and ios_set_bias.
* src/ios.c (struct ios): New field `bias'.
(ios_open): Initialize the IOS bias to 0.
(ios_get_bias): New function.
(ios_set_bias): Likewise.
(ios_read_int): Apply the IOS bias.
(ios_read_uint): Likewise.
(ios_read_string): Likewise.
(ios_write_int): Likewise.
(ios_write_uint): Likewise.
(ios_write_string): Likewise.
2020-02-04 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/cdiv-integers-diag-1.pk: New test.
2020-02-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_op_or): Normalize result to 1 or 0.
(pkl_gen_pr_op_and): Likewise.
* testsuite/poke.pkl/eq-integers-3.pk: New test.
* testsuite/poke.pkl/eq-integers-4.pk: Likewise.
* testsuite/poke.pkl/not-5.pk: Likewise.
* testsuite/poke.pkl/sub-integers-5.pk: Likewise.
* testsuite/poke.pkl/xor-2.pk: Likewise.
* testsuite/poke.pkl/ior-2.pk: Likewise.
* testsuite/poke.pkl/and-14.pk: Likewise.
* testsuite/poke.pkl/or-5.pk: Likewise.
* testsuite/poke.pkl/bnot-integers-3.pk: Likewise.
* testsuite/poke.pkl/bnot-integers-4.pk: Likewise.
* testsuite/poke.pkl/mod-integers-3.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-3.pk: Likewise.
* testsuite/poke.pkl/div-integers-3.pk: Likewise.
* testsuite/poke.pkl/ge-integers-4.pk: Likewise.
* testsuite/poke.pkl/le-integers-4.pk: Likewise.
* testsuite/poke.pkl/gt-integers-3.pk: Likewise.
* testsuite/poke.pkl/lt-integers-3.pk: Likewise.
* testsuite/poke.pkl/ge-offsets-5.pk: Likewise.
* testsuite/poke.pkl/le-offsets-4.pk: Likewise.
* testsuite/poke.pkl/lt-offsets-5.pk: Likewise.
* testsuite/poke.pkl/neq-offsets-5.pk: Likewise.
* testsuite/poke.pkl/eq-offsets-7.pk: Likewise.
* testsuite/poke.pkl/gt-offsets-5.pk: Likewise.
* testsuite/poke.pkl/and-15.pk: Likewise.
* testsuite/poke.pkl/mul-offsets-10.pk: Likewise.
2020-02-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-ios.c (ios_cmd): Define.
(pk_cmd_ios): New function.
(pk_cmd_file): Do not accept tag arguments.
(pk_cmd_mem): Likewise.
* src/pk-cmd.c (ios_cmd): Define.
(dot_cmds): Add ios_cmd.
* doc/poke.texi (ios command): New chapter.
* testsuite/poke.pkl/ios-1.pk: New test.
2020-02-03 Egeyar Bagcioglu <egeyar@gmail.com>
* pickles/ctf.pk: Correct the filename on the first line of the file.
* src/ios-dev-mem.c: Likewise.
* src/ios.h: Fix typo.
2020-02-03 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import pmccabe2html module.
* Makefile.am (cyclo-$(PACKAGE).html): New target.
* HACKING (Maintenance): Document make cyclo-poke.html.
2020-02-03 Jose E. Marchesi <jemarch@gnu.org>
* src/ios-dev-file.c (ios_dev_file_close): Free the IOD structure.
* src/ios-dev-mem.c (ios_dev_mem_close): Likewise.
* testsuite/poke.pkl/close-2.pk: New test.
2019-11-06 Darshit Shah <darnir@gnu.org>
* src/pk-hserver.c (read_from_client): Fix off by one when terminating
the string
* src/pk-file.c (print_info_file): Fix errors introduced when merging
master into the hyperserver branch.
2019-11-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-file.c (print_info_file): Use terminal hyperlinks if
available.
2019-11-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-hserver.c (pk_hserver_get_token): New function.
(pk_hserver_make_hyperlink): Likewise.
(pk_hserver_port): New function.
* src/pk-repl.c (pk_repl): Emit an hyperlink for .help.
* src/pk-term.c (pk_term_hyperlink): Fix guard.
(pk_term_end_hyperlink): Likewise.
2019-11-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-repl.h: New file.
* src/pk-repl.c: Likewise.
* src/Makefile.am (poke_SOURCES): Add pk-repl.h and pk-repl.c.
* src/poke.c (repl): Remove function.
(main): Call pk_repl instead of repl.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-hserver.h: New file.
* src/pk-hserver.c: Likewise.
* src/poke.c: Initialize and finalize the hyperlinks server.
* configure.ac: Add support for --enable-hserver and set the
HSERVER automake conditional.
* src/Makefile.am (poke_SOURCES): Add pk-hserver.h and
pk-hserver.c.
(poke_LDADD): Link with pthreads if the server is enabled.
* HACKING (Appendix: The Source Tree): list server files.
2019-11-03 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import the socket, bind and
accept modules from gnulib.
2019-11-03 Jose E. Marchesi <jemarch@gnu.org>,
* bootstrap.conf (gnulib_modules): Import the `pthread' module
from gnulib.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/copy-5.pk: New test.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-copy.pk: New file.
* src/Makefile.am (dist_pkgdata_DATA): Add pk-copy.pk.
* HACKING (Appendix): Mention pk-copy.pk.
* src/pk-cmd.c (pk_cmd_init): Load pk-copy.pk.
* src/pk-save.pk (save): Use copy.
* testsuite/poke.cmd/copy-1.pk: New test.
* testsuite/poke.cmd/copy-2.pk: Likewise.
* testsuite/poke.cmd/copy-3.pk: Likewise.
* testsuite/poke.cmd/copy-4.pk: Likewise.
* doc/poke.texi (copy): New chapter.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* src/ios-dev-file.c (ios_dev_file_open): Remove handling of
file://.
* src/ios-dev-mem.c: New file.
* src/Makefile.am (poke_SOURCES): Add ios-dev-mem.c.
* src/ios.c (ios_dev_ifs): Register ios_dev_mem.
* doc/poke.texi (open): Document memory buffer IOS.
(info command): Updated.
* testsuite/poke.pkl/open-2.pk: New file.
* testsuite/poke.pkl/ios-mem-1.pk: Likewise.
* testsuite/poke.pkl/ios-mem-2.pk: Likewise.
* src/pk-misc.c (pk_cmd_mem): New function.
* src/pk-cmd.c (dot_cmds): Register .mem.
* src/pk-ios.c: Renamed from pk-file.c.
* testsuite/poke.cmd/file-mode.pk: Updated.
* doc/poke.texi (mem command): New chapter.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* src/ios-dev.h (IOD_ERROR): Define.
(IOD_EINVAL): Likewise.
* src/ios.h (IOS_EFLAGS): Likewise.
(struct ios_dev_if): Add an `error' argument to `open'.
* src/ios-dev-file.c (ios_dev_file_open): Adapt to interface
change.
* src/ios.c (ios_open): Return IOS_EFLAGS in case of invalid
flags.
* src/pvm.h (PVM_E_IOFLAGS): Define.
* src/pkl-rt.pk (E_io_flags): Likewise.
(_pkl_exception_handler): Handle E_io_flags.
* src/pvm.jitter (open): Raise PVM_E_IOFLAGS whenever necessary.
2020-02-02 John Darrington <john@darrington.wattle.id.au>
* bootstrap.conf (gnulib_modules): Add findprog.
* src/pk-editor.c (pk_cmd_editor): Default to "sensible-editor"
if the EDITOR variable is not set.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/save-1.pk: New file.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-rt.pk (IOS_F_APPEND): Remove.
* src/ios.h (IOS_F_APPEND): Likewise.
* src/ios-dev-file.c (ios_dev_file_open): Do not use "a" modes in
fopen.
* doc/poke.texi (open): Update.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-save.pk: New file.
* src/pk-cmd.c (pk_cmd_init): Load pk-save.pk
* src/Makefile.am (dist_pkgdata_DATA): Add pk-save.pk.
* doc/poke.texi (save): New chapter.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.h (IOS_M_RDONLY): Use parenthesis in macro definition.
(IOS_M_WRONLY): Likewise.
(IOS_M_RDWR): Likewise.
* src/pk-cmd.c (pk_cmd_exec_1): Fix usage of ios_flags.
2020-02-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (open): Document the `flags' optional argument to
open.
2020-02-01 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.h (ios_open): Get a flags argument.
(IOS_F_READ): Define.
(IOS_F_WRITE): Likewise.
(IOS_F_APPEND): Likewise.
(IOS_F_CREATE): Likewise.
(IOS_F_TRUNCATE): Likewise.
(IOS_M_RDONLY): Likewise.
(IOS_M_WRONLY): Likewise.
(IOS_M_RDWR): Likewise.
* src/ios.c (ios_open): Likewise.
* src/pkl-rt.pk (open): get an optional argument for the flags.
(IOS_F_READ): Define.
(IOS_F_WRITE): Likewise.
(IOS_F_APPEND): Likewise.
(IOS_F_CREATE): Likewise.
(IOS_M_RDONLY): Likewise.
(IOS_M_WRONLY): Likewise.
(IOS_M_RDWR): Likewise.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): The `open' instruction now
takes two arguments.
* src/pvm.jitter (open): Likewise.
* src/pk-file.c (print_info_file): Adapt to new flags.
2020-02-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (mka): Initialize non-initialized elements in the
array.
* testsuite/poke.pkl/arrays-4.pk: Update to new semantics.
* testsuite/poke.pkl/arrays-index-1.pk: Likewise.
* doc/poke.texi (Array Literals): Update.
2020-01-31 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (pkl_fold_ps_indexer): New handler.
(pkl_phase_fold): Register pkl_fold_ps_indexer.
* testsuite/poke.pkl/strings-index-diag-1.pk: New test.
* testsuite/poke.pkl/arrays-index-diag-1.pk: Likewise.
* testsuite/poke.pkl/arrays-index-diag-2.pk: Likewise.
* testsuite/poke.pkl/strings-index-diag-2.pk: Likewise.
* testsuite/poke.pkl/arrays-index-diag-3.pk: Likewise.
* testsuite/poke.pkl/arrays-index-1.pk: Likewise.
* testsuite/poke.pkl/strings-index-diag-3.pk: Likewise.
* testsuite/poke.pkl/arrays-2.pk: Adapt to constant folding.
* testsuite/poke.pkl/arrays-6.pk: Likewise.
* testsuite/poke.pkl/arrays-8.pk: Likewise.
* testsuite/poke.pkl/arrays-9.pk: Likewise.
* testsuite/poke.pkl/arrays-10.pk: Likewise.
* testsuite/poke.pkl/arrays-11.pk: Likewise.
2020-01-31 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.c (ios_read_string): Support reading strings from
non-byte aligned offsets.
(ios_write_string): Likewise, for writing.
* testsuite/poke.map/maps-strings-2.pk: New test.
* testsuite/poke.map/maps-strings-diag-1.pk: Likewise.
* testsuite/poke.map/maps-strings-diag-2.pk: Likewise.
* testsuite/poke.map/maps-strings-diag-4.pk: Likewise.
* testsuite/poke.map/maps-strings-3.pk: Likewise.
2020-01-31 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def (PKL_INSN_IOSIZE): New instruction.
* src/pkl-ast.h (PKL_AST_BUILTIN_IOSIZE): Define.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Handle iosize builtin.
* src/pkl-lex.l: New token BUILTIN_IOSIZE.
* src/pkl-rt.pk (iosize): New builtin.
* src/pkl-tab.y (builtin): Handle the iosize builtin.
* bootstrap.conf (gnulib_modules): Import `fstat' module.
* src/ios.h: Prototype for ios_size.
* src/ios.c (ios_size): Define.
* src/ios-dev.h (struct ios_dev_if): New IOD operation `size'.
* src/pvm.jitter (iosize): New instruction.
* src/ios-dev-file.c (ios_dev_file_size): New function.
* doc/poke.texi (iosize): New section.
* testsuite/poke.pkl/iosize-1.pk: New file.
* testsuite/poke.pkl/iosize-diag-1.pk: Likewise.
2020-01-31 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def (PKL_INSN_SYNC): Define.
* src/pvm.c (pvm_run): Install the pvm signal handler to handle
SIGINT.
* src/pkl-asm.c (pkl_asm_endloop): Emit a sync instruction before
branching back.
(pkl_asm_for_endloop): Likewise.
* src/pvm.h (PVM_E_SIGNAL): Define.
* src/pkl-rt.pk (E_signal): Likewise.
* src/pvm.jitter (sync): New instruction.
(exit): Clear signals before exiting the PVM.
(late-c): Define pvm_handle_signal.
* HACKING (Signal Handling): New section.
2020-01-31 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: Add Bruno Haible to the Write After Approval list.
2020-01-28 Darshit Shah <darnir@gnu.org>
* bootstrap.conf: Update minimum required Automake to 1.14
Downgrade minimum required flex to 2.5.37
Add makeinfo as a build dependency
2020-01-24 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/sl-2.pk: New test.
* testsuite/poke.pkl/sl-8.pk: Likewise.
* testsuite/poke.pkl/sl-7.pk: Likewise.
* testsuite/poke.pkl/sl-6.pk: Likewise.
* testsuite/poke.pkl/sl-5.pk: Likewise.
* testsuite/poke.pkl/sl-4.pk: Likewise.
* testsuite/poke.pkl/sl-3.pk: Likewise.
2020-01-17 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (function_type_specifier): Fix definition to not
allow trailing commas.
(function_type_arg_list): The list of arguments can't be empty.
* etc/poke.g4: Likewise.
* testsuite/poke.pkl/fun-types-diag-2.pk: New test.
2020-01-17 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke.g4: New file.
* HACKING (Appendix): Add mention to etc/poke.g4.
(Grammarinator): New section.
2020-01-17 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.c (pvm_print_binary): Make non-static.
* src/pvm-val.h: Prototype for pvm_print_binary.
* src/pvm.jitter (PVM_PRINTI): Handle binary output.
(PVM_PRINTL): Likewise.
* testsuite/poke.pkl/printf-binary-1.pk: New test.
* testsuite/poke.pkl/printf-binary-4.pk: Likewise.
* testsuite/poke.pkl/printf-binary-3.pk: Likewise.
* testsuite/poke.pkl/printf-binary-2.pk: Likewise.
2020-01-18 John Darrington <john@darrington.wattle.id.au>
* configure.ac (AC_INIT): Change email address to poke-devel@gnu.org
* bootstrap.conf: Remove MSGID_BUGS_ADDRESS
* po/poke.pot: regenerate
2020-01-16 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-dump.pk (dump): Add new argument ios and use it in the
maps.
* doc/poke.texi (dump): Document the :ios option.
* testsuite/poke.cmd/dump-8.pk: New test.
2020-01-16 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (pk_print_version): Update copyright years.
2020-01-18 John Darrington <john@darrington.wattle.id.au>
* src/pk-repl.c (poke_getc): Use xzalloc instead of xmalloc.
* src/pkl-ast.c (pkl_ast_make_node): ditto
* src/pkl-env.c (pkl_env_new): ditto
* src/pkl-parser.c (pkl_parser_init): ditto
* src/pkl.c (pkl_new): ditto
* src/pvm.c (pvm_init): ditto
2020-01-16 Darshit Shah <darnir@gnu.org>
* bootstrap.conf: Set --skip-po to be the default option.
* testsuite/poke.map/maps-arrays-19.pk: Extend test to ensure e_EOF is
thrown when reading through End-of-File.
2020-01-16 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-arrays-19.pk: Fix test logic.
2020-01-18 John Darrington <john@darrington.wattle.id.au>
* src/pkl.c: Use std macro for bug report address.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal2_ps_offset): Remove unused local
variable.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Using data files in tests): New section.
(Writing tests that depend on a certain capability): Likewise.
* testsuite/lib/poke-dg.exp (dg-require): Add a note.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* TODO: New task.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_trimmer): check that the
operator of a trimming operation is either an array or a string.
* testsuite/poke.pkl/trim-diag-5.pk: New test.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_struct_type_field): struct
fields cannot be of type `any' nor `void'.
* testsuite/poke.pkl/struct-types-diag-9.pk: New test.
* testsuite/poke.pkl/struct-types-diag-10.pk: Likewise.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-pass.h (PKL_PASS_SUBPASS): fix detection of error when
calling pkl_do_subpass.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (pkl_ice): do not dump files in /etc if --quiet is
used in the command line.
2020-01-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_op_boolean): make sure the
arguments to relational operators are integral.
* testsuite/poke.pkl/and-diag-1.pk: New test.
* testsuite/poke.pkl/xor-diag-1.pk: Likewise.
* testsuite/poke.pkl/or-diag-1.pk: Likewise.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y: Do not try to pop lexical frames in <ast>
destructors.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_cast): Casting to/from void is
not allowed.
* testsuite/poke.pkl/cast-void-diag-1.pk: New test.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_first_operand): Check the type
of the operand for NEG, POS and BNOT.
* testsuite/poke.pkl/neg-diag-1.pk: New test.
* testsuite/poke.pkl/bnot-diag-1.pk: Likewise.
* testsuite/poke.pkl/pos-diag-1.pk: Likewise.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def (PKL_INSN_OSETM): Define.
* src/pvm.jitter (osetm): new instruction.
* src/pkl-gen.c (pkl_gen_ps_op_intexp): Adapt to offsets.
* src/pkl-asm.c (pkl_asm_insn_intop): Likewise.
* testsuite/poke.pkl/neg-offsets-1.pk: New test.
* testsuite/poke.pkl/bnot-offsets-1.pk: Likewise.
* testsuite/poke.pkl/bnot-integers-1.pk: Renamed from bnot-1.pk
* testsuite/poke.pkl/bnot-integers-2.pk: Likewise.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_cast): Check casts from arrays.
* testsuite/poke.pkl/cast-array-diag-8.pk: New file.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (pkl_fold_cdiv): Fix detection of division by zero
for offsets with implicit magnitudes.
(pkl_fold_div): Likewise.
* testsuite/poke.pkl/cdiv-offsets-3.pk: New file.
* testsuite/poke.pkl/div-offsets-4.pk: Likewise.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (pkl_fold_mod): Fix detection of division by zero
for offsets with implicit magnitudes.
* testsuite/poke.pkl/mod-offsets-5.pk: New file.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal1_ps_offset): New handler.
(pkl_phase_anal1): Add handler.
* testsuite/poke.pkl/offset-type-diag-3.pk: New test.
* testsuite/poke.pkl/offsets-diag-2.pk: Likewise.
* doc/poke.texi (Offset Literals): Document that the unit of
offsets shall be bigger than 0.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* TODO: Several updates.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-file.c (print_info_file): Use the IO's id as tags.
(pk_cmd_info_files): Adapt accordingly.
* testsuite/poke.cmd/file-mode.pk: Adjust accordingly.
2020-01-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l: Ignore form feed characters.
* testsuite/poke.pkl/formfeedchar.pk: New file.
* doc/poke.texi (Comments): New chapter.
2020-01-12 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.c (pvm_print_val): Fix printing of hexadecimal
values with odd widths.
* testsuite/poke.map/maps-uint-19.pk: Test for the above.
2020-01-12 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Fixed various typos.
2020-01-12 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (ios_get): Remove.
* src/ios.h (ios_get): Likewise.
* src/pk-file.c (pk_cmd_file): Replace the bogus call to ios_get
with ios_search_by_id.
(pk_cmd_close): Replace the bogus call to ios_get with
ios_search_by_id.
2020-01-12 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/chars-1.pk: New file.
* testsuite/poke.pkl/chars-8.pk: Likewise.
* testsuite/poke.pkl/chars-7.pk: Likewise.
* testsuite/poke.pkl/chars-6.pk: Likewise.
* testsuite/poke.pkl/chars-5.pk: Likewise.
* testsuite/poke.pkl/chars-4.pk: Likewise.
* testsuite/poke.pkl/chars-3.pk: Likewise.
* testsuite/poke.pkl/chars-9.pk: Renamed from chars.pk
2020-01-12 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l (CHAR): Allow '\r' as character literals.
* testsuite/poke.pkl/chars-2.pk: New file.
2020-01-12 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.c (ios_read_string): Fix detection of EOF.
2020-01-12 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (ios_open): Add argument set_cur to control making
the newly opened IO space the current IO space.
* src/ios.h (ios_open): Add the new argument, set_cur.
* src/poke.c (parse_args): Call ios_open with set_cur 1.
* src/pk-file.c (pk_cmd_file): Likewise.
* src/pvm.jitter (instruction open): Call ios_open with set_cur 0.
* testsuite/poke.pkl/close-1.pk: Adjust.
* testsuite/poke.pkl/set-ios-1.pk: Likewise.
2020-01-12 Egeyar Bagcioglu <egeyar@gmail.com>
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Remove PKL_INSN_RETURN from
PKL_AST_BUILTIN_CLOSE which returns void.
* src/pvm.jitter (close): Add JITTER_DROP_STACK.
2020-01-11 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (ios_write_int_common): Add specifiers "static inline".
2020-01-05 Jose E. Marchesi <jemarch@gnu.org>
* src/ras: Stop claiming posix compatibility both as the current
state and a goal.
2020-01-05 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import module
`update-copyright'.
2020-01-03 Egeyar Bagcioglu <egeyar@gmail.com>
* testsuite/poke.map/maps-uint-write-01.pk: New test.
* testsuite/poke.map/maps-uint-write-02.pk: Likewise.
* testsuite/poke.map/maps-uint-write-03.pk: Likewise.
* testsuite/poke.map/maps-uint-write-04.pk: Likewise.
* testsuite/poke.map/maps-uint-write-05.pk: Likewise.
* testsuite/poke.map/maps-uint-write-06.pk: Likewise.
* testsuite/poke.map/maps-uint-write-07.pk: Likewise.
* testsuite/poke.map/maps-uint-write-08.pk: Likewise.
* testsuite/poke.map/maps-uint-write-09.pk: Likewise.
* testsuite/poke.map/maps-uint-write-10.pk: Likewise.
* testsuite/poke.map/maps-uint-write-11.pk: Likewise.
* testsuite/poke.map/maps-uint-write-12.pk: Likewise.
* testsuite/poke.map/maps-uint-write-13.pk: Likewise.
* testsuite/poke.map/maps-uint-write-14.pk: Likewise.
* testsuite/poke.map/maps-uint-write-15.pk: Likewise.
* testsuite/poke.map/maps-uint-write-16.pk: Likewise.
* testsuite/poke.map/maps-uint-write-17.pk: Likewise.
* testsuite/poke.map/maps-uint-write-18.pk: Likewise.
* testsuite/poke.map/maps-uint-write-19.pk: Likewise.
* testsuite/poke.map/maps-uint-write-20.pk: Likewise.
* testsuite/poke.map/maps-uint-write-21.pk: Likewise.
* testsuite/poke.map/maps-uint-write-22.pk: Likewise.
* testsuite/poke.map/maps-uint-write-23.pk: Likewise.
* testsuite/poke.map/maps-uint-write-24.pk: Likewise.
* testsuite/poke.map/maps-uint-write-25.pk: Likewise.
* testsuite/poke.map/maps-uint-write-26.pk: Likewise.
* testsuite/poke.map/maps-uint-write-27.pk: Likewise.
* testsuite/poke.map/maps-uint-write-28.pk: Likewise.
* testsuite/poke.map/maps-uint-write-29.pk: Likewise.
* testsuite/poke.map/maps-uint-write-30.pk: Likewise.
* testsuite/poke.map/maps-uint-write-31.pk: Likewise.
* testsuite/poke.map/maps-uint-write-32.pk: Likewise.
* testsuite/poke.map/maps-uint-write-33.pk: Likewise.
* testsuite/poke.map/maps-uint-write-34.pk: Likewise.
* testsuite/poke.map/maps-uint-write-35.pk: Likewise.
* testsuite/poke.map/maps-uint-write-36.pk: Likewise.
* testsuite/poke.map/maps-uint-write-37.pk: Likewise.
* testsuite/poke.map/maps-uint-write-38.pk: Likewise.
* testsuite/poke.map/maps-uint-write-39.pk: Likewise.
* testsuite/poke.map/maps-uint-write-40.pk: Likewise.
* testsuite/poke.map/maps-uint-write-41.pk: Likewise.
* testsuite/poke.map/maps-uint-write-42.pk: Likewise.
* testsuite/poke.map/maps-uint-write-43.pk: Likewise.
* testsuite/poke.map/maps-uint-write-44.pk: Likewise.
* testsuite/poke.map/maps-uint-write-45.pk: Likewise.
* testsuite/poke.map/maps-uint-write-46.pk: Likewise.
* testsuite/poke.map/maps-uint-write-47.pk: Likewise.
* testsuite/poke.map/maps-uint-write-48.pk: Likewise.
* testsuite/poke.map/maps-uint-write-49.pk: Likewise.
* testsuite/poke.map/maps-uint-write-50.pk: Likewise.
* testsuite/poke.map/maps-uint-write-51.pk: Likewise.
* testsuite/poke.map/maps-uint-write-52.pk: Likewise.
* testsuite/poke.map/maps-uint-write-53.pk: Likewise.
* testsuite/poke.map/maps-uint-write-54.pk: Likewise.
* testsuite/poke.map/maps-uint-write-55.pk: Likewise.
* testsuite/poke.map/maps-uint-write-56.pk: Likewise.
* testsuite/poke.map/maps-uint-write-57.pk: Likewise.
* testsuite/poke.map/maps-uint-write-58.pk: Likewise.
* testsuite/poke.map/maps-uint-write-59.pk: Likewise.
* testsuite/poke.map/maps-uint-write-60.pk: Likewise.
* testsuite/poke.map/maps-uint-write-61.pk: Likewise.
* testsuite/poke.map/maps-uint-write-62.pk: Likewise.
* testsuite/poke.map/maps-uint-write-63.pk: Likewise.
* testsuite/poke.map/maps-uint-write-64.pk: Likewise.
* testsuite/poke.map/maps-uint-write-65.pk: Likewise.
* testsuite/poke.map/maps-uint-write-66.pk: Likewise.
* testsuite/poke.map/maps-uint-write-67.pk: Likewise.
* testsuite/poke.map/maps-uint-write-68.pk: Likewise.
* testsuite/poke.map/maps-uint-write-69.pk: Likewise.
* testsuite/poke.map/maps-uint-write-70.pk: Likewise.
* testsuite/poke.map/maps-uint-write-71.pk: Likewise.
* testsuite/poke.map/maps-uint-write-72.pk: Likewise.
* testsuite/poke.map/maps-uint-write-73.pk: Likewise.
* testsuite/poke.map/maps-uint-write-74.pk: Likewise.
2020-01-03 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (IOS_PUT_C_ERR_CHCK): New macro.
(ios_write_int_fast): New function.
(ios_write_int_common): Likewise.
(ios_write_int): Rewrite.
(ios_write_uint): Rewrite.
2020-01-03 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (ios_mask_first_byte): Replace this function with ...
(IOS_CHAR_GET_LSB): ... this macro.
(ios_mask_last_byte): Replace this function with ...
(IOS_CHAR_GET_MSB): ... this macro.
(ios_read_int_common): Replace the calls to ios_mask_first_byte
and ios_mask_last_byte with IOS_CHAR_GET_LSB and
IOS_CHAR_GET_MSB, respectively.
2019-12-29 John Darrington <john@darrington.wattle.id.au>
* src/ios-dev-file.c (ios_dev_file_open): Use a more reliable
method to determine the file's mode.
(ios_dev_file_get_mode): New function.
* src/ios-dev.h (struct ios_dev_if) [get_mode]: New member.
* src/ios.c (ios_mode): Use method from implementation.
* src/ios.h (IOS_M_RDONLY): New macro.
* testsuite/poke.cmd/file-mode.pk: New file.
2019-12-22 John Darrington <john@darrington.wattle.id.au>
* src/pkl.c (pkl_ast): Fix bugs dealing with path search.
2019-12-22 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (pk_cmd_exec_1): Properly initialise argc
instead of relying on subsequent assignment.
2019-12-21 John Darrington <john@darrington.wattle.id.au>
* src/pk-file.c (pk_cmd_file): Fix memory leaks and
check for failures on opening file.
2019-12-21 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk (days_in_month): Simplify the code a bit.
2019-12-16 Dan Čermák <dan.cermak@cgc-instruments.com>
* src/pk-repl.c (pk_repl): fix memory leak of poke_history
* src/pk-cmd.c (pk_cmd_exec): fix memory leak of ecmd
* src/pk-cmd.c (pk_cmd_exec_1): fix memory leak of filename
* src/pk-cmd.c (null_cmd): properly initialize struct
2019-12-15 John Darrington <john@darrington.wattle.id.au>
*src/ios.c (ios_mask_last_byte) simplify
*src/ios.c (ios_mask_first_byte) simplify
2019-12-16 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.pks (atrim): The mka instruction expects the type of
the array, not the type of the elements stored in the array.
* testsuite/poke.pkl/trim-25.pk: New test.
2019-12-15 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Date and Time Functions): New chapter.
* src/std.pk (posix_time32): New type.
* testsuite/poke.std/time32.pk: New file.
2019-12-15 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Scripts): Elaborate on what scripts are
(and what they are not).
2019-12-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_ass_stmt): Remove obsolete
check.
* testsuite/poke.pkl/ass-function-1.pk: New test.
2019-12-13 Dan Čermák <dan.cermak@posteo.net>
* src/pkl-env.c (hash_string): Avoid overflow of signed integers
in hash calculation.
2019-12-13 Dan Čermák <dan.cermak@posteo.net>
* src/pk-cmd.c (pk_cmd_get_next_match): Fix buffer overflow.
2019-12-12 Dan Čermák <dan.cermak@posteo.net>
* src/pkl-ast.c (pkl_print_type): Fix call to fprintf to use "%s"
to print a non-constant string.
2019-12-10 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_is_complete): Struct types having
fields with labels are no complete types.
(pkl_ast_sizeof_type): Assert if a struct type with field labels
is not marked as complete.
* testsuite/poke.pkl/offsets-diag-1.pk: New test.
2019-12-08 John Darrington <john@darrington.wattle.id.au>
* src/pkl-lex. (CHAR): Accept \\ as a CHAR token.
* testsuite/poke.pkl/chars.pk: Add new test.
* doc/poke.texi (Characters): Document new escape sequence.
2019-12-01 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Offset Literals): Change the example to agree with the text.
2019-12-10 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_mul): Do not accept multiplying
strings.
* testsuite/poke.pkl/mul-strings-diag-1.pk: New test.
2019-12-10 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (offset_type_specifier): Allow integer literals as
offset units.
* src/pkl-anal.c (pkl_anal1_ps_type_offset): New handler.
(pkl_phase_anal1): Install handler.
* testsuite/poke.pkl/casts-offsets-4.pk: New test.
* testsuite/poke.pkl/cast-offsets-diag-3.pk: Likewise.
* doc/poke.texi (Offset Types): Mention using integers as offset
type units.
2019-12-09 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-cmd.h: Document the value returned by pk_cmd_exec.
* src/pk-cmd.c (pk_cmd_exec_script): Fix the value returned by the
function to match the function prototype documentation.
* src/poke.c (parse_args): Improve the check for the result value
of pk_cmd_exec_script.
(initialize_user): Likewise.
2019-12-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (pkl_ice): Use an hyperlink for the bug report
address.
* src/pkl-asm.c (pkl_asm_catch): Remove obsolete comment.
* src/pkl-env.c (pkl_env_dup_toplevel): Likewise.
2019-12-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def: New instruction ASETO.
* src/pvm.jitter (aseto): Define.
2019-12-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_cast): Detect invalid casts,
and diagnose them.
* testsuite/poke.pkl/cast-struct-diag-1.pk: New test.
* testsuite/poke.pkl/cast-offsets-diag-2.pk: Likewise.
* testsuite/poke.pkl/cast-offsets-diag-1.pk: Likewise.
* testsuite/poke.pkl/cast-str-diag-1.pk: Likewise.
* testsuite/poke.pkl/cast-struct-diag-2.pk: Likewise.
2019-12-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c: Define cdivo semantic routines for UUU and III
cases.
(pkl_fold_cdiv): Fold /^ operations on offsets.
2019-12-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/offset-arg-1.pk: New test.
* testsuite/poke.pkl/offset-arg-2.pk: Likewise.
2019-12-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c: Define pkl_fold_gcd using gnulib's <gcd.c.>
(EMUL_UUU): Define for gcd.
(pkl_fold_gcd): Define handler.
(pkl_phase_fold): Register handler.
(OP_BINARY_OOI): Make sure operands are offsets
before accessing their magnitude/units.
(OP_BINARY_OOO): Likewise.
(OP_BINARY_OOI): Fix handling of base_type.
* src/pkl-promo.c (promote_offset): Support non-integer units.
(pkl_promo_ps_op_div): Adjust to new API.
(pkl_promo_ps_op_add_sub_mod): Likewise.
(pkl_promo_ps_op_mul): Likewise.
(pkl_promo_ps_op_rela): Likewise.
(pkl_promo_ps_type_array): Likewise.
(pkl_promo_ps_ass_stmt): Likewise.
(pkl_promo_ps_funcall): Likewise.
(pkl_promo_ps_return_stmt): Likewise.
(pkl_promo_ps_func_arg): Likewise.
(pkl_promo_ps_map): Likewise.
(pkl_promo_ps_struct_type_field): Likewise.
(pkl_promo_ps_op_in): Likewise.
* src/pkl-ops.def: Define PKL_AST_OP_GCD.
* src/pkl-typify.c (CASE_OFFSET): Use pkl_ast_make_binary_exp and
do not assume the unit types are integers, but avoid superfluous
casts whenever possible.
(CASE_OFFSET): Likewise.
* src/pkl.c (rest_of_compilation): Run a constant folding phase at
the beginning of the middle end pass.
* testsuite/poke.pkl/add-offsets-9.pk: New test.
* testsuite/poke.pkl/eq-offsets-6.pk: Likewise.
* testsuite/poke.pkl/eq-offsets-5.pk: Likewise.
* testsuite/poke.pkl/mod-offsets-4.pk: Likewise.
* testsuite/poke.pkl/mod-offsets-3.pk: Likewise.
* testsuite/poke.pkl/div-offsets-3.pk: Likewise.
* testsuite/poke.pkl/div-offsets-2.pk: Likewise.
* testsuite/poke.pkl/mul-offsets-9.pk: Likewise.
* testsuite/poke.pkl/sub-offsets-8.pk: Likewise.
* testsuite/poke.pkl/sub-offsets-7.pk: Likewise.
* testsuite/poke.pkl/add-offsets-10.pk: Likewise.
2019-12-01 John Darrington <john@darrington.wattle.id.au>
* bootstrap.conf: Remove "system"
2019-12-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_type_array): Do not calculate the
array bound when building array types.
* testsuite/poke.map/maps-arrays-18.pk: New test.
2019-12-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_phase_transl): Install
pkl_transl_{pr,ps}_map handlers for struct type fields.
(pkl_transl_pr_type_struct): Only break the pass when into a map.
* testsuite/poke.map/maps-arrays-17.pk: New test.
2019-12-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_if_stmt): New handler.
(pkl_phase_typify1): Install it.
* testsuite/poke.pkl/if-diag-1.pk: New test.
* testsuite/poke.pkl/if-diag-2.pk: Likewise.
* testsuite/poke.pkl/if-diag-3.pk: Likewise.
2019-12-03 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Sym): New type.
(STB_LOCAL): New variable.
(STB_GLOBAL): Likewise.
(STB_WEAK): Likewise.
(STB_LOOS): Likewise.
(STB_HIOS): Likewise.
(STB_LOPROC): Likewise.
(STB_HIPROC): Likewise.
(STV_DEFAULT): Likewise.
(STV_INTERNAL): Likewise.
(STV_HIDDEN): Likewise.
(STV_PROTECTED): Likewise.
2019-12-01 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (dump): Numerous minor changes.
2019-12-01 Luca Saiu <positron@gnu.org>
* src/pkl-insn.def (PKL_INSN_TUCK): Define new instruction.
* src/pvm.jitter (rot, nrot): Simplify definition using Jitter
macro.
(tuck): New instruction.
(revn): Add specialized arguments. Use unsigned JITTER_ARGU0 to
catch bugs more easily.
(swap-over-to-tuck): New rewrite rule.
(rot-swap-to-quake): Re-introduce deleted rewrite rule, which was
actually correct.
* pkl-asm.pks (remap, write, addo, subo, mulo, divo, modo, atrim)
(cdivo, ais, bconc): Simplify and optimize using new instructions.
* src/pkl-gen.pks (struct_field_mapper): Likewise.
2019-12-01 John Darrington <john@darrington.wattle.id.au>
* src/pk_dump.pk (dump): New parameter cluster_by
2019-12-01 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (dump): Document the dump command.
2019-11-30 John Darrington <john@darrington.wattle.id.au>
* testsuite/poke.std/crc32.pk: New file.
2019-11-30 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (pk_cmd_find): Use STREQ instead of strcmp.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_map): Fix bug in optimization.
* testsuite/poke.pkl/map-offset-expr-1.pk: New test.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.pks (atrim): Fix calculation of the resulting mapped
array offset.
* testsuite/poke.map/maps-trims-1.pk: New test.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (siz): Modify to generate a bit-offset in an
ulong<64> instead of an offset.
* src/pkl-gen.pks (off_plus_sizeof): Remove.
(array_mapper): Adapt accordingly.
(array_valmapper): Likewise.
(struct_field_mapper): Likewise.
* src/pkl-asm.pks (array_conv_siz): Likewise.
* src/pkl-gen.c (pkl_gen_ps_op_attr): Likewise.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (array_valmapper): Adapt to bit-offsets.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.pks (atrim): Adapt to bit-offsets.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_ps_op_attr): Convert the value returned
by mgeto to an offset value.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.c (pvm_sizeof): Struct fields now store bit-offsets
instead of offsets.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_type_offset): Fix regression.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_type_array): Convert sbounds in maps
to bit-offsets.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_writer): Adapt to bit-offsets.
(struct_field_writer): Likewise.
(array_writer): Likewise.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_mapper): Use bit-offsets for the struct
offsets.
(struct_field_mapper): Likewise.
(handle_struct_field_label): Likewise.
(off_plus_sizeof): Likewise.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (array_mapper): Use bit-offsets for the array
offsets and for sbound.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_map): Convert map argument to
bit-offset.
(pkl_gen_pr_ass_stmt): Likewise.
(pkl_gen_pr_type_offset): Do not convert to bit-offset.
(pkl_gen_ps_type_integral): Likewise.
(pkl_gen_ps_type_string): Likewise.
* src/pvm.jitter: Remove invalid rot-swap-to-quake rewrite.
2019-11-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter: Update comments to reflect that peek/poke
instructions get bit-offsets, not regular offsets.
2019-11-24 John Darrington <john@darrington.wattle.id.au>
* src/pk-file (pk_file_readable): New function.
(pk_cmd_load_file): Use it to check files before
opening.
2019-11-24 John Darrington <john@darrington.wattle.id.au>
* src/pk-term.c: Remove unnecessary #include <sys/stat.h>
2019-11-28 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-data): Avoid appending duplicated
file names to poke_data_files.
(poke_finish): Fix deleting the temporary files.
2019-11-28 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter: Add ios_write_string to the list of wrapped
functions.
(pokes): Implement instruction.
* src/ios.c (ios_write_string): Implement.
* testsuite/poke.map/ass-map-3.pk: New test.
* testsuite/poke.map/ass-map-4.pk: Likewise.
* testsuite/poke.map/ass-map-5.pk: Likewise.
2019-11-28 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal1_ps_return_stmt): New handler.
(pkl_phase_anal1): Register it.
* testsuite/poke.pkl/return-diag-2.pk: New test.
2019-11-28 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_type_offset): New handler.
(pkl_phase_typify1): Register it.
* testsuite/poke.pkl/offset-type-diag-1.pk: New test.
* testsuite/poke.pkl/offset-type-diag-2.pk: Likewise.
2019-11-24 John Darrington <john@darrington.wattle.id.au>
* src/std.pk (crc32): New function.
* doc/poke.texi (CRC Functions): New node.
2019-11-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (quake): New instruction.
(rot-swap-to-quake): New rewrite rule.
2019-11-24 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (pk_cmd_exec_script): Use getline instead
of a loop and getc.
2019-11-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-alloc.c (pvm_realloc): New function.
* src/pkl-asm.c (pkl_asm_insn): Remove hard limit
PKL_AST_MAX_POINTERS, reallocating memory as necessary.
(pkl_asm_new): Initialize pointers to NULL.
2019-11-26 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (poke-dg-test): Pass -q to poke to
avoid reading ~/.pokerc.
2019-11-26 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.c (IOS_GET_C_ERR_CHCK): Make sure to check get_c return
value as an int before casting it.
* src/ios-dev-file.c (ios_dev_file_getc): Do not rely on EOF ==
IOD_EOF.
2019-11-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_is_complete): Handle function types.
* src/pkl-typify.c (pkl_typify1_ps_op_unmap): New handler.
* testsuite/poke.pkl/unmap-diag-1.pk: New test.
2019-11-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_is_complete): Fix handling of
structs.
2019-11-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_type_mappable_p): New function.
* src/pkl-typify.c (pkl_typify1_ps_map): Check for types that
cannot be mapped and error about it.
* testsuite/poke.pkl/map-diag-3.pk: Likewise.
* testsuite/poke.pkl/map-diag-2.pk: Likewise.
* testsuite/poke.pkl/map-diag-1.pk: New test.
* testsuite/poke.pkl/map-diag-7.pk: Likewise.
* testsuite/poke.pkl/map-diag-6.pk: Likewise.
* testsuite/poke.pkl/map-diag-5.pk: Likewise.
* testsuite/poke.pkl/map-diag-4.pk: Likewise.
2019-11-22 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/struct-types-diag-8.pk: Rewrite.
2019-11-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (offset_type_specifier): Allow simple types only
for the offset unit.
2019-11-19 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi: Add indeces.
2019-11-19 John Darrington <john@darrington.wattle.id.au>
* src/pk-dump.pk (print_ascii): New function. (print_hex) New function.
(print_data): Deal properly with EOF and data not ending on 16#B boundary.
* testsuite/poke.cmd/dump-5.pk: New file.
* testsuite/poke.cmd/dump-6.pk: New file.
* testsuite/poke.cmd/dump-7.pk: New file.
2019-11-17 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (Standard Integral Types): Correct size of nibble.
2019-11-21 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Field Constraints): New section.
2019-11-15 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (__LINE__ and __FILE__): New chapter.
2019-11-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks: Fix handling of sboundm.
* testsuite/poke.map/maps-arrays-16.pk: New test.
2019-11-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y: New tokens UU_LINE_UU and UU_FILE_UU.
* src/pkl-lex.l: Rules for __FILE__ and for __LINE__.
* testsuite/poke.pkl/uu-line-1.pk: New test.
* testsuite/poke.pkl/uu-file-1.pk: Likewise.
2019-11-15 Jose E. Marchesi <jemarch@gnu.org>
* man/Makefile.am (poke.1): Go back to depend on the source file
to avoid distcheck to fail. This time, make sure the executable
exists before invoking help2man.
2019-11-15 Jose E. Marchesi <jemarch@gnu.org>
* pickles/leb128.pk: Remove trailing blanks.
* testsuite/lib/poke-dg.exp: Likewise.
* src/pvm.jitter: Likeise.
* src/pkl-typify.c: Likewise.
* src/pkl-tab.y: Likewise.
* src/pkl-promo.c: Likewise.
* src/pkl-gen.c: Likewise.
* src/pkl-ast.h: Likewise.
* src/pkl-ast.c: Likewise.
* src/pk-editor.c: Likewise.
* testsuite/poke.map/ass-map-1.pk: Remove empty lines at EOF.
* testsuite/poke.std/atoi-9.pk: Likewise.
* testsuite/poke.std/atoi-8.pk: Likewise.
* testsuite/poke.std/atoi-7.pk: Likewise.
* testsuite/poke.std/atoi-6.pk: Likewise.
* testsuite/poke.std/atoi-5.pk: Likewise.
* testsuite/poke.std/atoi-4.pk: Likewise.
* testsuite/poke.std/atoi-3.pk: Likewise.
* testsuite/poke.std/atoi-2.pk: Likewise.
* testsuite/poke.std/atoi-13.pk: Likewise.
* testsuite/poke.std/atoi-12.pk: Likewise.
* testsuite/poke.std/atoi-11.pk: Likewise.
* testsuite/poke.std/atoi-10.pk: Likewise.
* testsuite/poke.std/atoi-1.pk: Likewise.
* testsuite/poke.pkl/try-until-3.pk: Likewise.
* testsuite/poke.pkl/strings-1.pk: Likewise.
* testsuite/poke.pkl/ass-map-diag-2.pk: Likewise.
* testsuite/poke.pkl/ass-map-diag-1.pk: Likewise.
* testsuite/poke.map/maps-offsets-2.pk: Likewise.
* testsuite/poke.map/maps-offsets-1.pk: Likewise.
* testsuite/poke.map/maps-ios-1.pk: Likewise.
* testsuite/poke.map/ass-map-2.pk: Likewise.
* .x-sc_prohibit_atoi_atof: New file.
* doc/poke.texi (IO Spaces): s/filesystem/file system/.
* src/ios.c: Avoid double word in comment.
* man/Makefile.am (poke.1): Do not use $< in this non-implicit
rule.
2019-11-13 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.h (completer_t): New typedef.
(pk_cmd) [completer]: New member;
2019-11-13 John Darrington <john@darrington.wattle.id.au>
* src/pkl-env.h (pkl_ast_node_iter): New struct.
(pkl_env_iter_begin): New declaration.
(pkl_env_iter_next): New declaration.
(pkl_env_iter_end): New declaration.
* src/pkl-env.c (pkl_env_iter_begin): New function.
(pkl_env_iter_next): New function.
(pkl_env_iter_end): New function.
(pkl_env_map_decls): Use them to implement this function.
2019-11-13 John Darrington <john@darrington.wattle.id.au>
* src/pk-cmd.c (cmds): Rename to dot_cmds.
(pk_cmd_init): Deal with the consequences.
2019-11-14 Jose E. Marchesi <jemarch@gnu.org>
* man/Makefile.am: New file.
* Makefile.am (SUBDIRS): Add the man directory.
* doc/poke.texi (pokerc): New chapter.
* configure.ac: Initialize HELP2MAN.
2019-11-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def: peeklu, peekiu, pokelu and pokeiu get two
arguments, not three.
* testsuite/poke.pkl/struct-types-endian-1.pk: New test.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_ps_op_in): Delete commented out code.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Installing Obvious Changes): Fix typo
2019-11-13 John Darrington <john@darrington.wattle.id.au>
* HACKING (Dejagnu): Fix typo.
(libtextstyle): Fix typo.
2019-11-13 John Darrington <john@darrington.wattle.id.au>
* src/pk-repl.c (pk_repl): Remove superfluous tests of the
variable "line".
2019-11-13 John Darrington <john@darrington.wattle.id.au>
* src/poke.c (pk_print_version): Update translatable strings.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y: Add missing trailing ';' in the try-until syntax
rule.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Exceptions): Document the ranges of exceptions.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/get-ios-1.pk: New test.
* testsuite/poke.pkl/get-ios-2.pk: Likewise.
* testsuite/poke.pkl/set-ios-1.pk: Likewise.
* testsuite/poke.pkl/close-1.pk: Likewise.
* testsuite/poke.pkl/open-1.pk: Likewise.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (IO Spaces): New section.
(open): New subsection.
(close): Likewise.
(get_ios): Likewise.
(set_ios): Likewise.
(The Map Operator): Update to cover the ternary map operator.
2019-11-13 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-data): Accept a file name
argument.
(poke_finish): poke_data_files is now a list.
* testsuite/poke.map/maps-ios-1.pk: New test.
* testsuite/poke.map/maps-ios-2.pk: Likewise.
* testsuite/poke.map/maps-ios-3.pk: Likewise.
* testsuite/poke.map/maps-ios-4.pk: Likewise.
* testsuite/poke.map/maps-ios-5.pk: Likewise.
* testsuite/poke.map/maps-ios-6.pk: Likewise.
* testsuite/poke.map/maps-ios-7.pk: Likewise.
2019-11-12 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (peeks): Take an IOS argument.
(PVM_PEEK): Likewise.
(PVM_POKE): Likewise.
* src/pkl-gen.c (pkl_gen_pr_map): Pass the IO argument to the
mappers.
(pkl_gen_ps_type_integral): Take an IOS argument for mappers and
writers.
(pkl_gen_ps_type_string): Likewise.
(pkl_gen_pr_type_offset): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_pr_type_struct): Likewise.
(pkl_gen_pr_ass_stmt): Pass IOS to the l-value map.
* src/pkl-gen.pks (array_mapper): Likewise.
(array_writer): Likewise.
(struct_mapper): Likewise.
(struct_field_mapper): Likewise.
(op_unmap): Set ios to null.
* src/pkl-asm.pks (write): Pass the mapped object's IOS to the
writer.
(remap): Pass the mapped object's IOS to the mapper.
* src/pkl-tab.y (struct_type_specifier): Register 3 dummies in the
compile-time lexical environment to reflect lexical changes in
struct_mapper.
* testsuite/poke.map/maps-strings-1.pk: New test.
* testsuite/poke.map/maps-offsets-1.pk: Likewise.
* testsuite/poke.map/maps-offsets-2.pk: Likewise.
2019-11-12 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.c (struct ios): New field `id'.
(ios_next_id): New static variable.
(ios_open): Return the id of the opened ios.
(ios_search_by_id): New function.
* src/poke.c (parse_args): Adapt to the new interface of ios_open.
* src/pvm.jitter (close): Use ios_search_by_id.
2019-11-12 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_BUILTIN_OPEN): Define.
(PKL_AST_BUILTIN_CLOSE): Likewise.
* src/pkl-tab.y (builtin): Handle BUILTIN_OPEN and BUILTIN_CLOSE.
(BUILTIN_OPEN): New token.
(BUILTIN_CLOSE): Likewise.
* src/pkl-lex.l: Add __PKL_BUILTIN_OPEN__ and
__PKL_BUILTIN_CLOSE__.
* src/pkl-rt.pk (open): Define.
(close): Likewise.
* src/pkl-insn.def (open): New instruction.
(close): Likewise.
* src/pvm.jitter (open): New instruction.
(close): Likewise.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Handle
PKL_AST_BUILTIN_OPEN and PKL_AST_BUILTIN_CLOSE.
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_BUILTIN_GET_IOS): Define.
(PKL_AST_BUILTIN_SET_IOS): Likewise.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Handle get_ios and set_ios
builtins.
* src/pkl-insn.def: Define instructions PKL_INSN_PUSHIOS and
PKL_INSN_POPIOS.
* src/pvm.jitter (pushios): New instruction.
(popios): Likewise.
* src/pkl-rt.pk (get_ios): New function.
(set_ios): Likewise.
* src/pkl-lex.l: Rules for __PKL_BUILTIN_GET_IOS__ and
__PKL_BUILTIN_SET_IOS__.
* src/pkl-tab.y: Define tokens BUILTIN_GET_IOS and
BUILTIN_SET_IOS.
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_make_map): Get an `ios' argument.
(pkl_ast_node_free): Handle the map ios.
(pkl_ast_print_1): Likewise.
* src/pkl-ast.h (struct pkl_ast_map): New attribute `ios'.
* src/pkl-tab.y (map): Add ternary variant of the operator.
* src/pkl-pass.c (pkl_do_pass_1): Visit the ios node of maps.
* src/pkl-typify.c (pkl_typify1_ps_map): Check whether the IOS
expression evaluates to an integral value.
(pkl_typify1_ps_attr): The type of the 'io attribute is an
int<32>.
* src/pkl-promo.c (pkl_promo_ps_map): Promote the ios argument to
the map operator.
* src/pkl-gen.c (pkl_gen_ps_op_attr): Generate code for the 'ios
attribute.
* src/pkl-attrs.def: Define PKL_AST_ATTR_IOS.
* src/pkl-insn.def: New instructions mgetio and msetio.
* src/pvm.jitter (mgetio): New instruction.
(msetio): Likewise.
* testsuite/poke.pkl/map-ios-diag-1.pk: New test.
* testsuite/poke.pkl/map-ios-diag-2.pk: Likewise.
* testsuite/poke.pkl/attr-ios-diag-1.pk: Likewise.
* testsuite/poke.pkl/attr-ios-diag-2.pk: Likewise.
* src/pvm-val.h (PVM_VAL_IO): Define.
(PVM_VAL_SET_IO): Likewise.
(PVM_VAL_ARR_IO): Likewise.
(PVM_VAL_SCT_IO): Likewise.
(struct pvm_struct): New field io.
(struct pvm_array): Likewise.
* src/pvm-val.c (pvm_make_array): Initialize io.
(pvm_make_struct): Likewise.
2019-11-12 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l: Handle token UNTIL.
* src/pkl-tab.y (UNTIL): New token.
* src/pkl-ast.h (PKL_AST_TRY_UNTIL_STMT_CODE): Define.
(PKL_AST_TRY_UNTIL_STMT_EXP): Likewise.
(struct pkl_ast_try_until_stmt): New struct.
* src/pkl-ast.c (pkl_ast_make_try_until_stmt): New function.
(pkl_ast_node_free): Handle try-until AST nodes.
(pkl_ast_finish_breaks_1): Likewise.
(pkl_ast_finish_returns_1): Likewise.
(pkl_ast_print_1): Likewise.
* src/pkl-pass.c (pkl_do_pass_1): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_try_until_stmt): New handler.
* src/pkl-promo.c (pkl_promo_ps_try_until_stmt): Likewise.
* src/pkl-gen.c (pkl_gen_pr_try_until_stmt): New handler.
* doc/poke.texi (try-until): New section.
* testsuite/poke.pkl/try-until-diag-1.pk: New test.
* testsuite/poke.pkl/try-until-1.pk: Likewise.
* testsuite/poke.pkl/try-until-2.pk: Likewise.
* testsuite/poke.pkl/try-until-3.pk: Likewise.
2019-11-12 John Darrington <john@darrington.wattle.id.au>
* src/pkl-lex.l (YYFATAL_ERROR): Redefine
2019-11-12 John Darrington <john@darrington.wattle.id.au>
* src/std.pk (ltrim): New function.
* src/std.pk (rtrim): New function.
* doc/poke.texi (String Functions): New chapter.
* testsuite/poke.std/ltrim.pk: New file.
* testsuite/poke.std/rtrim.pk: New file.
2019-11-12 John Darrington <john@darrington.wattle.id.au>
* src/pk-file.c (pk_cmd_file): Use strerror for reason.
(pk_cmd_load_file): ditto.
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_trans1_ps_string): Handle \".
* src/pvm-val.c (pvm_print_val): Likewise.
* testsuite/poke.pkl/strings-1.pk: New test.
* testsuite/poke.pkl/strings-2.pk: Likewise.
* testsuite/poke.pkl/strings-3.pk: Likewise.
* doc/poke.texi (String Literals): Document \".
2019-11-11 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Initialize newline
2019-11-11 John Darrington <john@darrington.wattle.id.au>
* src/pk-repl.c (pk_repl): Use ~/.poke_history to persist repl
commands.
* doc/poke.texi (The REPL): Document the use of readline and the
poke_history file.
2019-11-11 John Darrington <john@darrington.wattle.id.au>
* doc/poke.texi (The REPL): Fix typo
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-print.c: Remove.
* src/pk-cmd.c (print_cmd): Likewise.
(cmds): Remove print_cmd.
* src/Makefile.am (poke_SOURCES): Remove pk-print.c
* testsuite/poke.map/maps-simple-1.pk: New test.
* testsuite/poke.map/maps-simple-8.pk: Likewise.
* testsuite/poke.map/maps-simple-7.pk: Likewise.
* testsuite/poke.map/maps-simple-6.pk: Likewise.
* testsuite/poke.map/maps-simple-5.pk: Likewise.
* testsuite/poke.map/maps-simple-4.pk: Likewise.
* testsuite/poke.map/maps-simple-3.pk: Likewise.
* testsuite/poke.map/maps-simple-2.pk: Likewise.
* testsuite/poke.pkl/sl-1.pk: Do not use .print.
* testsuite/poke.map/maps-arrays-10.pk: Likewise.
* testsuite/poke.map/maps-arrays-9.pk: Likewise.
* testsuite/poke.map/maps-arrays-8.pk: Likewise.
* testsuite/poke.map/maps-arrays-7.pk: Likewise.
* testsuite/poke.map/maps-arrays-6.pk: Likewise.
* testsuite/poke.map/maps-arrays-1.pk: Likewise.
* testsuite/poke.map/valmaps-arrays.pk: Likewise.
* testsuite/poke.map/trimmed-map-4.pk: Likewise.
* testsuite/poke.map/trimmed-map-3.pk: Likewise.
* testsuite/poke.map/trimmed-map-2.pk: Likewise.
* testsuite/poke.map/trimmed-map.pk: Likewise.
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (.file): Add note about blank characters trimming
from paths.
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-cmd.c (pk_cmd_exec_1): Do not include trailing blanks in
tag arguments.
2019-11-11 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (The isa Operator): New chapter.
2019-11-10 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Functions): New chapter.
(Function Declarations): New section.
(Optional Arguments): Likewise.
(Variadic Functions): Likewise.
(Calling Functions): Likewise.
(Function Types): Likewise.
2019-11-10 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Write After Approval): Add John Darrington.
2019-11-09 John Darrington <john@darrington.wattle.id.au>
* src/pk-repl.c: Include signa.h.
(poke_sigint_handler): New function.
(pk_repl): Install signal handler for SIGINT.
2019-11-09 John Darrington <john@darrington.wattle.id.au>
* src/ras: Correct punctuation in default error message.
2019-11-09 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Use xrealloc instead of
realloc.
2019-11-09 John Darrington <john@darrington.wattle.id.au>
* src/pk-editor.c (pk_cmd_editor): Fix memory leak.
2019-11-09 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Make libreadline a hard requirement.
* HACKING (readline): Document that now a full implementation of
readline is required.
2019-11-09 Egeyar Bagcioglu <egeyar@gmail.com>
* testsuite/poke.map/maps-int-01.pk: New test.
* testsuite/poke.map/maps-int-02.pk: Likewise.
* testsuite/poke.map/maps-int-03.pk: Likewise.
* testsuite/poke.map/maps-int-04.pk: Likewise.
* testsuite/poke.map/maps-int-05.pk: Likewise.
* testsuite/poke.map/maps-int-06.pk: Likewise.
* testsuite/poke.map/maps-int-07.pk: Likewise.
* testsuite/poke.map/maps-int-08.pk: Likewise.
* testsuite/poke.map/maps-int-09.pk: Likewise.
* testsuite/poke.map/maps-int-10.pk: Likewise.
* testsuite/poke.map/maps-int-11.pk: Likewise.
* testsuite/poke.map/maps-int-12.pk: Likewise.
* testsuite/poke.map/maps-int-13.pk: Likewise.
* testsuite/poke.map/maps-int-14.pk: Likewise.
* testsuite/poke.map/maps-int-15.pk: Likewise.
* testsuite/poke.map/maps-int-16.pk: Likewise.
* testsuite/poke.map/maps-int-17.pk: Likewise.
* testsuite/poke.map/maps-int-18.pk: Likewise.
* testsuite/poke.map/maps-int-19.pk: Likewise.
* testsuite/poke.map/maps-int-20.pk: Likewise.
* testsuite/poke.map/maps-int-21.pk: Likewise.
* testsuite/poke.map/maps-int-22.pk: Likewise.
* testsuite/poke.map/maps-int-23.pk: Likewise.
* testsuite/poke.map/maps-int-24.pk: Likewise.
* testsuite/poke.map/maps-int-25.pk: Likewise.
* testsuite/poke.map/maps-int-26.pk: Likewise.
* testsuite/poke.map/maps-int-27.pk: Likewise.
* testsuite/poke.map/maps-int-28.pk: Likewise.
* testsuite/poke.map/maps-int-29.pk: Likewise.
* testsuite/poke.map/maps-int-30.pk: Likewise.
* testsuite/poke.map/maps-int-31.pk: Likewise.
* testsuite/poke.map/maps-int-32.pk: Likewise.
* testsuite/poke.map/maps-int-33.pk: Likewise.
* testsuite/poke.map/maps-int-34.pk: Likewise.
* testsuite/poke.map/maps-int-35.pk: Likewise.
* testsuite/poke.map/maps-int-36.pk: Likewise.
* testsuite/poke.map/maps-int-37.pk: Likewise.
* testsuite/poke.map/maps-int-38.pk: Likewise.
* testsuite/poke.map/maps-int-39.pk: Likewise.
* testsuite/poke.map/maps-int-40.pk: Likewise.
* testsuite/poke.map/maps-int-41.pk: Likewise.
* testsuite/poke.map/maps-int-42.pk: Likewise.
* testsuite/poke.map/maps-int-43.pk: Likewise.
* testsuite/poke.map/maps-int-44.pk: Likewise.
* testsuite/poke.map/maps-int-45.pk: Likewise.
* testsuite/poke.map/maps-int-46.pk: Likewise.
* testsuite/poke.map/maps-int-47.pk: Likewise.
* testsuite/poke.map/maps-int-48.pk: Likewise.
* testsuite/poke.map/maps-int-49.pk: Likewise.
* testsuite/poke.map/maps-int-50.pk: Likewise.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Unmapping): New section.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (stmt): Set location of assignments to maps.
* src/pkl-ast.c (pkl_ast_lvalue_p): Allow maps in lvalues.
* src/pkl-typify.c (pkl_typify1_ps_ass_stmt): The type of a map in
an l-value shall be simple.
* src/pkl-gen.c (pkl_gen_pr_ass_stmt): Handle maps in l-values.
* doc/poke.texi (Assignments): Document maps in l-values.
* testsuite/poke.pkl/ass-map-diag-1.pk: New test.
* testsuite/poke.pkl/ass-map-diag-2.pk: Likewise.
* testsuite/poke.map/ass-map-1.pk: Likewise.
* testsuite/poke.map/ass-map-2.pk: Likewise.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Conditionals): New chapter.
(if-else): New section.
(Loops): New chapter.
(while): New section.
(for-in): Likewise.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Exception Handling): New chapter.
(Exceptions): New section.
(try-catch): Likewise.
(raise): Likewise.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk (substr): Remove.
(strstr): Likewise.
(format): Likewise.
* testsuite/poke.std/substr.pk: Remove test.
* testsuite/poke.std/strstr.pk: Likewise.
2019-11-08 Jose E. Marchesi <jose.marchesi@oracle.com>
* doc/poke.texi (Standard Integral Types): New chapter.
(Standard Offset Types): Likewise.
(Conversion Functions): Likewise.
(catos): New section.
(atoi): Likewise.
(Sorting Functions): New chapter.
(qsort): New section.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-repl.c (banner): New function.
(pk_repl): Call banner.
(pk_repl_display_begin): Use rl_prompt instead of a literal
string.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk (catos): Stop at the first null character '\0'.
* testsuite/poke.std/catos-3.pk: New test.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import the module unlink from
gnulib.
* src/pk-editor.c (pk_cmd_editor): Open result file and extract
the new line from it.
Remove the temporary file.
* doc/poke.texi (.editor): New chapter.
2019-11-07 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import `system' gnulib module.
* src/pk-editor.c: New file.
* src/pk-cmd.c (editor_cmd): New extern.
(cmds): Add editor_cmd.
* src/Makefile.am (poke_SOURCES): Add pk_editor.c.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk (BPF_Insn_Opcode._print): Simply using the `in'
operator.
(bpf_class_is_alujmp): Likewise.
* pickles/btf.pk (BTF_Type): Likewise.
2019-11-08 Michael Drüing <michael@drueing.de>
* src/std.pk (atoi): New function.
* testsuite/poke.std/atoi-1.pk: New test.
* testsuite/poke.std/atoi-2.pk: Likewise.
* testsuite/poke.std/atoi-3.pk: Likewise.
* testsuite/poke.std/atoi-4.pk: Likewise.
* testsuite/poke.std/atoi-5.pk: Likewise.
* testsuite/poke.std/atoi-6.pk: Likewise.
* testsuite/poke.std/atoi-7.pk: Likewise.
* testsuite/poke.std/atoi-8.pk: Likewise.
* testsuite/poke.std/atoi-9.pk: Likewise.
* testsuite/poke.std/atoi-10.pk: Likewise.
* testsuite/poke.std/atoi-11.pk: Likewise.
* testsuite/poke.std/atoi-12.pk: Likewise.
* testsuite/poke.std/atoi-13.pk: Likewise.
2019-11-08 Jose E. Marchesi <jose.marchesi@oracle.com>
* HACKING (Writing poke Tests): New section.
2019-11-08 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y: Handle compound statements in the parser
destructor.
2019-11-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-repl.h: New file.
* src/pk-repl.c: Likewise.
* src/Makefile.am (poke_SOURCES): Add pk-repl.c and pk-repl.h
* HACKING (Appendix): Add src/pk-repl.h and src/pk-repl.c to the
list of sources.
* src/poke.c: Include pk-repl.h
(repl): Remove function.
(main): Use pk_repl.
2019-11-06 Darshit Shah <darnir@gnu.org>
* bootstrap.conf: Exit out if jitter's bootstrap fails
2019-11-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-term.c (pk_term_hyperlink): Fix guard.
(pk_term_end_hyperlink): Likewise.
2019-11-06 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Write After Approval): Add Darshit Shah to the list of
committers.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/union-diag-7.pk: New test.
* src/pkl-tab.y (struct_type_field): Adjust location for $$ when
the first token in the rule is empty.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Field Endianness): New section.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.h (struct pkl_gen_payload): New field endian.
* src/pkl-gen.pks (struct_field_mapper): Handle field endianness.
* src/pkl-gen.c (pkl_gen_ps_type_integral): Likewise.
* src/pkl-asm.c (pkl_asm_insn): Handle PKL_INSN_POKE.
(pkl_asm_insn_poke): New function.
* src/pkl-insn.def: Define PKL_INSN_POKE.
* testsuite/poke.map/maps-structs-endian-1.pk: New test.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_STRUCT_TYPE_FIELD_ENDIAN): Define.
(enum pkl_ast_endian): New entry PKL_AST_DFL.
(struct pkl_ast_struct_type_field): New field endian.
* src/pkl-ast.c (pkl_ast_make_struct_type_field): Handle the
`endian' attribute.
(pkl_ast_dup_type): Likewise.
(pkl_ast_print_1): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_struct): Likewise.
* src/pkl-lex.l: Tokens BIG and LITTLE.
* src/pkl-tab.y (struct_type_field): handle endianness in fields.
(endianness): New rule.
* src/pkl-anal.c (pkl_anal2_ps_struct_type_field): New handler.
(pkl_phase_anal2): Register handler.
* testsuite/poke.pkl/struct-endian-diag-1.pk: New test.
* testsuite/poke.pkl/struct-types-endian-diag-2.pk: Likewise.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (POKESTYLESDIR): Define when invoking
dejagnu.
* testsuite/lib/poke-dg.exp (dg-require): Mark the test as
unsupported if appropriate.
* testsuite/poke.pkl/printf-class-1.pk: Require libtextstyle.
* testsuite/poke.pkl/printf-class-4.pk: Likewise.
* testsuite/poke.pkl/printf-class-3.pk: Likewise.
* testsuite/poke.pkl/printf-class-2.pk: Likewise.
2019-11-05 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Building): it is no longer necessary to pass
--with-jitter to configure.
2019-11-05 Luca Saiu <positron@gnu.org>
* HACKING: Replace "program" to "routine". Update data
structure description. Update debugging and configuration
information as related to Jitter. Minor rewording and grammar
fixes.
* TODO: Change "program" to "routine".
* Makefile.am (SUBDIRS): Add jitter.
* acinclude.m4: Remove file.
* bootstrap.conf (bootstrap_post_import_hook): New function.
* configure.ac: Include m4/jitter.m4, now copied from jitter by
bootstrap.
(AC_JITTER): Remove along with checks. Replace with
AC_JITTER_SUBPACKAGE, which includes tests.
(--enable-debug, --disable-debug): Remove options.
(ENABLE_DEBUG): Remove variable. Remove substitution.
(POKE_DEBUG): Remove Automake conditional.
* src/Makefile.am (poke_CPPFLAGS, poke_CFLAGS, poke_LDADD)
(poke_LDFLAGS): Unconditionalize.
* src/pvm-val.h: Change to Jitter unified routine API.
Include jitter/jitter-routine.h to break dependency cycle.
Add comments.
(struct pvm_cls): Rename field program to routine, type
from struct jitter_program * to jitter_routine.
Change type for field entry_point from void * to
jitter_program_point.
(pvm_program): Remove typedef. Now the include cycle breaking works
differently.
* src/pvm-val.c: Change to Jitter unified routine API.
* src/pk-cmd.c: Change to Jitter unified routine API.
* src/pk-cmd.h: Change to Jitter unified routine API.
* src/pk-print.c: Change to Jitter unified routine API.
* src/pkl-asm.c: Change to Jitter unified routine API.
* src/pkl-gen.c: Change to Jitter unified routine API.
* src/pkl-gen.h: Change to Jitter unified routine API.
* src/pkl.c: Change to Jitter unified routine API.
* src/pkl.h: Change to Jitter unified routine API.
* src/pvm-alloc.c: Change to Jitter unified routine API.
* src/pvm-env.h: Change to Jitter unified routine API.
* src/pvm.c: Change to Jitter unified routine API.
* src/pvm.h: Change to Jitter unified routine API.
* src/ras: Change to Jitter unified routine API.
2019-11-04 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Structs): New chapter.
(Struct Literals): New section.
(Struct Types): Likewise.
(Unions): Likewise.
(Pinned Structs): Likewise.
(Struct Attributes): Likewise.
(Methods): Likewise.
(Declarations in Structs): Likewise.
2019-11-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.pks (remap): Do not check for a null value.
2019-11-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.pks (bconc): New macro.
* src/pkl-asm.c (pkl_asm_insn_bconc): Use bconc macro.
* src/pkl-fold.c (pkl_fold_bconc): New handler.
* testsuite/poke.pkl/bconc-1.pk: New file.
* testsuite/poke.pkl/bconc-2.pk: Likewise.
* testsuite/poke.pkl/bconc-3.pk: Likewise.
* testsuite/poke.pkl/bconc-4.pk: Likewise.
* testsuite/poke.pkl/bconc-5.pk: Likewise.
* testsuite/poke.pkl/bconc-6.pk: Likewise.
2019-11-04 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-ras-mode.el (poke-ras-mode): Indent labels properly.
2019-11-04 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.pks (ais): Remove unused argument atype.
* src/pkl-asm.c (pkl_asm_insn_ais): Adjust accordingly.
2019-11-04 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: Add information about maintainers.
2019-11-03 Darshit Shah <darnir@gnu.org>
* m4/libtextstyle-hyperlink.m4: New file with autoconf macro to
test for hyperlink support in libtextstyle
* configure.ac: Invoke new macro AX_LIBTEXTSTYLE_HYPERLINK
* src/pk-term.c (pk_term_hyperlink): Conditionally invoke the
function styled_ostream_set_hyperlink based on whether
libtextstyle supports it
(pk_term_end_hyperlink): Same
2019-11-03 Luca Saiu <positron@gnu.org>
* src/Makefile.am (.pks.pkc): Do not rely on GNU Make extension.
2019-11-03 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (ios_read_int): Rewrite.
(ios_read_uint): Move the common functionality between read_ios_int
and read_ios_uint from here ...
(ios_read_int_common): ... to here.
2019-11-03 Darshit Shah <darnir@gnu.org>
* bootstrap.conf (MSGID_BUGS_ADDRESS): Fix bug reporting address
(buildreq): Add a list of build prerequisites
(gnulib_modules): Sort and split list into separate lines. Also
deduplicate list (readline, getopt-gnu)
Remove gendocs-template which is not a gnulib module
2019-11-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def: New instruction ais.
* src/pkl-asm.c (pkl_asm_insn): Handle AIS.
(pkl_asm_insn_ais): New function.
* src/pkl-asm.pks (ais): New macro.
* src/pkl-gen.c (pkl_gen_ps_op_in): Use PKL_INSN_AIS.
* doc/poke.texi (Array Elements): New section.
2019-11-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ops.def: Define IN operator.
* src/pkl-tab.y: Rule for the IN binary operator.
* src/pkl-typify.c (pkl_typify1_ps_op_in): New handler.
(pkl_phase_typify1): Register handler.
* src/pkl-promo.c (pkl_promo_ps_op_in): New handler.
(pkl_phase_promo): Register handler.
* src/pkl-asm.c (pkl_asm_insn_cmp): Add support for offsets.
* src/pkl-gen.c (pkl_gen_ps_op_rela): Adjust accordingly.
* src/pkl-gen.c (pkl_gen_ps_op_in): New handler.
(pkl_phase_gen): Register handler.
* testsuite/poke.pkl/in-diag-1.pk: New test.
* testsuite/poke.pkl/in-diag-2.pk: Likewise.
* testsuite/poke.pkl/in-diag-3.pk: Likewise.
* testsuite/poke.pkl/in-diag-4.pk: Likewise.
* testsuite/poke.pkl/in-3.pk: Likewise.
* testsuite/poke.pkl/in-2.pk: Likewise.
* testsuite/poke.pkl/in-1.pk: Likewise.
2019-11-02 Egeyar Bagcioglu <egeyar@gmail.com>
* src/ios.c (ios_read_uint): Fix the fast track for 40 bit integers.
* testsuite/poke.map/maps-uint-41.pk: New test.
* testsuite/poke.map/maps-uint-42.pk: Likewise.
* testsuite/poke.map/maps-uint-43.pk: Likewise.
* testsuite/poke.map/maps-uint-44.pk: Likewise.
* testsuite/poke.map/maps-uint-45.pk: Likewise.
* testsuite/poke.map/maps-uint-46.pk: Likewise.
* testsuite/poke.map/maps-uint-47.pk: Likewise.
* testsuite/poke.map/maps-uint-48.pk: Likewise.
* testsuite/poke.map/maps-uint-49.pk: Likewise.
* testsuite/poke.map/maps-uint-50.pk: Likewise.
* testsuite/poke.map/maps-uint-51.pk: Likewise.
* testsuite/poke.map/maps-uint-52.pk: Likewise.
* testsuite/poke.map/maps-uint-53.pk: Likewise.
* testsuite/poke.map/maps-uint-54.pk: Likewise.
2019-11-02 Egeyar Bagcioglu <egeyar@gmail.com>
* testsuite/poke.map/maps-uint-1.pk: New test.
* testsuite/poke.map/maps-uint-2.pk: Likewise.
* testsuite/poke.map/maps-uint-3.pk: Likewise.
* testsuite/poke.map/maps-uint-4.pk: Likewise.
* testsuite/poke.map/maps-uint-5.pk: Likewise.
* testsuite/poke.map/maps-uint-6.pk: Likewise.
* testsuite/poke.map/maps-uint-7.pk: Likewise.
* testsuite/poke.map/maps-uint-8.pk: Likewise.
* testsuite/poke.map/maps-uint-9.pk: Likewise.
* testsuite/poke.map/maps-uint-10.pk: Likewise.
* testsuite/poke.map/maps-uint-11.pk: Likewise.
* testsuite/poke.map/maps-uint-12.pk: Likewise.
* testsuite/poke.map/maps-uint-13.pk: Likewise.
* testsuite/poke.map/maps-uint-14.pk: Likewise.
* testsuite/poke.map/maps-uint-15.pk: Likewise.
* testsuite/poke.map/maps-uint-16.pk: Likewise.
* testsuite/poke.map/maps-uint-17.pk: Likewise.
* testsuite/poke.map/maps-uint-18.pk: Likewise.
* testsuite/poke.map/maps-uint-19.pk: Likewise.
* testsuite/poke.map/maps-uint-20.pk: Likewise.
* testsuite/poke.map/maps-uint-21.pk: Likewise.
* testsuite/poke.map/maps-uint-22.pk: Likewise.
* testsuite/poke.map/maps-uint-23.pk: Likewise.
* testsuite/poke.map/maps-uint-24.pk: Likewise.
* testsuite/poke.map/maps-uint-25.pk: Likewise.
* testsuite/poke.map/maps-uint-26.pk: Likewise.
* testsuite/poke.map/maps-uint-27.pk: Likewise.
* testsuite/poke.map/maps-uint-28.pk: Likewise.
* testsuite/poke.map/maps-uint-29.pk: Likewise.
* testsuite/poke.map/maps-uint-30.pk: Likewise.
* testsuite/poke.map/maps-uint-31.pk: Likewise.
* testsuite/poke.map/maps-uint-32.pk: Likewise.
* testsuite/poke.map/maps-uint-33.pk: Likewise.
* testsuite/poke.map/maps-uint-34.pk: Likewise.
* testsuite/poke.map/maps-uint-35.pk: Likewise.
* testsuite/poke.map/maps-uint-36.pk: Likewise.
* testsuite/poke.map/maps-uint-37.pk: Likewise.
* testsuite/poke.map/maps-uint-38.pk: Likewise.
* testsuite/poke.map/maps-uint-39.pk: Likewise.
* testsuite/poke.map/maps-uint-40.pk: Likewise.
* testsuite/poke.map/maps-uint-diag-1.pk: Likewise.
2019-11-02 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (EMUL_UUU): For cdiv.
(EMUL_III): Likewise.
(pkl_fold_cdiv): New handler.
* src/pkl-asm.pks (cdiv): New macro.
(cdivo): New macro.
* src/pkl-asm.c (pkl_asm_insn_cdivo, pvm_make_integral): New
function.
(pkl_asm_insn_cdiv): Likewise.
(pkl_asm_insn_cdivo): Likewise.
(pkl_asm_insn): Call pkl_asm_insn_cdiv and pkl_asm_insn_cdivo.
* src/pkl-insn.def (PKL_INSN_CDIV): New instruction.
(PKL_INSN_CDIVO): Likewise.
* src/pkl-gen.c (pkl_gen_ps_op_ceildiv): New handler.
(pkl_phase_gen): Register the handler.
* src/pkl-promo.c (pkl_phase_promo): Register pkl_promo_ps_op_div
to promote ceildiv nodes.
* src/pkl-typify.c (pkl_typify1_ps_op_ceildiv): New handler.
(pkl_phase_typify1): Register handler.
(CASE_OFFSET): Handle ceildiv.
* src/pkl-ops.def (PKL_AST_OP_CEILDIV): Define.
* src/pkl-tab.y: New token CEILDIV.
* src/pkl-lex.l: Rule for CEILDIV.
* testsuite/poke.pkl/cdiv-offsets-2.pk: Likewise.
* testsuite/poke.pkl/cdiv-offsets-1.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-2.pk: Likewise.
* testsuite/poke.pkl/cdiv-integers-1.pk: New test.
* doc/poke.texi (Offset Operations): Document /^ for offsets.
(Arithmetic Operators): Likewise for integers.
2019-11-02 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (.set): The default endianness is big endian, not
host endian.
2019-10-30 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Shebang): New section.
(Scripts): Likewise.
(Invoking poke): Likewise.
2019-10-30 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (pvm_literal_printer): Use poke_obase.
(pvm_literal_printer_lo): Likewise.
(strace): Likewise.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk (BPF_Insn_Offset): New type.
(BPF_Insn): Use BPF_Insn_Offset.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* pickles/btf.pk (btf_types): New function.
(btf_strings): Likewise.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Commanding poke): New chapter.
(The REPL): New section.
(Evaluation): New section.
(Commands): Likewise.
(Scripts): Likewise.
(Shebang): Likewise.
(.load): New chapter.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (.vm): New chapter.
(.vm disassemble): New section.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-fold.c (pkl_fold_pr_type): New handler.
(pkl_phase_fold): Register handler.
* src/pkl-promo.c (pkl_promo_pr_type): New handler.
(pkl_phase_promo): Register handler.
* src/pkl-typify.c (pkl_typify_pr_type): New handler.
(pkl_phase_typify1): Register handler.
Likewise.
* src/pkl-anal.c: Do not define nor use a pkl_anal_ps_type
handler. It is unnecessary.
* src/pkl-trans.c: Set the `compiled' flag of types AST nodes only
in trans4.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (struct pkl_ast_type): New field `compiled'.
(PKL_AST_TYPE_COMPILED): Define.
* src/pkl-anal.c (pkl_anal_pr_type): Define.
(pkl_anal_ps_type): Define.
(pkl_phase_anal1): Registers the handlers.
(pkl_phase_anal2): Likewise.
(pkl_phase_analf): Likewise.
* src/pkl-trans.c (pkl_trans_pr_type): Define.
(pkl_trans_ps_type): Define.
(pkl_phase_trans1): Registers the handlers.
(pkl_phase_trans2): Likewise.
(pkl_phase_trans3): Likewise.
(pkl_phase_trans4): Likewise.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_decl): Avoid recompiling type closures
(mapper, writer, constructor, etc) again and again.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_constructor): Set/clear
payload->in_constructor and not payload->in_mapper.
* testsuite/poke.pkl/struct-types-6.pk: New test.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (.set): New section.
(.exit): Likewise.
(.file): Likewise.
(.info): Likewise.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l: Remove token TRIMOP.
* src/pkl-tab.y: Use ':' instead of TRIMOP in trimmers rules.
* src/std.pk (substr): Adapt to the new syntax.
* trim.pk: Remove.
* testsuite/poke.pkl/trim-1.pk: From trim.pk and adapted to new
syntax.
* testsuite/poke.pkl/trim-24.pk: Likewise.
* testsuite/poke.pkl/trim-23.pk: Likewise.
* testsuite/poke.pkl/trim-22.pk: Likewise.
* testsuite/poke.pkl/trim-21.pk: Likewise.
* testsuite/poke.pkl/trim-20.pk: Likewise.
* testsuite/poke.pkl/trim-19.pk: Likewise.
* testsuite/poke.pkl/trim-18.pk: Likewise.
* testsuite/poke.pkl/trim-17.pk: Likewise.
* testsuite/poke.pkl/trim-16.pk: Likewise.
* testsuite/poke.pkl/trim-15.pk: Likewise.
* testsuite/poke.pkl/trim-14.pk: Likewise.
* testsuite/poke.pkl/trim-13.pk: Likewise.
* testsuite/poke.pkl/trim-12.pk: Likewise.
* testsuite/poke.pkl/trim-11.pk: Likewise.
* testsuite/poke.pkl/trim-10.pk: Likewise.
* testsuite/poke.pkl/trim-9.pk: Likewise.
* testsuite/poke.pkl/trim-8.pk: Likewise.
* testsuite/poke.pkl/trim-7.pk: Likewise.
* testsuite/poke.pkl/trim-6.pk: Likewise.
* testsuite/poke.pkl/trim-5.pk: Likewise.
* testsuite/poke.pkl/trim-4.pk: Likewise.
* testsuite/poke.pkl/trim-3.pk: Likewise.
* testsuite/poke.pkl/trim-2.pk: Likewise.
* testsuite/poke.map/trimmed-map.pk: Adapt to new syntax.
* testsuite/poke.map/trimmed-map-4.pk: Likewise.
* testsuite/poke.map/trimmed-map-3.pk: Likewise.
* testsuite/poke.map/trimmed-map-2.pk: Likewise.
2019-10-29 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Array Indexing): New section.
(Array Trimming): Likewise.
(Array Attributes): Likewise.
2019-10-28 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi: New chapters and sections.
2019-10-28 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Integers): New chapter.
(Integer Literals): New section.
(Characters): Likewise.
* testsuite/poke.pkl/printf-value-2.pk: Remove empty line at EOF.
* testsuite/poke.pkl/printf-value-5.pk: Likewise.
2019-10-27 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Offsets): New chapter.
(Why offsets): New section.
(Offset values): Likewise.
(Offset operations): Likewise.
2019-10-27 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Endianness): New chapter.
(.set endian): New section.
(Endian built-ins): Likewise.
2019-10-27 Jose E. Marchesi <jemarch@gnu.org>
* bootstrap.conf (gnulib_modules): Import the gendocs-template
gnulib module.
2019-10-27 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Output): New chapter.
(print): New section.
(printf): Likewise.
(Styling): Likewise.
2019-10-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_print_stmt): Fix bug handling %v
printf arguments.
* pickles/bpf.pk: Use %v in imm64 pretty-printer.
* testsuite/poke.pkl/printf-value-5.pk: New test.
2019-10-27 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (printv): Use the global poke_obase.
* testsuite/poke.pkl/printf-value-1.pk: .set obase.
* testsuite/poke.pkl/printf-value-2.pk: Likewise.
* testsuite/poke.pkl/printf-value-3.pk: Likewise.
* testsuite/poke.pkl/printf-value-4.pk: New file.
2019-10-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_PRINT_STMT_ARG_PRINT_VALUE_P): Define.
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Handle %v tags in
format strings.
* src/pkl-typify.c (pkl_typify1_ps_print_stmt): Allow any type for
%v.
* src/pkl-asm.c (pkl_asm_insn_print): Issue a `printv' instruction
to print values in %v tags.
* src/pkl-insn.def: New instruction printv.
* src/pvm.jitter (printv): Implement.
* testsuite/poke.pkl/printf-value-1.pk: New test.
* testsuite/poke.pkl/printf-value-2.pk: Likewise.
* testsuite/poke.pkl/printf-value-3.pk: Likewise.
2019-10-26 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Writing Poke): Recommend using the #<...> convention
for pretty-printed values.
2019-10-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk (BPF_Reg): Use styling when printing register
names.
(BPF_Insn_Opcode): Likewise for instruction mnemonics.
* etc/poke-default.css (.insn-register): New class.
(.insn-mnemonic): Likewise.
2019-10-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk (bpf_alu_opcodes): New variable.
(bpf_jmp_opcodes): Likewise.
(bpf_ldst_sizes): Likewise.
(BPF_Insn_Opcode): Pretty printers.
(BPF_Insn): Pretty printer for imm64.
2019-10-26 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_op_and): New handler.
(pkl_gen_pr_op_or): Likewise.
(pkl_gen_ps_op_and): Remove.
(pkl_gen_ps_op_or): Likewise.
* testsuite/poke.pkl/and-13.pk: New test.
* testsuite/poke.pkl/or-4.pk: Likewise.
2019-10-26 Jose E. Marchesi <jemarch@gnu.org>
* pickles/bpf.pk: New file.
* pickles/btf.pk: Likewise.
* pickles/Makefile.am (dist_pkgdata_DATA): Add bpf.pk and btf.pk.
2019-10-26 Egeyar Bagcioglu <egeyar@gmail.com>
* bootstrap.conf (gnulib_modules): Import the module byteswap from
gnulib.
* src/ios.c (IOS_GET_C_ERR_CHCK): Define.
(IOS_READ_INTO_CHARRAY_1BYTE): Likewise.
(IOS_READ_INTO_CHARRAY_2BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_3BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_4BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_5BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_6BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_7BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_8BYTES): Likewise.
(IOS_READ_INTO_CHARRAY_9BYTES): Likewise.
(ios_mask_first_byte): New function.
(ios_mask_last_byte): Likewise.
(ios_read_uint): Rewrite.
2019-10-25 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Writing RAS): New section.
2019-10-25 Jose E. Marchesi <jemarch@gnu.org>
* src/ras: Recognize empty .c lines without a trailing whitespace.
2019-10-25 Jose E. Marchesi <jemarch@gnu.org>
* pickles/future/bson.pk: Syntax-check fixes.
* src/pkl.c: Likewise.
* testsuite/poke.map/maps-structs-methods-5.pk: Likewise.
* src/pkl-trans.c: Likewise.
* src/pkl-gen.pks: Likewise.
* src/pkl-gen.c: Likewise.
* src/pkl-ast.c: Likewise.
* src/pkl-anal.c: Likewise.
* src/ios.c: Likewise.
* pickles/leb128.pk: Likewise.
* etc/poke-ras-mode.el: Likewise.
* testsuite/poke.map/maps-unions-8.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-3.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-1.pk: Likewise.
* testsuite/poke.pkl/printf-class-2.pk: Likewise.
* testsuite/poke.pkl/printf-class-1.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-7.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-6.pk: Likewise.
2019-10-25 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (PVM_PEEK): Raise exceptionspa in case of IO
end-of-file and generic IO error.
(PVM_POKE): Likewise.
(peeks): Likewise.
* src/pkl-gen.c (pkl_gen_pr_map): Do not handle EOF.
* src/pkl-rt.pk (_pkl_exception_handler): Handle E_io.
* src/pkl-gen.pks (array_mapper): Adjust to the new handling of
EOF.
* testsuite/poke.map/maps-unions-7.pk: New test.
* testsuite/poke.map/maps-unions-8.pk: Likewise.
2019-10-25 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal1_ps_type_struct): Do not allow
declarations after union fields.
* testsuite/poke.map/maps-unions-6.pk: Likewise.
* testsuite/poke.pkl/union-diag-6.pk: Likewise.
* testsuite/poke.pkl/union-diag-5.pk: Likewise.
* testsuite/poke.pkl/union-diag-4.pk: New test.
2019-10-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* HACKING (Dejagnu): Mention as a dependency.
2019-10-24 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (PKL_AST_BUILTIN_GET_ENDIAN): Define.
(PKL_AST_BUILTIN_SET_ENDIAN): Likewise.
* src/pkl-tab.y (BUILTIN_GET_ENDIAN): New token.
(BUILTIN_SET_ENDIAN): Likewise.
(builtins): New rule.
(comp_stmt): Use rule `builtins'.
* src/pkl-lex.l: Tokens for get_endian and set_endian built-ins.
* src/pvm.jitter (pushend): New instruction.
(popend): Likewise.
* src/pkl-insn.def (PKL_INSN_PUSHEND): Define.
(PKL_INSN_POPEND): Likewise.
* src/pkl-rt.pk (get_endian): Define.
(set_endian): Likewise.
(ENDIAN_LITTLE): New variable.
(ENDIAN_BIG): Likewise.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Generate code for
PKL_AST_BUILTIN_GET_ENDIAN and PKL_AST_BUILTIN_SET_ENDIAN
builtins.
* testsuite/poke.pkl/get-endian-1.pk: New test.
* testsuite/poke.pkl/set-endian-1.pk: Likewise.
2019-10-24 Jose E. Marchesi <jemarch@gnu.org>
* src/ios.c (ios_read_uint): Add support for reading 4-bit
unsigned integers from addresses aligned to 8 or 4 bytes.
2019-10-23 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pkgdata_DATA): Add leb128.pk
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/struct-types-diag-8.pk: New file.
* testsuite/poke.map/maps-structs-methods-6.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-7.pk: Likewise.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_struct_ref): fix compile-time
detection of invalid fields in struct references.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* pickles/leb128.pk: Rewritten and moved from future/.
* etc/poke-default.css (.leb128): New class.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (struct pkl_ast_print_stmt): New field
fmt_processed_p.
(PKL_AST_PRINT_STMT_FMT_PROCESSED_P): Define.
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Handle
fmt_processed_p.
* HACKING (Middle End Handlers should be Re-executable): New
section.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_mapper): Fix bug in method handling.
* testsuite/poke.map/maps-structs-methods-5.pk: New file.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.h: Prototypes for pvm_pretty_print and
pvm_set_pretty_print.
* src/pvm.c (pvm_pretty_print): New function.
(pvm_set_pretty_print): Likewise.
(PVM_STATE_PRETTY_PRINT): Define.
* src/pvm.jitter (state-struct-runtime-c): Add pretty_print.
(state-initialization-c): Initialize pretty_print to 0.
* src/pk-set.c (pk_cmd_set_pretty_print): New function.
(set_pretty_print_cmd): New struct.
(set_cmds): Add set-pretty_print_cmd.
* src/pvm-val.h: Prototype for pvm_get_struct_method.
Prototype for pvm_call_cls.
* src/pvm-val.c (pvm_get_struct_method): New function.
(pvm_call_pretty_printer): Likewise.
* testsuite/poke.pkl/struct-pretty-print-1.pk: New file.
* testsuite/poke.pkl/struct-pretty-print-2.pk: New file.
* testsuite/poke.pkl/struct-pretty-print-3.pk: Likewise.
* testsuite/poke.pkl/struct-pretty-print-4.pk: Likewise.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_struct_ref): Allow using dot
notation to refer to struct methods.
* src/pkl-trans.c (pkl_trans2_ps_struct_ref): Turn struct
references to parameterless methods into funcalls.
* src/pvm-val.c (pvm_ref_struct): Allow referencing to methods by
name.
* testsuite/poke.map/maps-structs-18.pk: New test.
* testsuite/poke.map/maps-structs-methods-1.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-2.pk: Likewise.
* testsuite/poke.map/maps-structs-methods-3.pk: Likewise.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (mksct): Change instruction to get a list of
methods.
* src/pkl-gen.pks (struct_mapper): Adapt to the new form of mksct.
(struct_constructor): Likewise.
* testsuite/poke.map/maps-structs-14.pk: New test.
* testsuite/poke.map/maps-structs-15.pk: Likewise.
* testsuite/poke.map/maps-structs-16.pk: Likewise.
* testsuite/poke.map/maps-structs-17.pk: Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm-val.h (PVM_VAL_SCT_METHOD): Define.
(PVM_VAL_SCT_NMETHODS): Likewise.
(pvm_make_struct): Add argument nmethods.
(struct pvm_struct_method): New struct.
(PVM_VAL_SCT_METHOD_NAME): Define.
(PVM_VAL_SCT_METHOD_VALUE): Likewise.
* src/pvm-val.c (pvm_make_struct): Likewise.
* src/pvm.jitter (mksct): pass the number of methods to
pvm_make_struct.
2019-10-22 Darkstar <michael@drueing.de>
* src/poke.c: Several typos in comments fixed.
(pk_print_version): Likewise.
(initialize_user): Likewise.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Avoid adding an
empty suffix to the last arg when a %- tag finished the format
string.
2019-10-22 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Warn the user about not finding a full-fledged
readline.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (repl): print a newline when the user does Ctrl-D.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* src/Makefile.am (AM_YFLAGS): Do not pass -y to bison, as we are
using non-POSIX capabilities.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk (catos): New function.
* testsuite/poke.std/catos-1.pk: New file.
* testsuite/poke.pkl/catos-2.pk: Likewise.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l (SHEBANG_COMMENT): New context.
Rules to support multi-line #! ... !# comments.
* src/poke.c (LOAD_AND_QUIT_ARG): Define.
(print_help): Document -L.
(parse_args): Implement -L.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-default.css (.error): Bold.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.cmd/set-error-on-warning.pk: New test.
2019-10-21 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.h: Make pkl_error and pkl_warning to get a `compiler'
option.
* src/pkl.c (pkl_error_internal): New function.
(pkl_error): Rewrite to be a wrapper for pkl_error_internal.
* src/pkl-pass.h (PKL_ERROR): Define.
(PKL_WARNING): Likewise.
* src/pkl-anal.c (pkl_anal2_ps_type_struct): Use PKL_WARNING.
* src/pkl-parser.h (struct pkl_parser): New field `compiler'.
Make pkl_parse_file and pkl_parse_buffer get a new argument
`compiler'.
* src/pkl-parser.c (pkl_parse_file): Get a `compiler' option.
(pkl_parse_buffer): Likewise.
* src/pkl.c (pkl_compile_file): Pass `compiler' to pkl_parse_file.
(pkl_compile_expression): Pass `compiler' to pkl_parse_buffer.
(pkl_compile_buffer): Likewise.
(pkl_compile_statement): Likewise.
* src/pkl-tab.y: Pass pkl_parser->compiler to pkl_error calls.
* src/pkl-anal.c: Use PKL_ERROR instead of pkl_error for
diagnostics.
* src/pkl-fold.c: Likewise.
* src/pkl-trans.c: Likewise.
* src/pkl-typify.c: Likewise.
2019-10-20 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-default.css (.dump-ruler): New class.
(.dump-address): Likewise.
(.dump-ascii): Likewise.
* src/pk-dump.pk (dump): Stylize output.
2019-10-20 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/Makefile.am (check-DEJAGNU): Set POKESTYLESDIR.
* testsuite/poke.pkl/printf-class-1.pk: New test.
* testsuite/poke.pkl/printf-class-4.pk: Likewise.
* testsuite/poke.pkl/printf-class-3.pk: Likewise.
* testsuite/poke.pkl/printf-class-2.pk: Likewise.
2019-10-20 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Fix diagnostic for
unclosed styling class tags.
* testsuite/poke.pkl/printf-diag-6.pk: New file.
* testsuite/poke.pkl/printf-diag-7.pk: Likewise.
* testsuite/poke.pkl/printf-diag-8.pk: Likewise.
2019-10-20 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_print_stmt): Skip arguments
without associated values.
* src/pkl-typify.c (pkl_typify1_ps_print_stmt): Likewise.
* src/pkl-gen.c (pkl_gen_pr_print_stmt): Generate code for styling
class format directives.
* src/pkl-trans.c (pkl_trans1_ps_print_stmt): Support %<class: and
%> format directives.
2019-10-19 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (struct pkl_ast_print_stmt_arg): New fields
begin_sc and end_sc.
(PKL_AST_PRINT_STMT_ARG_BEGIN_SC): Define.
(PKL_AST_PRINT_STMT_ARG_END_SC): Likewise.
* src/pkl-ast.c (pkl_ast_node_free): Dispose the memory of
begin_sc and end_sc.
(pkl_ast_print_1): Print begin_sc and end_sc fields.
2019-10-19 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (wrapped-functions): Add pk_term_class and
pk_term_end_class.
(begsc): New instruction.
(endsc): Likewise.
* src/pkl-insn.def: Define instructions begsc and endsc.
2019-10-19 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-pass.h (PKL_PASS_COMPILER): Define.
(PKL_PASS_SUBPASS): Pass compiler to pkl_do_subpass.
(PKL_PHASE_BEGIN_HANDLER): The node handler gets a compiler.
(pkl_do_pass): Get a compiler argument.
* src/pkl-pass.c (pkl_do_subpass): Handle new argument compiler.
(pkl_do_pass): Likewise.
(pkl_call_node_handlers): Likewise.
(pkl_do_pass_1): Likewise.
(PKL_CALL_PHASES): Pass `compiler' to pkl_do_pass_1.
(PKL_CALL_PHASES_SINGLE): Likewise.
(PKL_PASS): Likewise.
(PKL_PASS_CHAIN): Likewise.
(pkl_do_pass_1): Likewise.
(pkl_do_subpass): Likewise.
* src/pkl.c (rest_of_compilation): Pass poke_compiler to
pkl_do_pass.
2019-10-19 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (struct pkl_compiler): New field error_on_warning.
(pkl_error_on_warning): New function.
(pkl_set_error_on_warning): Likewise.
* src/pkl.h: Prototypes for pkl_error_on_warning and
pkl_set_error_on_warning.
* src/pk-cmd.c (pk_cmd_exec_1): Support `-' characters in command
names.
* src/pk-set.c (set_error_on_warning_cmd): New variable.
(pk_cmd_set_error_on_warning): New function.
(set_cmds): Add set_error_on_warning_cmd.
2019-10-19 Jose E. Marchesi <jemarch@gnu.org>
* TODO (#B0 remove hard limit in PKL_AST_MAX_POINTERS): New todo
entry.
(#A1 fold "isa" expressions): Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.map/maps-unions-5.pk: New file.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_mapper): Generate code for declarations.
(struct_constructor): Likewise.
* testsuite/poke.pkl/struct-types-2.pk: New file.
* testsuite/poke.map/maps-structs-11.pk: Likewise.
* testsuite/poke.pkl/struct-types-3.pk: Likewise.
* testsuite/poke.pkl/struct-types-4.pk: Likewise.
* testsuite/poke.map/maps-structs-12.pk: Likewise.
* testsuite/poke.pkl/struct-types-5.pk: Likewise.
* testsuite/poke.map/maps-structs-13.pk: Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (struct pkl_ast_type): Add nelem and ndecl fields
to struct types.
* src/pkl-trans.c (pkl_trans1_ps_type_struct): Count number of
fields and declarations.
* src/pkl-ast.c (pkl_ast_print_1): Print nfield and ndecl of
struct types.
(pkl_ast_dup_type): Copy ndecl and nfield when
duplicating struct types.
(pkl_ast_make_struct_type): Get nfield and ndecl arguments.
* src/pkl-typify.c (pkl_typify1_ps_struct): Pass extra arguments
to pkl_ast_make_struct_type.
* src/pkl-gen.c (pkl_gen_ps_type_struct): Use
PKL_AST_TYPE_S_NFIELD.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-tab.y (struct_field_type): Fix location of diagnostic
for duplicated struct elements.
* src/pkl-anal.c (pkl_anal1_ps_struct): Improve diagnostic.
* testsuite/poke.pkl/struct-types-diag-5.pk: New test.
* testsuite/poke.pkl/struct-types-diag-6.pk: Likewise.
* testsuite/poke.pkl/struct-types-diag-7.pk: Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_nala1_ps_type_struct): Fix typo in variable
names.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.c (pkl_gen_pr_decl): Rename type_struct_fields to
type_struct_elems.
(pkl_gen_pr_type_struct): Likewise.
* src/pkl-gen.pks: Adapt to the fact struct type elements can be
either struct type fields or declarations.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.c (pkl_ast_dup_type): Adapt to the fact struct type
elements can be either struct type fields or declarations.
(pkl_ast_sizeof_type): Likewise.
(pkl_print_type): Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-typify.c (pkl_typify1_ps_struct_ref): Adapt to the fact
struct type elements can be either struct type fields or
declarations.
(pkl_typify1_ps_scons): Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal1_ps_type_struct): Adapt to the fact
struct type elements can be either struct type fields or
declarations.
(pkl_anal2_ps_type_struct): Likewise.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h: Document that struct elements can be fields or
declarations.
* src/pkl-tab.y: Rename the struct_type_field_list rule to
struct_type_elem_list.
(struct_type_elem_list): Add declarations.
2019-10-18 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal1_ps_type_struct): Rename
struct_field_type to struct_type_field.
(pkl_anal2_ps_type_struct): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_struct): Likewise.
(pkl_typify1_ps_struct_ref): Likewise.
(pkl_typify1_ps_scons): Likewise.
(pkl_typify1_ps_attr): Likewise.
* src/pkl-tab.y: Likewise.
* src/pkl-promo.c (pkl_promo_ps_struct_type_field): Likewise.
* src/pkl-pass.c (pkl_do_pass_1): Likewise.
* src/pkl-gen.pks (handle_struct_field_name): Likewise.
(check_struct_field_constraint): Likewise.
(struct_mapper): Likewise.
(struct_field_mapper): Likewise.
* src/pkl-gen.c (pkl_gen_pr_type): Likewise.
(pkl_gen_pr_type_array): Likewise.
(pkl_gen_pr_struct_type_field): Likewise.
* src/pkl-ast.h (enum pkl_ast_code): Likewise.
(PKL_AST_STRUCT_TYPE_FIELD_NAME): Likewise.
(PKL_AST_STRUCT_TYPE_FIELD_TYPE): Likewise.
(PKL_AST_STRUCT_TYPE_FIELD_CONSTRAINT): Likewise.
(PKL_AST_STRUCT_TYPE_FIELD_LABEL): Likewise.
(struct pkl_ast_struct_type_field): Likewise.
* src/pkl-ast.c (pkl_ast_make_struct_field_type): Likewise.
(pkl_ast_dup_type): Likewise.
(pkl_ast_sizeof_type): Likewise.
(pkl_print_type): Likewise.
(pkl_ast_node_free): Likewise.
(pkl_ast_print_1): Likewise.
2019-10-17 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.c (pkl_asm_pushlevel): Use pvm_alloc instead of
malloc.
(pkl_asm_new): Likewise.
(pkl_asm_poplevel): Do not free memory.
(pkl_asm_finish): Likewise.
* src/pvm-alloc.c (pvm_alloc_initialize): Enable garbage
collection.
2019-10-17 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.h: Add an additional POINTERS to pkl_compile_expression.
* src/pkl.c (pkl_compile_expression): Likewise.
* src/pk-cmd.c (pk_cmd_exec_1): Keep a `pointers' variable in the
stack and pass it to pkl_compile_expression.
* src/pvm-alloc.c (pvm_alloc_initialize): Disable garbage
collection.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-asm.c (pkl_asm_new): fix pasm->pointers initialization.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal2_ps_type_struct): adjust conditions for
the "unreachable alternative in union" warning.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* pickles/future/bson.pk: Rewrite in modern Poke.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_mapper): Raise E_constraint if no valid
alternatives are found while mapping an union.
* testsuite/poke.map/maps-unions-3.pk: Fix the test to reflect the
above change.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* src/pvm.jitter (pvm_literal_printer_cast): flush output buffers
to assure the right order in the output.
(pvm_literal_printer): Likewise.
(pvm_literal_printer_hi): Likewise.
(pvm_literal_printer_lo): Likewise.
(popf_printer): Likewise.
(bits_printer): Likewise.
(endian_printer): Likewise.
(nenc_printer): Likewise.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/cast-array-diag-5.pk: Fix test.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-ras-mode.el: New file.
* src/pkl-gen.pks: Use poke-ras-mode.
* src/pkl-asm.pks: Likewise.
* HACKING (Appendix): Mention etc/poke-ras-mode.el.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
* src/ras: Support .label directives.
* src/pkl-gen.pks (struct_mapper): Use .label.
2019-10-16 Jose E. Marchesi <jemarch@gnu.org>
Bruno Haible <bruno@clisp.org>
* HACKING (Boehm GC): New section.
(Running an Uninstalled Poke): Mention POKESTYLESDIR.
(Continuous Integration): New section.
(Jitter): Clarify instructions on how to install jitter.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/lib/poke-dg.exp (dg-command): Add a comment block
explaining what the function does.
(dg-command): Avoid a font-lock problem in Emacs.
(dg-data): Fix indentation.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* TODO (#A0 fix multi-line warning messages): New todo entry.
* HACKING (Future Developments): add note about supporting
compile-time type checking for unions with alternatives with the
same name.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-default.css: Remove trailing whitespaces.
* src/pkl.c: Likewise.
* src/poke.c: Likewise.
* src/pvm-val.c: Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-gen.pks (struct_mapper): Support unions in the mapping
algorithm.
* testsuite/poke.map/maps-unions-1.pk: New file.
* testsuite/poke.map/maps-unions-2.pk: Likewise.
* testsuite/poke.map/maps-unions-3.pk: Likewise.
* testsuite/poke.map/maps-unions-4.pk: Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* testsuite/poke.pkl/union-1.pk: Test fixed.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal2_ps_type_struct): Pass an AST argument
to pkl_warning.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-anal.c (pkl_anal2_ps_type_struct): New handler.
(pkl_phase_anal2): Register pkl_anal2_ps_type_struct.
* testsuite/poke.pkl/union-diag-1.pk: New file.
* testsuite/poke.pkl/union-diag-2.pk: Likewise.
* testsuite/poke.pkl/union-diag-3.pk: Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-ast.h (struct pkl_ast_type): New field union_p for
struct types.
(PKL_AST_TYPE_S_UNION): Define.
(pkl_ast_make_struct_type): Get an union_p argument.
* src/pkl-ast.c (pkl_ast_make_struct_type): Initialize union_p.
(pkl_ast_dup_type): Handle union_p.
(pkl_ast_print_1): Likewise.
* src/pkl-tab.y (struct_type_specifier): Pass union_p to
pkl_ast_make_struct_type.
* src/pkl-typify.c (pkl_typify1_ps_struct): Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-lex.l: Support for token union.
* src/pkl-tab.y (UNION): New token.
(struct_or_union): New rule.
(struct_type_specifier): Use struct_or_union.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (pkl_warning): Emit the filename containing the error.
(pkl_error): Use <stdin> as the filename whenever necessary.
(pkl_warning): Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (pkl_detailed_location): Get an additional argument
specifying the style class to use for terminal output.
(pkl_error): Pass the style class to pkl_detailed_location.
(pkl_warning): Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.h: Make pkl_warning to get an AST argument.
* src/pkl.c (pkl_detailed_location): New function.
(pkl_error): Use pkl_detailed_location.
(pkl_warning): Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-file.c (pk_cmd_file): Use pk_printf instead of printf.
(pk_cmd_close): Likewise.
(print_info_file): Likewise.
(pk_cmd_info_files): Likewise.
(pk_cmd_load_file): Likewise.
2019-10-15 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (libtextstyle): New section.
2019-10-14 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-term.h: Prototypes for pk_term_hyperlink and
pk_term_end_hyperlink.
* src/pk-term.c (pk_term_hyperlink): New function.
(pk_term_end_hyperlink): Likewise.
* src/poke.c (pk_print_version): Use a terminal hyperlink for the
GPLv3 webpage.
2019-10-14 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Terminal Handling): New chapter.
(pk-term): New section.
(Styling Classes): Likewise.
(Debugging Styling): Likewise.
2019-10-14 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac (ENABLE_DEBUG): ac_subst.
(WITH_JITTER): Likewise.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Specify
--with-jitter and --enable-debug options.
* src/Makefile.am (poke_SOURCES): Add pkl-insn.def, pkl-ops.def
and pkl-attrs.def.
(BUILT_SOURCES): Add pvm-vm.h, pvm-vm1.c and pvm-vm2.c.
2019-10-10 Jose E. Marchesi <jemarch@gnu.org>
* etc/poke-default.css: New file.
* src/pk-term.c: Likewise.
* Makefile.am (SUBDIRS): Add etc/.
* src/pvm.jitter: pk_printf is a wrapped function.
Include pk-term.h in early-c.
Use pk-term printing services in pretty printers and instructions.
* src/pvm-val.h: pvm_print_string and pvm_print_val do not take a
FILE* argument any longer.
* src/pvm-val.c (pvm_print_binary): Likewise.
(pvm_print_val): Likewise.
(pvm_print_string): Likewise.
* src/poke.c: Include pk-term.h.
Support --color and --style long options.
(print_help): Use print services from pk-term.
(pk_print_version): Likewise.
(finalize): Shutdown the pk-term subsystem.
(repl): Likewise.
(parse_args): Handle --color and -style.
(initialize): Get argc and argv as arguments.
(initialize): Initialize the pk-term subsystem.
(main): Pass argc and argv to `initialize'.
* src/pkl.c (pkl_new): Likewise.
(pkl_error): Likewise.
(pkl_warning): Likewise.
(pkl_ice): Likewise.
* src/pk-vm.c (pk_cmd_vm_disas_fun): Use print services from
pk-term.
(pk_cmd_vm_disas_map): Likewise.
(pk_cmd_vm_disas_writ): Likewise.
* src/pk-term.h: Include textstyle.h.
Remove obsolete constants.
Add prototypes for pk-term services.
* src/pk-set.c: Include pk-term.h.
(pk_cmd_set_obase): Use print services form pk-term.
(pk_cmd_set_endian): Likewise.
(pk_cmd_set_nenc): Likewise.
* src/pk-print.c: Include pk-term.h.
(pk_cmd_print): Use print services from pk-term.
* src/pk-def.c: Include pk-term.h.
(print_var_decl): Use print services from pk-term.
(print_fun_decl): Likewise.
* src/pk-cmd.c: Include pk-term.h.
(pk_cmd_exec_1): Use print services from pk-term.
(pk_cmd_exec): Likewise.
* src/Makefile.am (poke_CPPFLAGS): Add $(top_builddir)/lib to the
include path.
* bootstrap.conf (gnulib_modules): Add textstyle-optional.
* configure.ac: Use gl_LIBTEXTSTYLE_OPTIONAL.
* src/Makefile.am (poke_LDADD): Link with libtextstyle.
* testsuite/lib/poke-dg.exp (poke-dg-test): Pass --color=no to
poke when running tests.
* testsuite/lib/poke.exp (poke_start): Likewise.
* HACKING (Appendix):List src/pk-term.c in sources.
2019-10-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (pkl_error): Fix truncation of source code sample in
detailed error output.
2019-10-06 Jose E. Marchesi <jemarch@gnu.org>
* .x-sc_trailing_blank: Add TODO.
* HACKING: Regenerate table of contents.
2019-10-05 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Deciding on What to Work on): New section referring to
TODO.
* TODO: Reformat and complete.
2019-10-05 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (Flattening): Add a note about compile-time
flattening of pinned structs.
2019-10-05 Jose E. Marchesi <jemarch@gnu.org>
* doc/poke.texi (String Indexing): New section.
(String Concatenation): Likewise
2019-10-05 Jose E. Marchesi <jemarch@gnu.org>
* src/Makefile.am (poke_CPPFLAGS): Add $(top_builddir)/lib to the
headers search path.
2019-10-04 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Submitting a Patch): Add a note about running `make
syntax-check'.
2019-10-04 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (local-checks-to-skip): Remove sc_trailing_blank.
* .x-sc_trailing_blanks: New file.
* pickles/elf.pk: Remove trailing blanks.
* etc/poke-gdb.scm: Likewise.
* doc/poke.texi: Likewise.
* testsuite/poke.std/std.exp: Likewise.
* testsuite/poke.pkl/try-catch-2.pk: Likewise.
* testsuite/poke.pkl/structs.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-diag-7.pk: Likewise.
* testsuite/poke.pkl/promo-array-arg-8.pk: Likewise.
* testsuite/poke.pkl/pkl.exp: Likewise.
* testsuite/poke.pkl/loop-4.pk: Likewise.
* testsuite/poke.pkl/loop-3.pk: Likewise.
* testsuite/poke.pkl/funcall-def-diag-7.pk: Likewise.
* testsuite/poke.pkl/funcall-def-diag-5.pk: Likewise.
* testsuite/poke.pkl/funcall-def-2.pk: Likewise.
* testsuite/poke.pkl/fun-types-4.pk: Likewise.
* testsuite/poke.pkl/fun-types-3.pk: Likewise.
* testsuite/poke.pkl/for-in-2.pk: Likewise.
* testsuite/poke.pkl/defun-12.pk: Likewise.
* testsuite/poke.pkl/defun-10.pk: Likewise.
* testsuite/poke.pkl/break-while-2.pk: Likewise.
* testsuite/poke.pkl/break-while-1.pk: Likewise.
* testsuite/poke.pkl/break-for-1.pk: Likewise.
* testsuite/poke.pkl/array-siz-1.pk: Likewise.
* testsuite/poke.map/maps-structs-constraints-1.pk: Likewise.
* testsuite/poke.map/maps-arrays-4.pk: Likewise.
* testsuite/poke.map/map.exp: Likewise.
* testsuite/poke.cmd/cmd.exp: Likewise.
* testsuite/lib/poke.exp: Likewise.
* testsuite/lib/poke-dg.exp: Likewise.
* src/std.pk: Likewise.
* src/ras: Likewise.
* src/pvm.jitter: Likewise.
* src/pkl-insn.def: Likewise.
* src/pkl-gen.pks: Likewise.
* src/pkl-asm.pks: Likewise.
* src/pk-dump.pk: Likewise.
2019-10-04 Henner Zeller <h.zeller@acm.org>
* src/ios-dev.h: Remove trailing spaces.
* src/ios.c: Likewise.
* src/ios.h: Likewise.
* src/pk-cmd.c: Likewise.
* src/pk-def.c: Likewise.
* src/pk-file.c: Likewise.
* src/pk-misc.c: Likewise.
* src/pk-print.c: Likewise.
* src/pk-set.c: Likewise.
* src/pk-vm.c: Likewise.
* src/pkl-anal.c: Likewise.
* src/pkl-asm.c: Likewise.
* src/pkl-asm.h: Likewise.
* src/pkl-ast.c: Likewise.
* src/pkl-ast.h: Likewise.
* src/pkl-env.c: Likewise.
* src/pkl-fold.c: Likewise.
* src/pkl-gen.c: Likewise.
* src/pkl-lex.l: Likewise.
* src/pkl-parser.c: Likewise.
* src/pkl-pass.c: Likewise.
* src/pkl-pass.h: Likewise.
* src/pkl-promo.c: Likewise.
* src/pkl-tab.y: Likewise.
* src/pkl-trans.c: Likewise.
* src/pkl-trans.h: Likewise.
* src/pkl-typify.c: Likewise.
* src/pkl.c: Likewise.
* src/poke.c: Likewise.
* src/pvm-alloc.h: Likewise.
* src/pvm-env.c: Likewise.
* src/pvm-val.c: Likewise.
* src/pvm-val.h: Likewise.
2019-10-04 Jose E. Marchesi <jemarch@gnu.org>
* cfg.mk (local-checks-to-skip): Add sc_tight_scope.
* .x-sc_makefile_TAB_only_indentation: New file.
* .x-sc_prohibit_empty_lines_at_EOF: Likewise.
* .x-sc_makefile_path_separator_check: Likewise.
* .x-sc_prohibit_undesirable_word_seq: Likewise.
* .x-sc_tight_scope: Likewise.
* testsuite/poke.pkl/rand-1.pk: Remove empty lines at EOF.
* ChangeLog: Likewise.
2019-10-03 Henner Zeller <h.zeller@acm.org>
* .gitignore: ignore src/*.o files.
2019-10-03 Henner Zeller <h.zeller@acm.org>
* src/pk-dump.pk (pk_dump_ascii): Default to 1.
(dump): Provide ASCII output.
2019-10-03 Henner Zeller <h.zeller@acm.org>
* src/pkl-trans.c: Include gettext.h and define _ for i18n.
(pkl_trans1_ps_print_stmt): Handle %c format tags.
Add more specific (i18n'd) error messages in format-string
parsing.
* src/pvm.jitter (PVM_PRINTI): Handle %c.
2019-10-03 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl.c (rest_of_compilation): Do not traverse node types in
the lex pass.
* src/pkl-trans.c (pkl_transl_pr_type_struct): New handler.
* testsuite/poke.map/maps-arrays-15.pk: New test.
2019-10-03 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Building): Mention --skip-po to invoke bootstrap, and
other updates.
2019-10-03 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Writing Poke): Add a note about using CamelCase for
type names.
2019-10-02 Jose E. Marchesi <jemarch@gnu.org>
* src/std.pk (NULL): New variable.
2019-10-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/ctf.pk (ctf_section): Removed, as this replicates logic
in elf_section_by_name.
2019-10-02 Jose E. Marchesi <jemarch@gnu.org>
* src/poke.c (print_help): Fix TRANSLATORS: commands to refer to
poke.
2019-10-02 gettextize <bug-gnu-gettext@gnu.org>
* m4/lib-ld.m4: Upgrade to gettext-0.19.8.1.
* m4/lib-link.m4: Upgrade to gettext-0.19.8.1.
* m4/lib-prefix.m4: Upgrade to gettext-0.19.8.1.
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8.
2019-10-02 Jose E. Marchesi <jemarch@gnu.org>
* Makefile.am (SUBDIRS): Add po/.
2019-10-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (Elf64_Addr): turn type into an offset.
(Elf64_Rela): Adjust accordingly.
2019-10-02 Jose E. Marchesi <jemarch@gnu.org>
* pickles/elf.pk (elf_section_by_name): New function.
(elf_section_by_type): Likewise.
(SHT_DYNSYM): Define.
(elf_string): Add comment with documentation.
2019-10-01 Jose E. Marchesi <jemarch@gnu.org>
* pickles/Makefile.am (dist_pkgdata_DATA): Distribute elf.pk and
ctf.pk only.
* pickles/future/bmp.pk: Moved from pickles/
* pickles/future/tar.pk: Likewise.
* pickles/future/swf.pk: Likewise.
* pickles/future/pdp10.pk: Likewise.
* pickles/future/mp3.pk: Likewise.
* pickles/future/leb128.pk: Likewise.
* pickles/future/jpeg.pk: Likewise.
* pickles/future/id3v2.pk: Likewise.
* pickles/future/id3v1.pk: Likewise.
* pickles/future/gzip.pk: Likewise.
* pickles/future/flv.pk: Likewise.
* pickles/future/elf-future.pk: Likewise.
* pickles/future/dwarf.pk: Likewise.
* pickles/future/deflate.pk: Likewise.
* pickles/future/bson.pk: Likewise.
2019-10-01 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-file.c (pk_cmd_load_file): Try to load the specified file
relative to the current working directory, then look in datadir.
2019-09-30 Jose E. Marchesi <jemarch@gnu.org>
* HACKING: (Nomenclature): New section.
2019-09-30 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Writing C): New section, referring to the GNU Coding
Standards.
(Submitting a Patch): New section.
2019-09-11 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (readline): New section in Development Environment,
about the dependency libreadline.
2019-09-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-cmd.c (pk_cmd_exec_1): Avoid a buffer overrun when
doing tilde expansion in file names.
2019-09-07 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Jitter): Document a set of recommended switches to use
when configuring jitter.
2019-09-07 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Adding Compiler Built-Ins): New section.
2019-09-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pk-cmd.c (skip_blanks): handle p == NULL.
2019-09-07 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-promo.c (pkl_promo_ps_op_unary): Initialize `restart'.
* src/pkl-lex.l: Avoid a dead initialization.
* src/pkl.c (pkl_error): Likewise.
* src/pkl-typify.c (pkl_typify1_ps_funcall): Likewise.
* src/pkl-gen.c (pkl_gen_pr_ass_stmt): Likewise.
* src/pkl-asm.c (pkl_asm_insn): Avoid the possibility of a NULL
deference.
2019-09-06 Jose E. Marchesi <jemarch@gnu.org>
* src/pkl-insn.def: New instruction RAND.
* src/pvm.jitter (rand): New instruction.
(wrapped-functions): Add wrapper for `random'.
* bootstrap.conf (gnulib_modules): Add `random' gnulib module.
* src/pkl-ast.h (PKL_AST_BUILTIN_RAND): Define.
* src/pkl-gen.c (pkl_gen_ps_comp_stmt): Emit code for the RAND
built-int.
* src/pkl-lex.l: Recognize BUILTIN_RAND token.
* src/pkl-tab.y: Define token BUILTIN_RANDR.
(comp_stmt): New rule for builtin randr.
* testsuite/poke.pkl/rand-1.pk: New file.
2019-09-06 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Jitter): Replace git:// URL with an http://, for
jitter.
(Development Environment): Add a note about setting POKEDATADIR to
run an uninstalled poke.
2019-09-06 Jose E. Marchesi <jemarch@gnu.org>
* HACKING (Jitter): Add information on the dependency on jitter.
|