| ... | ... | @@ -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, |
| ... | ... | @@ -1395,7 +1396,6 @@ test "std.zon ast errors" { |
| 1395 | 1396 | ); |
| 1396 | 1397 | try std.testing.expectFmt( |
| 1397 | 1398 | \\input.zon:1:13: error: expected ',' after initializer |
| 1398 | | \\ |
| 1399 | 1399 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| ... | ... | @@ -1430,7 +1430,6 @@ test "std.zon comments" { |
| 1430 | 1430 | })); |
| 1431 | 1431 | try std.testing.expectFmt( |
| 1432 | 1432 | \\input.zon:1:1: error: expected expression, found 'a document comment' |
| 1433 | | \\ |
| 1434 | 1433 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1435 | 1434 | } |
| 1436 | 1435 | } |
| ... | ... | @@ -1470,7 +1469,6 @@ test "std.zon fromSlice syntax error" { |
| 1470 | 1469 | ); |
| 1471 | 1470 | try std.testing.expectFmt( |
| 1472 | 1471 | \\input.zon:1:3: error: expected expression, found 'EOF' |
| 1473 | | \\ |
| 1474 | 1472 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1475 | 1473 | } |
| 1476 | 1474 | |
| ... | ... | @@ -1611,7 +1609,6 @@ test "std.zon unions" { |
| 1611 | 1609 | try std.testing.expectFmt( |
| 1612 | 1610 | \\input.zon:1:4: error: unexpected field 'z' |
| 1613 | 1611 | \\input.zon:1:4: note: supported: 'x', 'y' |
| 1614 | | \\ |
| 1615 | 1612 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1616 | 1613 | } |
| 1617 | 1614 | |
| ... | ... | @@ -1629,7 +1626,6 @@ test "std.zon unions" { |
| 1629 | 1626 | ); |
| 1630 | 1627 | try std.testing.expectFmt( |
| 1631 | 1628 | \\input.zon:1:6: error: expected type 'void' |
| 1632 | | \\ |
| 1633 | 1629 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1634 | 1630 | } |
| 1635 | 1631 | |
| ... | ... | @@ -1647,7 +1643,6 @@ test "std.zon unions" { |
| 1647 | 1643 | ); |
| 1648 | 1644 | try std.testing.expectFmt( |
| 1649 | 1645 | \\input.zon:1:2: error: expected union |
| 1650 | | \\ |
| 1651 | 1646 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1652 | 1647 | } |
| 1653 | 1648 | |
| ... | ... | @@ -1665,7 +1660,6 @@ test "std.zon unions" { |
| 1665 | 1660 | ); |
| 1666 | 1661 | try std.testing.expectFmt( |
| 1667 | 1662 | \\input.zon:1:2: error: expected union |
| 1668 | | \\ |
| 1669 | 1663 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1670 | 1664 | } |
| 1671 | 1665 | |
| ... | ... | @@ -1680,7 +1674,6 @@ test "std.zon unions" { |
| 1680 | 1674 | })); |
| 1681 | 1675 | try std.testing.expectFmt( |
| 1682 | 1676 | \\input.zon:1:2: error: expected union |
| 1683 | | \\ |
| 1684 | 1677 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1685 | 1678 | } |
| 1686 | 1679 | |
| ... | ... | @@ -1696,7 +1689,6 @@ test "std.zon unions" { |
| 1696 | 1689 | try std.testing.expectFmt( |
| 1697 | 1690 | \\input.zon:1:2: error: unexpected field 'y' |
| 1698 | 1691 | \\input.zon:1:2: note: supported: 'x' |
| 1699 | | \\ |
| 1700 | 1692 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1701 | 1693 | } |
| 1702 | 1694 | |
| ... | ... | @@ -1711,7 +1703,6 @@ test "std.zon unions" { |
| 1711 | 1703 | })); |
| 1712 | 1704 | try std.testing.expectFmt( |
| 1713 | 1705 | \\input.zon:1:2: error: expected union |
| 1714 | | \\ |
| 1715 | 1706 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1716 | 1707 | } |
| 1717 | 1708 | } |
| ... | ... | @@ -1791,7 +1782,6 @@ test "std.zon structs" { |
| 1791 | 1782 | try std.testing.expectFmt( |
| 1792 | 1783 | \\input.zon:1:12: error: unexpected field 'z' |
| 1793 | 1784 | \\input.zon:1:12: note: supported: 'x', 'y' |
| 1794 | | \\ |
| 1795 | 1785 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1796 | 1786 | } |
| 1797 | 1787 | |
| ... | ... | @@ -1810,7 +1800,6 @@ test "std.zon structs" { |
| 1810 | 1800 | try std.testing.expectFmt( |
| 1811 | 1801 | \\input.zon:1:4: error: duplicate struct field name |
| 1812 | 1802 | \\input.zon:1:12: note: duplicate name here |
| 1813 | | \\ |
| 1814 | 1803 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1815 | 1804 | } |
| 1816 | 1805 | |
| ... | ... | @@ -1842,7 +1831,6 @@ test "std.zon structs" { |
| 1842 | 1831 | try std.testing.expectFmt( |
| 1843 | 1832 | \\input.zon:1:4: error: unexpected field 'x' |
| 1844 | 1833 | \\input.zon:1:4: note: none expected |
| 1845 | | \\ |
| 1846 | 1834 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1847 | 1835 | } |
| 1848 | 1836 | |
| ... | ... | @@ -1860,7 +1848,6 @@ test "std.zon structs" { |
| 1860 | 1848 | ); |
| 1861 | 1849 | try std.testing.expectFmt( |
| 1862 | 1850 | \\input.zon:1:2: error: missing required field y |
| 1863 | | \\ |
| 1864 | 1851 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1865 | 1852 | } |
| 1866 | 1853 | |
| ... | ... | @@ -1900,7 +1887,6 @@ test "std.zon structs" { |
| 1900 | 1887 | try std.testing.expectError(error.ParseZon, parsed); |
| 1901 | 1888 | try std.testing.expectFmt( |
| 1902 | 1889 | \\input.zon:1:18: error: cannot initialize comptime field |
| 1903 | | \\ |
| 1904 | 1890 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1905 | 1891 | } |
| 1906 | 1892 | |
| ... | ... | @@ -1943,7 +1929,6 @@ test "std.zon structs" { |
| 1943 | 1929 | try std.testing.expectFmt( |
| 1944 | 1930 | \\input.zon:1:1: error: types are not available in ZON |
| 1945 | 1931 | \\input.zon:1:1: note: replace the type with '.' |
| 1946 | | \\ |
| 1947 | 1932 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1948 | 1933 | } |
| 1949 | 1934 | |
| ... | ... | @@ -1959,7 +1944,6 @@ test "std.zon structs" { |
| 1959 | 1944 | try std.testing.expectFmt( |
| 1960 | 1945 | \\input.zon:1:1: error: types are not available in ZON |
| 1961 | 1946 | \\input.zon:1:1: note: replace the type with '.' |
| 1962 | | \\ |
| 1963 | 1947 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1964 | 1948 | } |
| 1965 | 1949 | |
| ... | ... | @@ -1975,7 +1959,6 @@ test "std.zon structs" { |
| 1975 | 1959 | try std.testing.expectFmt( |
| 1976 | 1960 | \\input.zon:1:1: error: types are not available in ZON |
| 1977 | 1961 | \\input.zon:1:1: note: replace the type with '.' |
| 1978 | | \\ |
| 1979 | 1962 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1980 | 1963 | } |
| 1981 | 1964 | |
| ... | ... | @@ -1991,7 +1974,6 @@ test "std.zon structs" { |
| 1991 | 1974 | try std.testing.expectFmt( |
| 1992 | 1975 | \\input.zon:1:1: error: types are not available in ZON |
| 1993 | 1976 | \\input.zon:1:1: note: replace the type with '.' |
| 1994 | | \\ |
| 1995 | 1977 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 1996 | 1978 | } |
| 1997 | 1979 | |
| ... | ... | @@ -2007,7 +1989,6 @@ test "std.zon structs" { |
| 2007 | 1989 | try std.testing.expectFmt( |
| 2008 | 1990 | \\input.zon:1:9: error: types are not available in ZON |
| 2009 | 1991 | \\input.zon:1:9: note: replace the type with '.' |
| 2010 | | \\ |
| 2011 | 1992 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2012 | 1993 | } |
| 2013 | 1994 | } |
| ... | ... | @@ -2086,7 +2067,6 @@ test "std.zon tuples" { |
| 2086 | 2067 | ); |
| 2087 | 2068 | try std.testing.expectFmt( |
| 2088 | 2069 | \\input.zon:1:14: error: index 2 outside of tuple length 2 |
| 2089 | | \\ |
| 2090 | 2070 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2091 | 2071 | } |
| 2092 | 2072 | |
| ... | ... | @@ -2104,7 +2084,6 @@ test "std.zon tuples" { |
| 2104 | 2084 | ); |
| 2105 | 2085 | try std.testing.expectFmt( |
| 2106 | 2086 | \\input.zon:1:2: error: missing tuple field with index 1 |
| 2107 | | \\ |
| 2108 | 2087 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2109 | 2088 | } |
| 2110 | 2089 | |
| ... | ... | @@ -2122,7 +2101,6 @@ test "std.zon tuples" { |
| 2122 | 2101 | ); |
| 2123 | 2102 | try std.testing.expectFmt( |
| 2124 | 2103 | \\input.zon:1:2: error: expected tuple |
| 2125 | | \\ |
| 2126 | 2104 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2127 | 2105 | } |
| 2128 | 2106 | |
| ... | ... | @@ -2140,7 +2118,6 @@ test "std.zon tuples" { |
| 2140 | 2118 | ); |
| 2141 | 2119 | try std.testing.expectFmt( |
| 2142 | 2120 | \\input.zon:1:2: error: expected struct |
| 2143 | | \\ |
| 2144 | 2121 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2145 | 2122 | } |
| 2146 | 2123 | |
| ... | ... | @@ -2168,7 +2145,6 @@ test "std.zon tuples" { |
| 2168 | 2145 | try std.testing.expectError(error.ParseZon, parsed); |
| 2169 | 2146 | try std.testing.expectFmt( |
| 2170 | 2147 | \\input.zon:1:9: error: cannot initialize comptime field |
| 2171 | | \\ |
| 2172 | 2148 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2173 | 2149 | } |
| 2174 | 2150 | } |
| ... | ... | @@ -2357,7 +2333,6 @@ test "std.zon arrays and slices" { |
| 2357 | 2333 | ); |
| 2358 | 2334 | try std.testing.expectFmt( |
| 2359 | 2335 | \\input.zon:1:3: error: index 0 outside of array of length 0 |
| 2360 | | \\ |
| 2361 | 2336 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2362 | 2337 | } |
| 2363 | 2338 | |
| ... | ... | @@ -2374,7 +2349,6 @@ test "std.zon arrays and slices" { |
| 2374 | 2349 | ); |
| 2375 | 2350 | try std.testing.expectFmt( |
| 2376 | 2351 | \\input.zon:1:8: error: index 1 outside of array of length 1 |
| 2377 | | \\ |
| 2378 | 2352 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2379 | 2353 | } |
| 2380 | 2354 | |
| ... | ... | @@ -2391,7 +2365,6 @@ test "std.zon arrays and slices" { |
| 2391 | 2365 | ); |
| 2392 | 2366 | try std.testing.expectFmt( |
| 2393 | 2367 | \\input.zon:1:2: error: expected 2 array elements; found 1 |
| 2394 | | \\ |
| 2395 | 2368 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2396 | 2369 | } |
| 2397 | 2370 | |
| ... | ... | @@ -2408,7 +2381,6 @@ test "std.zon arrays and slices" { |
| 2408 | 2381 | ); |
| 2409 | 2382 | try std.testing.expectFmt( |
| 2410 | 2383 | \\input.zon:1:2: error: expected 3 array elements; found 0 |
| 2411 | | \\ |
| 2412 | 2384 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2413 | 2385 | } |
| 2414 | 2386 | |
| ... | ... | @@ -2427,7 +2399,6 @@ test "std.zon arrays and slices" { |
| 2427 | 2399 | ); |
| 2428 | 2400 | try std.testing.expectFmt( |
| 2429 | 2401 | \\input.zon:1:3: error: expected type 'bool' |
| 2430 | | \\ |
| 2431 | 2402 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2432 | 2403 | } |
| 2433 | 2404 | |
| ... | ... | @@ -2444,7 +2415,6 @@ test "std.zon arrays and slices" { |
| 2444 | 2415 | ); |
| 2445 | 2416 | try std.testing.expectFmt( |
| 2446 | 2417 | \\input.zon:1:3: error: expected type 'bool' |
| 2447 | | \\ |
| 2448 | 2418 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2449 | 2419 | } |
| 2450 | 2420 | } |
| ... | ... | @@ -2464,7 +2434,6 @@ test "std.zon arrays and slices" { |
| 2464 | 2434 | ); |
| 2465 | 2435 | try std.testing.expectFmt( |
| 2466 | 2436 | \\input.zon:1:1: error: expected array |
| 2467 | | \\ |
| 2468 | 2437 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2469 | 2438 | } |
| 2470 | 2439 | |
| ... | ... | @@ -2476,7 +2445,6 @@ test "std.zon arrays and slices" { |
| 2476 | 2445 | ); |
| 2477 | 2446 | try std.testing.expectFmt( |
| 2478 | 2447 | \\input.zon:1:1: error: expected array |
| 2479 | | \\ |
| 2480 | 2448 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2481 | 2449 | } |
| 2482 | 2450 | } |
| ... | ... | @@ -2489,7 +2457,6 @@ test "std.zon arrays and slices" { |
| 2489 | 2457 | ); |
| 2490 | 2458 | try std.testing.expectFmt( |
| 2491 | 2459 | \\input.zon:1:3: error: pointers are not available in ZON |
| 2492 | | \\ |
| 2493 | 2460 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2494 | 2461 | } |
| 2495 | 2462 | } |
| ... | ... | @@ -2543,7 +2510,6 @@ test "std.zon string literal" { |
| 2543 | 2510 | ); |
| 2544 | 2511 | try std.testing.expectFmt( |
| 2545 | 2512 | \\input.zon:1:1: error: expected array |
| 2546 | | \\ |
| 2547 | 2513 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2548 | 2514 | } |
| 2549 | 2515 | |
| ... | ... | @@ -2554,7 +2520,6 @@ test "std.zon string literal" { |
| 2554 | 2520 | ); |
| 2555 | 2521 | try std.testing.expectFmt( |
| 2556 | 2522 | \\input.zon:1:1: error: expected array |
| 2557 | | \\ |
| 2558 | 2523 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2559 | 2524 | } |
| 2560 | 2525 | } |
| ... | ... | @@ -2577,7 +2542,6 @@ test "std.zon string literal" { |
| 2577 | 2542 | ); |
| 2578 | 2543 | try std.testing.expectFmt( |
| 2579 | 2544 | \\input.zon:1:1: error: expected array |
| 2580 | | \\ |
| 2581 | 2545 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2582 | 2546 | } |
| 2583 | 2547 | |
| ... | ... | @@ -2593,7 +2557,6 @@ test "std.zon string literal" { |
| 2593 | 2557 | ); |
| 2594 | 2558 | try std.testing.expectFmt( |
| 2595 | 2559 | \\input.zon:1:1: error: expected array |
| 2596 | | \\ |
| 2597 | 2560 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2598 | 2561 | } |
| 2599 | 2562 | } |
| ... | ... | @@ -2632,7 +2595,6 @@ test "std.zon string literal" { |
| 2632 | 2595 | ); |
| 2633 | 2596 | try std.testing.expectFmt( |
| 2634 | 2597 | \\input.zon:1:1: error: expected array |
| 2635 | | \\ |
| 2636 | 2598 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2637 | 2599 | } |
| 2638 | 2600 | |
| ... | ... | @@ -2643,7 +2605,6 @@ test "std.zon string literal" { |
| 2643 | 2605 | ); |
| 2644 | 2606 | try std.testing.expectFmt( |
| 2645 | 2607 | \\input.zon:1:1: error: expected array |
| 2646 | | \\ |
| 2647 | 2608 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2648 | 2609 | } |
| 2649 | 2610 | } |
| ... | ... | @@ -2656,7 +2617,6 @@ test "std.zon string literal" { |
| 2656 | 2617 | ); |
| 2657 | 2618 | try std.testing.expectFmt( |
| 2658 | 2619 | \\input.zon:1:1: error: expected string |
| 2659 | | \\ |
| 2660 | 2620 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2661 | 2621 | } |
| 2662 | 2622 | |
| ... | ... | @@ -2668,7 +2628,6 @@ test "std.zon string literal" { |
| 2668 | 2628 | ); |
| 2669 | 2629 | try std.testing.expectFmt( |
| 2670 | 2630 | \\input.zon:1:3: error: expected type 'u8' |
| 2671 | | \\ |
| 2672 | 2631 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2673 | 2632 | } |
| 2674 | 2633 | |
| ... | ... | @@ -2680,7 +2639,6 @@ test "std.zon string literal" { |
| 2680 | 2639 | ); |
| 2681 | 2640 | try std.testing.expectFmt( |
| 2682 | 2641 | \\input.zon:1:3: error: invalid escape character: 'a' |
| 2683 | | \\ |
| 2684 | 2642 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2685 | 2643 | } |
| 2686 | 2644 | |
| ... | ... | @@ -2693,7 +2651,6 @@ test "std.zon string literal" { |
| 2693 | 2651 | ); |
| 2694 | 2652 | try std.testing.expectFmt( |
| 2695 | 2653 | \\input.zon:1:1: error: expected array |
| 2696 | | \\ |
| 2697 | 2654 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2698 | 2655 | } |
| 2699 | 2656 | |
| ... | ... | @@ -2704,7 +2661,6 @@ test "std.zon string literal" { |
| 2704 | 2661 | ); |
| 2705 | 2662 | try std.testing.expectFmt( |
| 2706 | 2663 | \\input.zon:1:1: error: expected array |
| 2707 | | \\ |
| 2708 | 2664 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2709 | 2665 | } |
| 2710 | 2666 | } |
| ... | ... | @@ -2723,7 +2679,6 @@ test "std.zon string literal" { |
| 2723 | 2679 | ); |
| 2724 | 2680 | try std.testing.expectFmt( |
| 2725 | 2681 | \\input.zon:1:1: error: expected array |
| 2726 | | \\ |
| 2727 | 2682 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2728 | 2683 | } |
| 2729 | 2684 | |
| ... | ... | @@ -2739,7 +2694,6 @@ test "std.zon string literal" { |
| 2739 | 2694 | ); |
| 2740 | 2695 | try std.testing.expectFmt( |
| 2741 | 2696 | \\input.zon:1:1: error: expected array |
| 2742 | | \\ |
| 2743 | 2697 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2744 | 2698 | } |
| 2745 | 2699 | } |
| ... | ... | @@ -2843,7 +2797,6 @@ test "std.zon enum literals" { |
| 2843 | 2797 | try std.testing.expectFmt( |
| 2844 | 2798 | \\input.zon:1:2: error: unexpected enum literal 'qux' |
| 2845 | 2799 | \\input.zon:1:2: note: supported: 'foo', 'bar', 'baz', '@"ab\nc"' |
| 2846 | | \\ |
| 2847 | 2800 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2848 | 2801 | } |
| 2849 | 2802 | |
| ... | ... | @@ -2861,7 +2814,6 @@ test "std.zon enum literals" { |
| 2861 | 2814 | try std.testing.expectFmt( |
| 2862 | 2815 | \\input.zon:1:2: error: unexpected enum literal 'foobarbaz' |
| 2863 | 2816 | \\input.zon:1:2: note: supported: 'foo', 'bar', 'baz', '@"ab\nc"' |
| 2864 | | \\ |
| 2865 | 2817 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2866 | 2818 | } |
| 2867 | 2819 | |
| ... | ... | @@ -2878,7 +2830,6 @@ test "std.zon enum literals" { |
| 2878 | 2830 | ); |
| 2879 | 2831 | try std.testing.expectFmt( |
| 2880 | 2832 | \\input.zon:1:1: error: expected enum literal |
| 2881 | | \\ |
| 2882 | 2833 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2883 | 2834 | } |
| 2884 | 2835 | |
| ... | ... | @@ -2895,7 +2846,6 @@ test "std.zon enum literals" { |
| 2895 | 2846 | ); |
| 2896 | 2847 | try std.testing.expectFmt( |
| 2897 | 2848 | \\input.zon:1:2: error: identifier cannot contain null bytes |
| 2898 | | \\ |
| 2899 | 2849 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2900 | 2850 | } |
| 2901 | 2851 | } |
| ... | ... | @@ -2936,7 +2886,6 @@ test "std.zon parse bool" { |
| 2936 | 2886 | \\input.zon:1:2: error: invalid expression |
| 2937 | 2887 | \\input.zon:1:2: note: ZON allows identifiers 'true', 'false', 'null', 'inf', and 'nan' |
| 2938 | 2888 | \\input.zon:1:2: note: precede identifier with '.' for an enum literal |
| 2939 | | \\ |
| 2940 | 2889 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2941 | 2890 | } |
| 2942 | 2891 | { |
| ... | ... | @@ -2948,7 +2897,6 @@ test "std.zon parse bool" { |
| 2948 | 2897 | })); |
| 2949 | 2898 | try std.testing.expectFmt( |
| 2950 | 2899 | \\input.zon:1:1: error: expected type 'bool' |
| 2951 | | \\ |
| 2952 | 2900 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 2953 | 2901 | } |
| 2954 | 2902 | } |
| ... | ... | @@ -3093,7 +3041,6 @@ test "std.zon parse int" { |
| 3093 | 3041 | })); |
| 3094 | 3042 | try std.testing.expectFmt( |
| 3095 | 3043 | \\input.zon:1:1: error: type 'i66' cannot represent value |
| 3096 | | \\ |
| 3097 | 3044 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3098 | 3045 | } |
| 3099 | 3046 | { |
| ... | ... | @@ -3105,7 +3052,6 @@ test "std.zon parse int" { |
| 3105 | 3052 | })); |
| 3106 | 3053 | try std.testing.expectFmt( |
| 3107 | 3054 | \\input.zon:1:1: error: type 'i66' cannot represent value |
| 3108 | | \\ |
| 3109 | 3055 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3110 | 3056 | } |
| 3111 | 3057 | |
| ... | ... | @@ -3227,7 +3173,6 @@ test "std.zon parse int" { |
| 3227 | 3173 | })); |
| 3228 | 3174 | try std.testing.expectFmt( |
| 3229 | 3175 | \\input.zon:1:3: error: invalid digit 'a' for decimal base |
| 3230 | | \\ |
| 3231 | 3176 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3232 | 3177 | } |
| 3233 | 3178 | |
| ... | ... | @@ -3241,7 +3186,6 @@ test "std.zon parse int" { |
| 3241 | 3186 | })); |
| 3242 | 3187 | try std.testing.expectFmt( |
| 3243 | 3188 | \\input.zon:1:1: error: expected type 'u8' |
| 3244 | | \\ |
| 3245 | 3189 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3246 | 3190 | } |
| 3247 | 3191 | |
| ... | ... | @@ -3255,7 +3199,6 @@ test "std.zon parse int" { |
| 3255 | 3199 | })); |
| 3256 | 3200 | try std.testing.expectFmt( |
| 3257 | 3201 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3258 | | \\ |
| 3259 | 3202 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3260 | 3203 | } |
| 3261 | 3204 | |
| ... | ... | @@ -3269,7 +3212,6 @@ test "std.zon parse int" { |
| 3269 | 3212 | })); |
| 3270 | 3213 | try std.testing.expectFmt( |
| 3271 | 3214 | \\input.zon:1:1: error: type 'i8' cannot represent value |
| 3272 | | \\ |
| 3273 | 3215 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3274 | 3216 | } |
| 3275 | 3217 | |
| ... | ... | @@ -3283,7 +3225,6 @@ test "std.zon parse int" { |
| 3283 | 3225 | })); |
| 3284 | 3226 | try std.testing.expectFmt( |
| 3285 | 3227 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3286 | | \\ |
| 3287 | 3228 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3288 | 3229 | } |
| 3289 | 3230 | |
| ... | ... | @@ -3297,7 +3238,6 @@ test "std.zon parse int" { |
| 3297 | 3238 | })); |
| 3298 | 3239 | try std.testing.expectFmt( |
| 3299 | 3240 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3300 | | \\ |
| 3301 | 3241 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3302 | 3242 | } |
| 3303 | 3243 | |
| ... | ... | @@ -3311,7 +3251,6 @@ test "std.zon parse int" { |
| 3311 | 3251 | })); |
| 3312 | 3252 | try std.testing.expectFmt( |
| 3313 | 3253 | \\input.zon:1:1: error: type 'u8' cannot represent value |
| 3314 | | \\ |
| 3315 | 3254 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3316 | 3255 | } |
| 3317 | 3256 | |
| ... | ... | @@ -3327,7 +3266,6 @@ test "std.zon parse int" { |
| 3327 | 3266 | \\input.zon:1:2: error: integer literal '-0' is ambiguous |
| 3328 | 3267 | \\input.zon:1:2: note: use '0' for an integer zero |
| 3329 | 3268 | \\input.zon:1:2: note: use '-0.0' for a floating-point signed zero |
| 3330 | | \\ |
| 3331 | 3269 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3332 | 3270 | } |
| 3333 | 3271 | |
| ... | ... | @@ -3343,7 +3281,6 @@ test "std.zon parse int" { |
| 3343 | 3281 | \\input.zon:1:2: error: integer literal '-0' is ambiguous |
| 3344 | 3282 | \\input.zon:1:2: note: use '0' for an integer zero |
| 3345 | 3283 | \\input.zon:1:2: note: use '-0.0' for a floating-point signed zero |
| 3346 | | \\ |
| 3347 | 3284 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3348 | 3285 | } |
| 3349 | 3286 | |
| ... | ... | @@ -3373,7 +3310,6 @@ test "std.zon parse int" { |
| 3373 | 3310 | })); |
| 3374 | 3311 | try std.testing.expectFmt( |
| 3375 | 3312 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3376 | | \\ |
| 3377 | 3313 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3378 | 3314 | } |
| 3379 | 3315 | |
| ... | ... | @@ -3389,7 +3325,6 @@ test "std.zon parse int" { |
| 3389 | 3325 | ); |
| 3390 | 3326 | try std.testing.expectFmt( |
| 3391 | 3327 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3392 | | \\ |
| 3393 | 3328 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3394 | 3329 | } |
| 3395 | 3330 | |
| ... | ... | @@ -3403,7 +3338,6 @@ test "std.zon parse int" { |
| 3403 | 3338 | })); |
| 3404 | 3339 | try std.testing.expectFmt( |
| 3405 | 3340 | \\input.zon:1:3: error: invalid digit 'g' for hex base |
| 3406 | | \\ |
| 3407 | 3341 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3408 | 3342 | } |
| 3409 | 3343 | |
| ... | ... | @@ -3418,7 +3352,6 @@ test "std.zon parse int" { |
| 3418 | 3352 | try std.testing.expectFmt( |
| 3419 | 3353 | \\input.zon:1:1: error: number '0123' has leading zero |
| 3420 | 3354 | \\input.zon:1:1: note: use '0o' prefix for octal literals |
| 3421 | | \\ |
| 3422 | 3355 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3423 | 3356 | } |
| 3424 | 3357 | } |
| ... | ... | @@ -3439,7 +3372,6 @@ test "std.zon negative char" { |
| 3439 | 3372 | })); |
| 3440 | 3373 | try std.testing.expectFmt( |
| 3441 | 3374 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3442 | | \\ |
| 3443 | 3375 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3444 | 3376 | } |
| 3445 | 3377 | { |
| ... | ... | @@ -3451,7 +3383,6 @@ test "std.zon negative char" { |
| 3451 | 3383 | })); |
| 3452 | 3384 | try std.testing.expectFmt( |
| 3453 | 3385 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3454 | | \\ |
| 3455 | 3386 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3456 | 3387 | } |
| 3457 | 3388 | } |
| ... | ... | @@ -3639,7 +3570,6 @@ test "std.zon parse float" { |
| 3639 | 3570 | })); |
| 3640 | 3571 | try std.testing.expectFmt( |
| 3641 | 3572 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3642 | | \\ |
| 3643 | 3573 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3644 | 3574 | } |
| 3645 | 3575 | |
| ... | ... | @@ -3653,7 +3583,6 @@ test "std.zon parse float" { |
| 3653 | 3583 | })); |
| 3654 | 3584 | try std.testing.expectFmt( |
| 3655 | 3585 | \\input.zon:1:1: error: expected type 'i8' |
| 3656 | | \\ |
| 3657 | 3586 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3658 | 3587 | } |
| 3659 | 3588 | |
| ... | ... | @@ -3667,7 +3596,6 @@ test "std.zon parse float" { |
| 3667 | 3596 | })); |
| 3668 | 3597 | try std.testing.expectFmt( |
| 3669 | 3598 | \\input.zon:1:1: error: expected type 'i8' |
| 3670 | | \\ |
| 3671 | 3599 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3672 | 3600 | } |
| 3673 | 3601 | |
| ... | ... | @@ -3681,7 +3609,6 @@ test "std.zon parse float" { |
| 3681 | 3609 | })); |
| 3682 | 3610 | try std.testing.expectFmt( |
| 3683 | 3611 | \\input.zon:1:1: error: expected type 'i8' |
| 3684 | | \\ |
| 3685 | 3612 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3686 | 3613 | } |
| 3687 | 3614 | |
| ... | ... | @@ -3695,7 +3622,6 @@ test "std.zon parse float" { |
| 3695 | 3622 | })); |
| 3696 | 3623 | try std.testing.expectFmt( |
| 3697 | 3624 | \\input.zon:1:1: error: expected type 'i8' |
| 3698 | | \\ |
| 3699 | 3625 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3700 | 3626 | } |
| 3701 | 3627 | |
| ... | ... | @@ -3711,7 +3637,6 @@ test "std.zon parse float" { |
| 3711 | 3637 | \\input.zon:1:1: error: invalid expression |
| 3712 | 3638 | \\input.zon:1:1: note: ZON allows identifiers 'true', 'false', 'null', 'inf', and 'nan' |
| 3713 | 3639 | \\input.zon:1:1: note: precede identifier with '.' for an enum literal |
| 3714 | | \\ |
| 3715 | 3640 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3716 | 3641 | } |
| 3717 | 3642 | |
| ... | ... | @@ -3724,7 +3649,6 @@ test "std.zon parse float" { |
| 3724 | 3649 | })); |
| 3725 | 3650 | try std.testing.expectFmt( |
| 3726 | 3651 | \\input.zon:1:1: error: expected number or 'inf' after '-' |
| 3727 | | \\ |
| 3728 | 3652 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3729 | 3653 | } |
| 3730 | 3654 | |
| ... | ... | @@ -3741,7 +3665,6 @@ test "std.zon parse float" { |
| 3741 | 3665 | ); |
| 3742 | 3666 | try std.testing.expectFmt( |
| 3743 | 3667 | \\input.zon:1:1: error: expected type 'f32' |
| 3744 | | \\ |
| 3745 | 3668 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3746 | 3669 | } |
| 3747 | 3670 | } |
| ... | ... | @@ -3983,7 +3906,6 @@ test "std.zon vector" { |
| 3983 | 3906 | ); |
| 3984 | 3907 | try std.testing.expectFmt( |
| 3985 | 3908 | \\input.zon:1:2: error: expected 2 array elements; found 1 |
| 3986 | | \\ |
| 3987 | 3909 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 3988 | 3910 | } |
| 3989 | 3911 | |
| ... | ... | @@ -4000,7 +3922,6 @@ test "std.zon vector" { |
| 4000 | 3922 | ); |
| 4001 | 3923 | try std.testing.expectFmt( |
| 4002 | 3924 | \\input.zon:1:13: error: index 2 outside of array of length 2 |
| 4003 | | \\ |
| 4004 | 3925 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4005 | 3926 | } |
| 4006 | 3927 | |
| ... | ... | @@ -4017,7 +3938,6 @@ test "std.zon vector" { |
| 4017 | 3938 | ); |
| 4018 | 3939 | try std.testing.expectFmt( |
| 4019 | 3940 | \\input.zon:1:8: error: expected type 'f32' |
| 4020 | | \\ |
| 4021 | 3941 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4022 | 3942 | } |
| 4023 | 3943 | |
| ... | ... | @@ -4034,7 +3954,6 @@ test "std.zon vector" { |
| 4034 | 3954 | ); |
| 4035 | 3955 | try std.testing.expectFmt( |
| 4036 | 3956 | \\input.zon:1:1: error: expected type '@Vector(3, u8)' |
| 4037 | | \\ |
| 4038 | 3957 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4039 | 3958 | } |
| 4040 | 3959 | |
| ... | ... | @@ -4051,7 +3970,6 @@ test "std.zon vector" { |
| 4051 | 3970 | ); |
| 4052 | 3971 | try std.testing.expectFmt( |
| 4053 | 3972 | \\input.zon:1:6: error: expected type 'u8' |
| 4054 | | \\ |
| 4055 | 3973 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4056 | 3974 | } |
| 4057 | 3975 | } |
| ... | ... | @@ -4245,7 +4163,6 @@ test "std.zon add pointers" { |
| 4245 | 4163 | ); |
| 4246 | 4164 | try std.testing.expectFmt( |
| 4247 | 4165 | \\input.zon:1:1: error: expected type '?u8' |
| 4248 | | \\ |
| 4249 | 4166 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4250 | 4167 | } |
| 4251 | 4168 | |
| ... | ... | @@ -4261,7 +4178,6 @@ test "std.zon add pointers" { |
| 4261 | 4178 | ); |
| 4262 | 4179 | try std.testing.expectFmt( |
| 4263 | 4180 | \\input.zon:1:1: error: expected type '?f32' |
| 4264 | | \\ |
| 4265 | 4181 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4266 | 4182 | } |
| 4267 | 4183 | |
| ... | ... | @@ -4277,7 +4193,6 @@ test "std.zon add pointers" { |
| 4277 | 4193 | ); |
| 4278 | 4194 | try std.testing.expectFmt( |
| 4279 | 4195 | \\input.zon:1:1: error: expected type '?@Vector(3, u8)' |
| 4280 | | \\ |
| 4281 | 4196 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4282 | 4197 | } |
| 4283 | 4198 | |
| ... | ... | @@ -4293,7 +4208,6 @@ test "std.zon add pointers" { |
| 4293 | 4208 | ); |
| 4294 | 4209 | try std.testing.expectFmt( |
| 4295 | 4210 | \\input.zon:1:1: error: expected type '?bool' |
| 4296 | | \\ |
| 4297 | 4211 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4298 | 4212 | } |
| 4299 | 4213 | |
| ... | ... | @@ -4309,7 +4223,6 @@ test "std.zon add pointers" { |
| 4309 | 4223 | ); |
| 4310 | 4224 | try std.testing.expectFmt( |
| 4311 | 4225 | \\input.zon:1:1: error: expected optional struct |
| 4312 | | \\ |
| 4313 | 4226 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4314 | 4227 | } |
| 4315 | 4228 | |
| ... | ... | @@ -4325,7 +4238,6 @@ test "std.zon add pointers" { |
| 4325 | 4238 | ); |
| 4326 | 4239 | try std.testing.expectFmt( |
| 4327 | 4240 | \\input.zon:1:1: error: expected optional tuple |
| 4328 | | \\ |
| 4329 | 4241 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4330 | 4242 | } |
| 4331 | 4243 | |
| ... | ... | @@ -4341,7 +4253,6 @@ test "std.zon add pointers" { |
| 4341 | 4253 | ); |
| 4342 | 4254 | try std.testing.expectFmt( |
| 4343 | 4255 | \\input.zon:1:1: error: expected optional union |
| 4344 | | \\ |
| 4345 | 4256 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4346 | 4257 | } |
| 4347 | 4258 | |
| ... | ... | @@ -4357,7 +4268,6 @@ test "std.zon add pointers" { |
| 4357 | 4268 | ); |
| 4358 | 4269 | try std.testing.expectFmt( |
| 4359 | 4270 | \\input.zon:1:1: error: expected optional array |
| 4360 | | \\ |
| 4361 | 4271 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4362 | 4272 | } |
| 4363 | 4273 | |
| ... | ... | @@ -4373,7 +4283,6 @@ test "std.zon add pointers" { |
| 4373 | 4283 | ); |
| 4374 | 4284 | try std.testing.expectFmt( |
| 4375 | 4285 | \\input.zon:1:1: error: expected optional array |
| 4376 | | \\ |
| 4377 | 4286 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4378 | 4287 | } |
| 4379 | 4288 | |
| ... | ... | @@ -4389,7 +4298,6 @@ test "std.zon add pointers" { |
| 4389 | 4298 | ); |
| 4390 | 4299 | try std.testing.expectFmt( |
| 4391 | 4300 | \\input.zon:1:1: error: expected optional array |
| 4392 | | \\ |
| 4393 | 4301 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4394 | 4302 | } |
| 4395 | 4303 | |
| ... | ... | @@ -4405,7 +4313,6 @@ test "std.zon add pointers" { |
| 4405 | 4313 | ); |
| 4406 | 4314 | try std.testing.expectFmt( |
| 4407 | 4315 | \\input.zon:1:1: error: expected optional array |
| 4408 | | \\ |
| 4409 | 4316 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4410 | 4317 | } |
| 4411 | 4318 | |
| ... | ... | @@ -4421,7 +4328,6 @@ test "std.zon add pointers" { |
| 4421 | 4328 | ); |
| 4422 | 4329 | try std.testing.expectFmt( |
| 4423 | 4330 | \\input.zon:1:1: error: expected optional string |
| 4424 | | \\ |
| 4425 | 4331 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4426 | 4332 | } |
| 4427 | 4333 | |
| ... | ... | @@ -4437,7 +4343,6 @@ test "std.zon add pointers" { |
| 4437 | 4343 | ); |
| 4438 | 4344 | try std.testing.expectFmt( |
| 4439 | 4345 | \\input.zon:1:1: error: expected optional enum literal |
| 4440 | | \\ |
| 4441 | 4346 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4442 | 4347 | } |
| 4443 | 4348 | } |
| ... | ... | @@ -4698,7 +4603,6 @@ test "std.zon update optionals" { |
| 4698 | 4603 | })); |
| 4699 | 4604 | try std.testing.expectFmt( |
| 4700 | 4605 | \\input.zon:1:12: error: missing required field qux |
| 4701 | | \\ |
| 4702 | 4606 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4703 | 4607 | } |
| 4704 | 4608 | |
| ... | ... | @@ -4826,7 +4730,6 @@ test "std.zon update unions" { |
| 4826 | 4730 | })); |
| 4827 | 4731 | try std.testing.expectFmt( |
| 4828 | 4732 | \\input.zon:1:12: error: missing required field qux |
| 4829 | | \\ |
| 4830 | 4733 | , "{f}", .{diagnostics.fmt("input.zon")}); |
| 4831 | 4734 | } |
| 4832 | 4735 | |