| ... | ... | @@ -117,17 +117,18 @@ pub const Diagnostics = struct { |
| 117 | 117 | errors: []const Error, |
| 118 | 118 | |
| 119 | 119 | pub fn format(self: *const @This(), w: *std.Io.Writer) std.Io.Writer.Error!void { |
| 120 | | for (self.errors) |e| { |
| 121 | | try w.print("{s}:", .{self.path}); |
| 122 | | try w.print("{d}:{d}: error: {s}\n", .{ |
| 120 | for (self.errors, 0..) |e, i| { |
| 121 | if (i > 0) try w.writeByte('\n'); |
| 122 | try w.print("{s}:{d}:{d}: error: {s}", .{ |
| 123 | self.path, |
| 123 | 124 | e.loc.line + 1, |
| 124 | 125 | e.loc.column + 1, |
| 125 | 126 | e.msg, |
| 126 | 127 | }); |
| 127 | 128 | |
| 128 | 129 | for (e.notes) |note| { |
| 129 | | try w.print("{s}:", .{self.path}); |
| 130 | | try w.print("{d}:{d}: note: {s}\n", .{ |
| 130 | try w.print("\n{s}:{d}:{d}: note: {s}", .{ |
| 131 | self.path, |
| 131 | 132 | note.loc.line + 1, |
| 132 | 133 | note.loc.column + 1, |
| 133 | 134 | note.msg, |
| ... | ... | @@ -1394,7 +1395,6 @@ test "std.zon ast errors" { |
| 1394 | 1395 | ); |
| 1395 | 1396 | try std.testing.expectFmt( |
| 1396 | 1397 | \\input.zon:1:13: error: expected ',' after initializer |
| 1397 | | \\ |
| 1398 | 1398 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1399 | 1399 | } |
| 1400 | 1400 | |
| ... | ... | @@ -1429,7 +1429,6 @@ test "std.zon comments" { |
| 1429 | 1429 | })); |
| 1430 | 1430 | try std.testing.expectFmt( |
| 1431 | 1431 | \\input.zon:1:1: error: expected expression, found 'a document comment' |
| 1432 | | \\ |
| 1433 | 1432 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1434 | 1433 | } |
| 1435 | 1434 | } |
| ... | ... | @@ -1469,7 +1468,6 @@ test "std.zon fromSlice syntax error" { |
| 1469 | 1468 | ); |
| 1470 | 1469 | try std.testing.expectFmt( |
| 1471 | 1470 | \\input.zon:1:3: error: expected expression, found 'EOF' |
| 1472 | | \\ |
| 1473 | 1471 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1474 | 1472 | } |
| 1475 | 1473 | |
| ... | ... | @@ -1610,7 +1608,6 @@ test "std.zon unions" { |
| 1610 | 1608 | try std.testing.expectFmt( |
| 1611 | 1609 | \\input.zon:1:4: error: unexpected field 'z' |
| 1612 | 1610 | \\input.zon:1:4: note: supported: 'x', 'y' |
| 1613 | | \\ |
| 1614 | 1611 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1615 | 1612 | } |
| 1616 | 1613 | |
| ... | ... | @@ -1628,7 +1625,6 @@ test "std.zon unions" { |
| 1628 | 1625 | ); |
| 1629 | 1626 | try std.testing.expectFmt( |
| 1630 | 1627 | \\input.zon:1:6: error: expected type 'void' |
| 1631 | | \\ |
| 1632 | 1628 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1633 | 1629 | } |
| 1634 | 1630 | |
| ... | ... | @@ -1646,7 +1642,6 @@ test "std.zon unions" { |
| 1646 | 1642 | ); |
| 1647 | 1643 | try std.testing.expectFmt( |
| 1648 | 1644 | \\input.zon:1:2: error: expected union |
| 1649 | | \\ |
| 1650 | 1645 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1651 | 1646 | } |
| 1652 | 1647 | |
| ... | ... | @@ -1664,7 +1659,6 @@ test "std.zon unions" { |
| 1664 | 1659 | ); |
| 1665 | 1660 | try std.testing.expectFmt( |
| 1666 | 1661 | \\input.zon:1:2: error: expected union |
| 1667 | | \\ |
| 1668 | 1662 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1669 | 1663 | } |
| 1670 | 1664 | |
| ... | ... | @@ -1679,7 +1673,6 @@ test "std.zon unions" { |
| 1679 | 1673 | })); |
| 1680 | 1674 | try std.testing.expectFmt( |
| 1681 | 1675 | \\input.zon:1:2: error: expected union |
| 1682 | | \\ |
| 1683 | 1676 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1684 | 1677 | } |
| 1685 | 1678 | |
| ... | ... | @@ -1695,7 +1688,6 @@ test "std.zon unions" { |
| 1695 | 1688 | try std.testing.expectFmt( |
| 1696 | 1689 | \\input.zon:1:2: error: unexpected field 'y' |
| 1697 | 1690 | \\input.zon:1:2: note: supported: 'x' |
| 1698 | | \\ |
| 1699 | 1691 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1700 | 1692 | } |
| 1701 | 1693 | |
| ... | ... | @@ -1710,7 +1702,6 @@ test "std.zon unions" { |
| 1710 | 1702 | })); |
| 1711 | 1703 | try std.testing.expectFmt( |
| 1712 | 1704 | \\input.zon:1:2: error: expected union |
| 1713 | | \\ |
| 1714 | 1705 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1715 | 1706 | } |
| 1716 | 1707 | } |
| ... | ... | @@ -1790,7 +1781,6 @@ test "std.zon structs" { |
| 1790 | 1781 | try std.testing.expectFmt( |
| 1791 | 1782 | \\input.zon:1:12: error: unexpected field 'z' |
| 1792 | 1783 | \\input.zon:1:12: note: supported: 'x', 'y' |
| 1793 | | \\ |
| 1794 | 1784 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1795 | 1785 | } |
| 1796 | 1786 | |
| ... | ... | @@ -1809,7 +1799,6 @@ test "std.zon structs" { |
| 1809 | 1799 | try std.testing.expectFmt( |
| 1810 | 1800 | \\input.zon:1:4: error: duplicate struct field name |
| 1811 | 1801 | \\input.zon:1:12: note: duplicate name here |
| 1812 | | \\ |
| 1813 | 1802 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1814 | 1803 | } |
| 1815 | 1804 | |
| ... | ... | @@ -1841,7 +1830,6 @@ test "std.zon structs" { |
| 1841 | 1830 | try std.testing.expectFmt( |
| 1842 | 1831 | \\input.zon:1:4: error: unexpected field 'x' |
| 1843 | 1832 | \\input.zon:1:4: note: none expected |
| 1844 | | \\ |
| 1845 | 1833 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1846 | 1834 | } |
| 1847 | 1835 | |
| ... | ... | @@ -1859,7 +1847,6 @@ test "std.zon structs" { |
| 1859 | 1847 | ); |
| 1860 | 1848 | try std.testing.expectFmt( |
| 1861 | 1849 | \\input.zon:1:2: error: missing required field y |
| 1862 | | \\ |
| 1863 | 1850 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1864 | 1851 | } |
| 1865 | 1852 | |
| ... | ... | @@ -1899,7 +1886,6 @@ test "std.zon structs" { |
| 1899 | 1886 | try std.testing.expectError(error.ParseZon, parsed); |
| 1900 | 1887 | try std.testing.expectFmt( |
| 1901 | 1888 | \\input.zon:1:18: error: cannot initialize comptime field |
| 1902 | | \\ |
| 1903 | 1889 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1904 | 1890 | } |
| 1905 | 1891 | |
| ... | ... | @@ -1942,7 +1928,6 @@ test "std.zon structs" { |
| 1942 | 1928 | try std.testing.expectFmt( |
| 1943 | 1929 | \\input.zon:1:1: error: types are not available in ZON |
| 1944 | 1930 | \\input.zon:1:1: note: replace the type with '.' |
| 1945 | | \\ |
| 1946 | 1931 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1947 | 1932 | } |
| 1948 | 1933 | |
| ... | ... | @@ -1958,7 +1943,6 @@ test "std.zon structs" { |
| 1958 | 1943 | try std.testing.expectFmt( |
| 1959 | 1944 | \\input.zon:1:1: error: types are not available in ZON |
| 1960 | 1945 | \\input.zon:1:1: note: replace the type with '.' |
| 1961 | | \\ |
| 1962 | 1946 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1963 | 1947 | } |
| 1964 | 1948 | |
| ... | ... | @@ -1974,7 +1958,6 @@ test "std.zon structs" { |
| 1974 | 1958 | try std.testing.expectFmt( |
| 1975 | 1959 | \\input.zon:1:1: error: types are not available in ZON |
| 1976 | 1960 | \\input.zon:1:1: note: replace the type with '.' |
| 1977 | | \\ |
| 1978 | 1961 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1979 | 1962 | } |
| 1980 | 1963 | |
| ... | ... | @@ -1990,7 +1973,6 @@ test "std.zon structs" { |
| 1990 | 1973 | try std.testing.expectFmt( |
| 1991 | 1974 | \\input.zon:1:1: error: types are not available in ZON |
| 1992 | 1975 | \\input.zon:1:1: note: replace the type with '.' |
| 1993 | | \\ |
| 1994 | 1976 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1995 | 1977 | } |
| 1996 | 1978 | |
| ... | ... | @@ -2006,7 +1988,6 @@ test "std.zon structs" { |
| 2006 | 1988 | try std.testing.expectFmt( |
| 2007 | 1989 | \\input.zon:1:9: error: types are not available in ZON |
| 2008 | 1990 | \\input.zon:1:9: note: replace the type with '.' |
| 2009 | | \\ |
| 2010 | 1991 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2011 | 1992 | } |
| 2012 | 1993 | } |
| ... | ... | @@ -2085,7 +2066,6 @@ test "std.zon tuples" { |
| 2085 | 2066 | ); |
| 2086 | 2067 | try std.testing.expectFmt( |
| 2087 | 2068 | \\input.zon:1:14: error: index 2 outside of tuple length 2 |
| 2088 | | \\ |
| 2089 | 2069 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2090 | 2070 | } |
| 2091 | 2071 | |
| ... | ... | @@ -2103,7 +2083,6 @@ test "std.zon tuples" { |
| 2103 | 2083 | ); |
| 2104 | 2084 | try std.testing.expectFmt( |
| 2105 | 2085 | \\input.zon:1:2: error: missing tuple field with index 1 |
| 2106 | | \\ |
| 2107 | 2086 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2108 | 2087 | } |
| 2109 | 2088 | |
| ... | ... | @@ -2121,7 +2100,6 @@ test "std.zon tuples" { |
| 2121 | 2100 | ); |
| 2122 | 2101 | try std.testing.expectFmt( |
| 2123 | 2102 | \\input.zon:1:2: error: expected tuple |
| 2124 | | \\ |
| 2125 | 2103 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2126 | 2104 | } |
| 2127 | 2105 | |
| ... | ... | @@ -2139,7 +2117,6 @@ test "std.zon tuples" { |
| 2139 | 2117 | ); |
| 2140 | 2118 | try std.testing.expectFmt( |
| 2141 | 2119 | \\input.zon:1:2: error: expected struct |
| 2142 | | \\ |
| 2143 | 2120 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2144 | 2121 | } |
| 2145 | 2122 | |
| ... | ... | @@ -2167,7 +2144,6 @@ test "std.zon tuples" { |
| 2167 | 2144 | try std.testing.expectError(error.ParseZon, parsed); |
| 2168 | 2145 | try std.testing.expectFmt( |
| 2169 | 2146 | \\input.zon:1:9: error: cannot initialize comptime field |
| 2170 | | \\ |
| 2171 | 2147 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2172 | 2148 | } |
| 2173 | 2149 | } |
| ... | ... | @@ -2356,7 +2332,6 @@ test "std.zon arrays and slices" { |
| 2356 | 2332 | ); |
| 2357 | 2333 | try std.testing.expectFmt( |
| 2358 | 2334 | \\input.zon:1:3: error: index 0 outside of array of length 0 |
| 2359 | | \\ |
| 2360 | 2335 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2361 | 2336 | } |
| 2362 | 2337 | |
| ... | ... | @@ -2373,7 +2348,6 @@ test "std.zon arrays and slices" { |
| 2373 | 2348 | ); |
| 2374 | 2349 | try std.testing.expectFmt( |
| 2375 | 2350 | \\input.zon:1:8: error: index 1 outside of array of length 1 |
| 2376 | | \\ |
| 2377 | 2351 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2378 | 2352 | } |
| 2379 | 2353 | |
| ... | ... | @@ -2390,7 +2364,6 @@ test "std.zon arrays and slices" { |
| 2390 | 2364 | ); |
| 2391 | 2365 | try std.testing.expectFmt( |
| 2392 | 2366 | \\input.zon:1:2: error: expected 2 array elements; found 1 |
| 2393 | | \\ |
| 2394 | 2367 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2395 | 2368 | } |
| 2396 | 2369 | |
| ... | ... | @@ -2407,7 +2380,6 @@ test "std.zon arrays and slices" { |
| 2407 | 2380 | ); |
| 2408 | 2381 | try std.testing.expectFmt( |
| 2409 | 2382 | \\input.zon:1:2: error: expected 3 array elements; found 0 |
| 2410 | | \\ |
| 2411 | 2383 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2412 | 2384 | } |
| 2413 | 2385 | |
| ... | ... | @@ -2426,7 +2398,6 @@ test "std.zon arrays and slices" { |
| 2426 | 2398 | ); |
| 2427 | 2399 | try std.testing.expectFmt( |
| 2428 | 2400 | \\input.zon:1:3: error: expected type 'bool' |
| 2429 | | \\ |
| 2430 | 2401 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2431 | 2402 | } |
| 2432 | 2403 | |
| ... | ... | @@ -2443,7 +2414,6 @@ test "std.zon arrays and slices" { |
| 2443 | 2414 | ); |
| 2444 | 2415 | try std.testing.expectFmt( |
| 2445 | 2416 | \\input.zon:1:3: error: expected type 'bool' |
| 2446 | | \\ |
| 2447 | 2417 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2448 | 2418 | } |
| 2449 | 2419 | } |
| ... | ... | @@ -2463,7 +2433,6 @@ test "std.zon arrays and slices" { |
| 2463 | 2433 | ); |
| 2464 | 2434 | try std.testing.expectFmt( |
| 2465 | 2435 | \\input.zon:1:1: error: expected array |
| 2466 | | \\ |
| 2467 | 2436 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2468 | 2437 | } |
| 2469 | 2438 | |
| ... | ... | @@ -2475,7 +2444,6 @@ test "std.zon arrays and slices" { |
| 2475 | 2444 | ); |
| 2476 | 2445 | try std.testing.expectFmt( |
| 2477 | 2446 | \\input.zon:1:1: error: expected array |
| 2478 | | \\ |
| 2479 | 2447 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2480 | 2448 | } |
| 2481 | 2449 | } |
| ... | ... | @@ -2488,7 +2456,6 @@ test "std.zon arrays and slices" { |
| 2488 | 2456 | ); |
| 2489 | 2457 | try std.testing.expectFmt( |
| 2490 | 2458 | \\input.zon:1:3: error: pointers are not available in ZON |
| 2491 | | \\ |
| 2492 | 2459 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2493 | 2460 | } |
| 2494 | 2461 | } |
| ... | ... | @@ -2542,7 +2509,6 @@ test "std.zon string literal" { |
| 2542 | 2509 | ); |
| 2543 | 2510 | try std.testing.expectFmt( |
| 2544 | 2511 | \\input.zon:1:1: error: expected array |
| 2545 | | \\ |
| 2546 | 2512 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2547 | 2513 | } |
| 2548 | 2514 | |
| ... | ... | @@ -2553,7 +2519,6 @@ test "std.zon string literal" { |
| 2553 | 2519 | ); |
| 2554 | 2520 | try std.testing.expectFmt( |
| 2555 | 2521 | \\input.zon:1:1: error: expected array |
| 2556 | | \\ |
| 2557 | 2522 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2558 | 2523 | } |
| 2559 | 2524 | } |
| ... | ... | @@ -2576,7 +2541,6 @@ test "std.zon string literal" { |
| 2576 | 2541 | ); |
| 2577 | 2542 | try std.testing.expectFmt( |
| 2578 | 2543 | \\input.zon:1:1: error: expected array |
| 2579 | | \\ |
| 2580 | 2544 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2581 | 2545 | } |
| 2582 | 2546 | |
| ... | ... | @@ -2592,7 +2556,6 @@ test "std.zon string literal" { |
| 2592 | 2556 | ); |
| 2593 | 2557 | try std.testing.expectFmt( |
| 2594 | 2558 | \\input.zon:1:1: error: expected array |
| 2595 | | \\ |
| 2596 | 2559 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2597 | 2560 | } |
| 2598 | 2561 | } |
| ... | ... | @@ -2631,7 +2594,6 @@ test "std.zon string literal" { |
| 2631 | 2594 | ); |
| 2632 | 2595 | try std.testing.expectFmt( |
| 2633 | 2596 | \\input.zon:1:1: error: expected array |
| 2634 | | \\ |
| 2635 | 2597 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2636 | 2598 | } |
| 2637 | 2599 | |
| ... | ... | @@ -2642,7 +2604,6 @@ test "std.zon string literal" { |
| 2642 | 2604 | ); |
| 2643 | 2605 | try std.testing.expectFmt( |
| 2644 | 2606 | \\input.zon:1:1: error: expected array |
| 2645 | | \\ |
| 2646 | 2607 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2647 | 2608 | } |
| 2648 | 2609 | } |
| ... | ... | @@ -2655,7 +2616,6 @@ test "std.zon string literal" { |
| 2655 | 2616 | ); |
| 2656 | 2617 | try std.testing.expectFmt( |
| 2657 | 2618 | \\input.zon:1:1: error: expected string |
| 2658 | | \\ |
| 2659 | 2619 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2660 | 2620 | } |
| 2661 | 2621 | |
| ... | ... | @@ -2667,7 +2627,6 @@ test "std.zon string literal" { |
| 2667 | 2627 | ); |
| 2668 | 2628 | try std.testing.expectFmt( |
| 2669 | 2629 | \\input.zon:1:3: error: expected type 'u8' |
| 2670 | | \\ |
| 2671 | 2630 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2672 | 2631 | } |
| 2673 | 2632 | |
| ... | ... | @@ -2679,7 +2638,6 @@ test "std.zon string literal" { |
| 2679 | 2638 | ); |
| 2680 | 2639 | try std.testing.expectFmt( |
| 2681 | 2640 | \\input.zon:1:3: error: invalid escape character: 'a' |
| 2682 | | \\ |
| 2683 | 2641 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2684 | 2642 | } |
| 2685 | 2643 | |
| ... | ... | @@ -2692,7 +2650,6 @@ test "std.zon string literal" { |
| 2692 | 2650 | ); |
| 2693 | 2651 | try std.testing.expectFmt( |
| 2694 | 2652 | \\input.zon:1:1: error: expected array |
| 2695 | | \\ |
| 2696 | 2653 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2697 | 2654 | } |
| 2698 | 2655 | |
| ... | ... | @@ -2703,7 +2660,6 @@ test "std.zon string literal" { |
| 2703 | 2660 | ); |
| 2704 | 2661 | try std.testing.expectFmt( |
| 2705 | 2662 | \\input.zon:1:1: error: expected array |
| 2706 | | \\ |
| 2707 | 2663 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2708 | 2664 | } |
| 2709 | 2665 | } |
| ... | ... | @@ -2722,7 +2678,6 @@ test "std.zon string literal" { |
| 2722 | 2678 | ); |
| 2723 | 2679 | try std.testing.expectFmt( |
| 2724 | 2680 | \\input.zon:1:1: error: expected array |
| 2725 | | \\ |
| 2726 | 2681 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2727 | 2682 | } |
| 2728 | 2683 | |
| ... | ... | @@ -2738,7 +2693,6 @@ test "std.zon string literal" { |
| 2738 | 2693 | ); |
| 2739 | 2694 | try std.testing.expectFmt( |
| 2740 | 2695 | \\input.zon:1:1: error: expected array |
| 2741 | | \\ |
| 2742 | 2696 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2743 | 2697 | } |
| 2744 | 2698 | } |
| ... | ... | @@ -2842,7 +2796,6 @@ test "std.zon enum literals" { |
| 2842 | 2796 | try std.testing.expectFmt( |
| 2843 | 2797 | \\input.zon:1:2: error: unexpected enum literal 'qux' |
| 2844 | 2798 | \\input.zon:1:2: note: supported: 'foo', 'bar', 'baz', '@"ab\nc"' |
| 2845 | | \\ |
| 2846 | 2799 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2847 | 2800 | } |
| 2848 | 2801 | |
| ... | ... | @@ -2860,7 +2813,6 @@ test "std.zon enum literals" { |
| 2860 | 2813 | try std.testing.expectFmt( |
| 2861 | 2814 | \\input.zon:1:2: error: unexpected enum literal 'foobarbaz' |
| 2862 | 2815 | \\input.zon:1:2: note: supported: 'foo', 'bar', 'baz', '@"ab\nc"' |
| 2863 | | \\ |
| 2864 | 2816 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2865 | 2817 | } |
| 2866 | 2818 | |
| ... | ... | @@ -2877,7 +2829,6 @@ test "std.zon enum literals" { |
| 2877 | 2829 | ); |
| 2878 | 2830 | try std.testing.expectFmt( |
| 2879 | 2831 | \\input.zon:1:1: error: expected enum literal |
| 2880 | | \\ |
| 2881 | 2832 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2882 | 2833 | } |
| 2883 | 2834 | |
| ... | ... | @@ -2894,7 +2845,6 @@ test "std.zon enum literals" { |
| 2894 | 2845 | ); |
| 2895 | 2846 | try std.testing.expectFmt( |
| 2896 | 2847 | \\input.zon:1:2: error: identifier cannot contain null bytes |
| 2897 | | \\ |
| 2898 | 2848 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2899 | 2849 | } |
| 2900 | 2850 | } |
| ... | ... | @@ -2935,7 +2885,6 @@ test "std.zon parse bool" { |
| 2935 | 2885 | \\input.zon:1:2: error: invalid expression |
| 2936 | 2886 | \\input.zon:1:2: note: ZON allows identifiers 'true', 'false', 'null', 'inf', and 'nan' |
| 2937 | 2887 | \\input.zon:1:2: note: precede identifier with '.' for an enum literal |
| 2938 | | \\ |
| 2939 | 2888 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2940 | 2889 | } |
| 2941 | 2890 | { |
| ... | ... | @@ -2947,7 +2896,6 @@ test "std.zon parse bool" { |
| 2947 | 2896 | })); |
| 2948 | 2897 | try std.testing.expectFmt( |
| 2949 | 2898 | \\input.zon:1:1: error: expected type 'bool' |
| 2950 | | \\ |
| 2951 | 2899 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2952 | 2900 | } |
| 2953 | 2901 | } |
| ... | ... | @@ -3092,7 +3040,6 @@ test "std.zon parse int" { |
| 3092 | 3040 | })); |
| 3093 | 3041 | try std.testing.expectFmt( |
| 3094 | 3042 | \\input.zon:1:1: error: type 'i66' cannot represent value |
| 3095 | | \\ |
| 3096 | 3043 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3097 | 3044 | } |
| 3098 | 3045 | { |
| ... | ... | @@ -3104,7 +3051,6 @@ test "std.zon parse int" { |
| 3104 | 3051 | })); |
| 3105 | 3052 | try std.testing.expectFmt( |
| 3106 | 3053 | \\input.zon:1:1: error: type 'i66' cannot represent value |
| 3107 | | \\ |
| 3108 | 3054 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3109 | 3055 | } |
| 3110 | 3056 | |
| ... | ... | @@ -3226,7 +3172,6 @@ test "std.zon parse int" { |
| 3226 | 3172 | })); |
| 3227 | 3173 | try std.testing.expectFmt( |
| 3228 | 3174 | \\input.zon:1:3: error: invalid digit 'a' for decimal base |
| 3229 | | \\ |
| 3230 | 3175 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3231 | 3176 | } |
| 3232 | 3177 | |
| ... | ... | @@ -3240,7 +3185,6 @@ test "std.zon parse int" { |
| 3240 | 3185 | })); |
| 3241 | 3186 | try std.testing.expectFmt( |
| 3242 | 3187 | \\input.zon:1:1: error: expected type 'u8' |
| 3243 | | \\ |
| 3244 | 3188 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3245 | 3189 | } |
| 3246 | 3190 | |
| ... | ... | @@ -3254,7 +3198,6 @@ test "std.zon parse int" { |
| 3254 | 3198 | })); |
| 3255 | 3199 | try std.testing.expectFmt( |
| 3256 | 3200 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3257 | | \\ |
| 3258 | 3201 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3259 | 3202 | } |
| 3260 | 3203 | |
| ... | ... | @@ -3268,7 +3211,6 @@ test "std.zon parse int" { |
| 3268 | 3211 | })); |
| 3269 | 3212 | try std.testing.expectFmt( |
| 3270 | 3213 | \\input.zon:1:1: error: type 'i8' cannot represent value |
| 3271 | | \\ |
| 3272 | 3214 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3273 | 3215 | } |
| 3274 | 3216 | |
| ... | ... | @@ -3282,7 +3224,6 @@ test "std.zon parse int" { |
| 3282 | 3224 | })); |
| 3283 | 3225 | try std.testing.expectFmt( |
| 3284 | 3226 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3285 | | \\ |
| 3286 | 3227 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3287 | 3228 | } |
| 3288 | 3229 | |
| ... | ... | @@ -3296,7 +3237,6 @@ test "std.zon parse int" { |
| 3296 | 3237 | })); |
| 3297 | 3238 | try std.testing.expectFmt( |
| 3298 | 3239 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3299 | | \\ |
| 3300 | 3240 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3301 | 3241 | } |
| 3302 | 3242 | |
| ... | ... | @@ -3310,7 +3250,6 @@ test "std.zon parse int" { |
| 3310 | 3250 | })); |
| 3311 | 3251 | try std.testing.expectFmt( |
| 3312 | 3252 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3313 | | \\ |
| 3314 | 3253 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3315 | 3254 | } |
| 3316 | 3255 | |
| ... | ... | @@ -3326,7 +3265,6 @@ test "std.zon parse int" { |
| 3326 | 3265 | \\input.zon:1:2: error: integer literal '-0' is ambiguous |
| 3327 | 3266 | \\input.zon:1:2: note: use '0' for an integer zero |
| 3328 | 3267 | \\input.zon:1:2: note: use '-0.0' for a floating-point signed zero |
| 3329 | | \\ |
| 3330 | 3268 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3331 | 3269 | } |
| 3332 | 3270 | |
| ... | ... | @@ -3342,7 +3280,6 @@ test "std.zon parse int" { |
| 3342 | 3280 | \\input.zon:1:2: error: integer literal '-0' is ambiguous |
| 3343 | 3281 | \\input.zon:1:2: note: use '0' for an integer zero |
| 3344 | 3282 | \\input.zon:1:2: note: use '-0.0' for a floating-point signed zero |
| 3345 | | \\ |
| 3346 | 3283 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3347 | 3284 | } |
| 3348 | 3285 | |
| ... | ... | @@ -3372,7 +3309,6 @@ test "std.zon parse int" { |
| 3372 | 3309 | })); |
| 3373 | 3310 | try std.testing.expectFmt( |
| 3374 | 3311 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3375 | | \\ |
| 3376 | 3312 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3377 | 3313 | } |
| 3378 | 3314 | |
| ... | ... | @@ -3388,7 +3324,6 @@ test "std.zon parse int" { |
| 3388 | 3324 | ); |
| 3389 | 3325 | try std.testing.expectFmt( |
| 3390 | 3326 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3391 | | \\ |
| 3392 | 3327 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3393 | 3328 | } |
| 3394 | 3329 | |
| ... | ... | @@ -3402,7 +3337,6 @@ test "std.zon parse int" { |
| 3402 | 3337 | })); |
| 3403 | 3338 | try std.testing.expectFmt( |
| 3404 | 3339 | \\input.zon:1:3: error: invalid digit 'g' for hex base |
| 3405 | | \\ |
| 3406 | 3340 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3407 | 3341 | } |
| 3408 | 3342 | |
| ... | ... | @@ -3417,7 +3351,6 @@ test "std.zon parse int" { |
| 3417 | 3351 | try std.testing.expectFmt( |
| 3418 | 3352 | \\input.zon:1:1: error: number '0123' has leading zero |
| 3419 | 3353 | \\input.zon:1:1: note: use '0o' prefix for octal literals |
| 3420 | | \\ |
| 3421 | 3354 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3422 | 3355 | } |
| 3423 | 3356 | } |
| ... | ... | @@ -3438,7 +3371,6 @@ test "std.zon negative char" { |
| 3438 | 3371 | })); |
| 3439 | 3372 | try std.testing.expectFmt( |
| 3440 | 3373 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3441 | | \\ |
| 3442 | 3374 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3443 | 3375 | } |
| 3444 | 3376 | { |
| ... | ... | @@ -3450,7 +3382,6 @@ test "std.zon negative char" { |
| 3450 | 3382 | })); |
| 3451 | 3383 | try std.testing.expectFmt( |
| 3452 | 3384 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3453 | | \\ |
| 3454 | 3385 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3455 | 3386 | } |
| 3456 | 3387 | } |
| ... | ... | @@ -3638,7 +3569,6 @@ test "std.zon parse float" { |
| 3638 | 3569 | })); |
| 3639 | 3570 | try std.testing.expectFmt( |
| 3640 | 3571 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3641 | | \\ |
| 3642 | 3572 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3643 | 3573 | } |
| 3644 | 3574 | |
| ... | ... | @@ -3652,7 +3582,6 @@ test "std.zon parse float" { |
| 3652 | 3582 | })); |
| 3653 | 3583 | try std.testing.expectFmt( |
| 3654 | 3584 | \\input.zon:1:1: error: expected type 'i8' |
| 3655 | | \\ |
| 3656 | 3585 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3657 | 3586 | } |
| 3658 | 3587 | |
| ... | ... | @@ -3666,7 +3595,6 @@ test "std.zon parse float" { |
| 3666 | 3595 | })); |
| 3667 | 3596 | try std.testing.expectFmt( |
| 3668 | 3597 | \\input.zon:1:1: error: expected type 'i8' |
| 3669 | | \\ |
| 3670 | 3598 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3671 | 3599 | } |
| 3672 | 3600 | |
| ... | ... | @@ -3680,7 +3608,6 @@ test "std.zon parse float" { |
| 3680 | 3608 | })); |
| 3681 | 3609 | try std.testing.expectFmt( |
| 3682 | 3610 | \\input.zon:1:1: error: expected type 'i8' |
| 3683 | | \\ |
| 3684 | 3611 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3685 | 3612 | } |
| 3686 | 3613 | |
| ... | ... | @@ -3694,7 +3621,6 @@ test "std.zon parse float" { |
| 3694 | 3621 | })); |
| 3695 | 3622 | try std.testing.expectFmt( |
| 3696 | 3623 | \\input.zon:1:1: error: expected type 'i8' |
| 3697 | | \\ |
| 3698 | 3624 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3699 | 3625 | } |
| 3700 | 3626 | |
| ... | ... | @@ -3710,7 +3636,6 @@ test "std.zon parse float" { |
| 3710 | 3636 | \\input.zon:1:1: error: invalid expression |
| 3711 | 3637 | \\input.zon:1:1: note: ZON allows identifiers 'true', 'false', 'null', 'inf', and 'nan' |
| 3712 | 3638 | \\input.zon:1:1: note: precede identifier with '.' for an enum literal |
| 3713 | | \\ |
| 3714 | 3639 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3715 | 3640 | } |
| 3716 | 3641 | |
| ... | ... | @@ -3723,7 +3648,6 @@ test "std.zon parse float" { |
| 3723 | 3648 | })); |
| 3724 | 3649 | try std.testing.expectFmt( |
| 3725 | 3650 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3726 | | \\ |
| 3727 | 3651 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3728 | 3652 | } |
| 3729 | 3653 | |
| ... | ... | @@ -3740,7 +3664,6 @@ test "std.zon parse float" { |
| 3740 | 3664 | ); |
| 3741 | 3665 | try std.testing.expectFmt( |
| 3742 | 3666 | \\input.zon:1:1: error: expected type 'f32' |
| 3743 | | \\ |
| 3744 | 3667 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3745 | 3668 | } |
| 3746 | 3669 | } |
| ... | ... | @@ -3982,7 +3905,6 @@ test "std.zon vector" { |
| 3982 | 3905 | ); |
| 3983 | 3906 | try std.testing.expectFmt( |
| 3984 | 3907 | \\input.zon:1:2: error: expected 2 array elements; found 1 |
| 3985 | | \\ |
| 3986 | 3908 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3987 | 3909 | } |
| 3988 | 3910 | |
| ... | ... | @@ -3999,7 +3921,6 @@ test "std.zon vector" { |
| 3999 | 3921 | ); |
| 4000 | 3922 | try std.testing.expectFmt( |
| 4001 | 3923 | \\input.zon:1:13: error: index 2 outside of array of length 2 |
| 4002 | | \\ |
| 4003 | 3924 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4004 | 3925 | } |
| 4005 | 3926 | |
| ... | ... | @@ -4016,7 +3937,6 @@ test "std.zon vector" { |
| 4016 | 3937 | ); |
| 4017 | 3938 | try std.testing.expectFmt( |
| 4018 | 3939 | \\input.zon:1:8: error: expected type 'f32' |
| 4019 | | \\ |
| 4020 | 3940 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4021 | 3941 | } |
| 4022 | 3942 | |
| ... | ... | @@ -4033,7 +3953,6 @@ test "std.zon vector" { |
| 4033 | 3953 | ); |
| 4034 | 3954 | try std.testing.expectFmt( |
| 4035 | 3955 | \\input.zon:1:1: error: expected type '@Vector(3, u8)' |
| 4036 | | \\ |
| 4037 | 3956 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4038 | 3957 | } |
| 4039 | 3958 | |
| ... | ... | @@ -4050,7 +3969,6 @@ test "std.zon vector" { |
| 4050 | 3969 | ); |
| 4051 | 3970 | try std.testing.expectFmt( |
| 4052 | 3971 | \\input.zon:1:6: error: expected type 'u8' |
| 4053 | | \\ |
| 4054 | 3972 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4055 | 3973 | } |
| 4056 | 3974 | } |
| ... | ... | @@ -4244,7 +4162,6 @@ test "std.zon add pointers" { |
| 4244 | 4162 | ); |
| 4245 | 4163 | try std.testing.expectFmt( |
| 4246 | 4164 | \\input.zon:1:1: error: expected type '?u8' |
| 4247 | | \\ |
| 4248 | 4165 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4249 | 4166 | } |
| 4250 | 4167 | |
| ... | ... | @@ -4260,7 +4177,6 @@ test "std.zon add pointers" { |
| 4260 | 4177 | ); |
| 4261 | 4178 | try std.testing.expectFmt( |
| 4262 | 4179 | \\input.zon:1:1: error: expected type '?f32' |
| 4263 | | \\ |
| 4264 | 4180 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4265 | 4181 | } |
| 4266 | 4182 | |
| ... | ... | @@ -4276,7 +4192,6 @@ test "std.zon add pointers" { |
| 4276 | 4192 | ); |
| 4277 | 4193 | try std.testing.expectFmt( |
| 4278 | 4194 | \\input.zon:1:1: error: expected type '?@Vector(3, u8)' |
| 4279 | | \\ |
| 4280 | 4195 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4281 | 4196 | } |
| 4282 | 4197 | |
| ... | ... | @@ -4292,7 +4207,6 @@ test "std.zon add pointers" { |
| 4292 | 4207 | ); |
| 4293 | 4208 | try std.testing.expectFmt( |
| 4294 | 4209 | \\input.zon:1:1: error: expected type '?bool' |
| 4295 | | \\ |
| 4296 | 4210 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4297 | 4211 | } |
| 4298 | 4212 | |
| ... | ... | @@ -4308,7 +4222,6 @@ test "std.zon add pointers" { |
| 4308 | 4222 | ); |
| 4309 | 4223 | try std.testing.expectFmt( |
| 4310 | 4224 | \\input.zon:1:1: error: expected optional struct |
| 4311 | | \\ |
| 4312 | 4225 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4313 | 4226 | } |
| 4314 | 4227 | |
| ... | ... | @@ -4324,7 +4237,6 @@ test "std.zon add pointers" { |
| 4324 | 4237 | ); |
| 4325 | 4238 | try std.testing.expectFmt( |
| 4326 | 4239 | \\input.zon:1:1: error: expected optional tuple |
| 4327 | | \\ |
| 4328 | 4240 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4329 | 4241 | } |
| 4330 | 4242 | |
| ... | ... | @@ -4340,7 +4252,6 @@ test "std.zon add pointers" { |
| 4340 | 4252 | ); |
| 4341 | 4253 | try std.testing.expectFmt( |
| 4342 | 4254 | \\input.zon:1:1: error: expected optional union |
| 4343 | | \\ |
| 4344 | 4255 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4345 | 4256 | } |
| 4346 | 4257 | |
| ... | ... | @@ -4356,7 +4267,6 @@ test "std.zon add pointers" { |
| 4356 | 4267 | ); |
| 4357 | 4268 | try std.testing.expectFmt( |
| 4358 | 4269 | \\input.zon:1:1: error: expected optional array |
| 4359 | | \\ |
| 4360 | 4270 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4361 | 4271 | } |
| 4362 | 4272 | |
| ... | ... | @@ -4372,7 +4282,6 @@ test "std.zon add pointers" { |
| 4372 | 4282 | ); |
| 4373 | 4283 | try std.testing.expectFmt( |
| 4374 | 4284 | \\input.zon:1:1: error: expected optional array |
| 4375 | | \\ |
| 4376 | 4285 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4377 | 4286 | } |
| 4378 | 4287 | |
| ... | ... | @@ -4388,7 +4297,6 @@ test "std.zon add pointers" { |
| 4388 | 4297 | ); |
| 4389 | 4298 | try std.testing.expectFmt( |
| 4390 | 4299 | \\input.zon:1:1: error: expected optional array |
| 4391 | | \\ |
| 4392 | 4300 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4393 | 4301 | } |
| 4394 | 4302 | |
| ... | ... | @@ -4404,7 +4312,6 @@ test "std.zon add pointers" { |
| 4404 | 4312 | ); |
| 4405 | 4313 | try std.testing.expectFmt( |
| 4406 | 4314 | \\input.zon:1:1: error: expected optional array |
| 4407 | | \\ |
| 4408 | 4315 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4409 | 4316 | } |
| 4410 | 4317 | |
| ... | ... | @@ -4420,7 +4327,6 @@ test "std.zon add pointers" { |
| 4420 | 4327 | ); |
| 4421 | 4328 | try std.testing.expectFmt( |
| 4422 | 4329 | \\input.zon:1:1: error: expected optional string |
| 4423 | | \\ |
| 4424 | 4330 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4425 | 4331 | } |
| 4426 | 4332 | |
| ... | ... | @@ -4436,7 +4342,6 @@ test "std.zon add pointers" { |
| 4436 | 4342 | ); |
| 4437 | 4343 | try std.testing.expectFmt( |
| 4438 | 4344 | \\input.zon:1:1: error: expected optional enum literal |
| 4439 | | \\ |
| 4440 | 4345 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4441 | 4346 | } |
| 4442 | 4347 | } |
| ... | ... | @@ -4697,7 +4602,6 @@ test "std.zon update optionals" { |
| 4697 | 4602 | })); |
| 4698 | 4603 | try std.testing.expectFmt( |
| 4699 | 4604 | \\input.zon:1:12: error: missing required field qux |
| 4700 | | \\ |
| 4701 | 4605 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4702 | 4606 | } |
| 4703 | 4607 | |
| ... | ... | @@ -4825,7 +4729,6 @@ test "std.zon update unions" { |
| 4825 | 4729 | })); |
| 4826 | 4730 | try std.testing.expectFmt( |
| 4827 | 4731 | \\input.zon:1:12: error: missing required field qux |
| 4828 | | \\ |
| 4829 | 4732 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4830 | 4733 | } |
| 4831 | 4734 | |