| ... | ... | @@ -78,7 +78,7 @@ fn peekIsAlign(comptime fmt: []const u8) bool { |
| 78 | 78 | pub fn format( |
| 79 | 79 | context: var, |
| 80 | 80 | comptime Errors: type, |
| 81 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 81 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 82 | 82 | comptime fmt: []const u8, |
| 83 | 83 | args: var, |
| 84 | 84 | ) Errors!void { |
| ... | ... | @@ -326,7 +326,7 @@ pub fn formatType( |
| 326 | 326 | options: FormatOptions, |
| 327 | 327 | context: var, |
| 328 | 328 | comptime Errors: type, |
| 329 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 329 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 330 | 330 | max_depth: usize, |
| 331 | 331 | ) Errors!void { |
| 332 | 332 | if (comptime std.mem.eql(u8, fmt, "*")) { |
| ... | ... | @@ -488,7 +488,7 @@ fn formatValue( |
| 488 | 488 | options: FormatOptions, |
| 489 | 489 | context: var, |
| 490 | 490 | comptime Errors: type, |
| 491 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 491 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 492 | 492 | ) Errors!void { |
| 493 | 493 | if (comptime std.mem.eql(u8, fmt, "B")) { |
| 494 | 494 | return formatBytes(value, options, 1000, context, Errors, output); |
| ... | ... | @@ -510,7 +510,7 @@ pub fn formatIntValue( |
| 510 | 510 | options: FormatOptions, |
| 511 | 511 | context: var, |
| 512 | 512 | comptime Errors: type, |
| 513 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 513 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 514 | 514 | ) Errors!void { |
| 515 | 515 | comptime var radix = 10; |
| 516 | 516 | comptime var uppercase = false; |
| ... | ... | @@ -552,7 +552,7 @@ fn formatFloatValue( |
| 552 | 552 | options: FormatOptions, |
| 553 | 553 | context: var, |
| 554 | 554 | comptime Errors: type, |
| 555 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 555 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 556 | 556 | ) Errors!void { |
| 557 | 557 | if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) { |
| 558 | 558 | return formatFloatScientific(value, options, context, Errors, output); |
| ... | ... | @@ -569,7 +569,7 @@ pub fn formatText( |
| 569 | 569 | options: FormatOptions, |
| 570 | 570 | context: var, |
| 571 | 571 | comptime Errors: type, |
| 572 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 572 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 573 | 573 | ) Errors!void { |
| 574 | 574 | if (fmt.len == 0) { |
| 575 | 575 | return output(context, bytes); |
| ... | ... | @@ -590,7 +590,7 @@ pub fn formatAsciiChar( |
| 590 | 590 | options: FormatOptions, |
| 591 | 591 | context: var, |
| 592 | 592 | comptime Errors: type, |
| 593 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 593 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 594 | 594 | ) Errors!void { |
| 595 | 595 | return output(context, @as(*const [1]u8, &c)[0..]); |
| 596 | 596 | } |
| ... | ... | @@ -600,7 +600,7 @@ pub fn formatBuf( |
| 600 | 600 | options: FormatOptions, |
| 601 | 601 | context: var, |
| 602 | 602 | comptime Errors: type, |
| 603 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 603 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 604 | 604 | ) Errors!void { |
| 605 | 605 | try output(context, buf); |
| 606 | 606 | |
| ... | ... | @@ -620,7 +620,7 @@ pub fn formatFloatScientific( |
| 620 | 620 | options: FormatOptions, |
| 621 | 621 | context: var, |
| 622 | 622 | comptime Errors: type, |
| 623 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 623 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 624 | 624 | ) Errors!void { |
| 625 | 625 | var x = @floatCast(f64, value); |
| 626 | 626 | |
| ... | ... | @@ -715,7 +715,7 @@ pub fn formatFloatDecimal( |
| 715 | 715 | options: FormatOptions, |
| 716 | 716 | context: var, |
| 717 | 717 | comptime Errors: type, |
| 718 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 718 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 719 | 719 | ) Errors!void { |
| 720 | 720 | var x = @as(f64, value); |
| 721 | 721 | |
| ... | ... | @@ -861,7 +861,7 @@ pub fn formatBytes( |
| 861 | 861 | comptime radix: usize, |
| 862 | 862 | context: var, |
| 863 | 863 | comptime Errors: type, |
| 864 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 864 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 865 | 865 | ) Errors!void { |
| 866 | 866 | if (value == 0) { |
| 867 | 867 | return output(context, "0B"); |
| ... | ... | @@ -902,7 +902,7 @@ pub fn formatInt( |
| 902 | 902 | options: FormatOptions, |
| 903 | 903 | context: var, |
| 904 | 904 | comptime Errors: type, |
| 905 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 905 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 906 | 906 | ) Errors!void { |
| 907 | 907 | const int_value = if (@TypeOf(value) == comptime_int) blk: { |
| 908 | 908 | const Int = math.IntFittingRange(value, value); |
| ... | ... | @@ -924,7 +924,7 @@ fn formatIntSigned( |
| 924 | 924 | options: FormatOptions, |
| 925 | 925 | context: var, |
| 926 | 926 | comptime Errors: type, |
| 927 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 927 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 928 | 928 | ) Errors!void { |
| 929 | 929 | const new_options = FormatOptions{ |
| 930 | 930 | .width = if (options.width) |w| (if (w == 0) 0 else w - 1) else null, |
| ... | ... | @@ -955,7 +955,7 @@ fn formatIntUnsigned( |
| 955 | 955 | options: FormatOptions, |
| 956 | 956 | context: var, |
| 957 | 957 | comptime Errors: type, |
| 958 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 958 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 959 | 959 | ) Errors!void { |
| 960 | 960 | assert(base >= 2); |
| 961 | 961 | var buf: [math.max(@TypeOf(value).bit_count, 1)]u8 = undefined; |
| ... | ... | @@ -1419,7 +1419,7 @@ test "custom" { |
| 1419 | 1419 | options: FormatOptions, |
| 1420 | 1420 | context: var, |
| 1421 | 1421 | comptime Errors: type, |
| 1422 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 1422 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 1423 | 1423 | ) Errors!void { |
| 1424 | 1424 | if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "p")) { |
| 1425 | 1425 | return std.fmt.format(context, Errors, output, "({d:.3},{d:.3})", .{ self.x, self.y }); |
| ... | ... | @@ -1626,7 +1626,7 @@ test "formatType max_depth" { |
| 1626 | 1626 | options: FormatOptions, |
| 1627 | 1627 | context: var, |
| 1628 | 1628 | comptime Errors: type, |
| 1629 | | output: fn (@TypeOf(context), []const u8) Errors!void, |
| 1629 | comptime output: fn (@TypeOf(context), []const u8) Errors!void, |
| 1630 | 1630 | ) Errors!void { |
| 1631 | 1631 | if (fmt.len == 0) { |
| 1632 | 1632 | return std.fmt.format(context, Errors, output, "({d:.3},{d:.3})", .{ self.x, self.y }); |