| ... | @@ -6,7 +6,7 @@ const std = @import("std.zig"); | ... | @@ -6,7 +6,7 @@ const std = @import("std.zig"); |
| 6 | const tokenizer = @import("zig/tokenizer.zig"); | 6 | const tokenizer = @import("zig/tokenizer.zig"); |
| 7 | const assert = std.debug.assert; | 7 | const assert = std.debug.assert; |
| 8 | const Allocator = std.mem.Allocator; | 8 | const Allocator = std.mem.Allocator; |
| 9 | const Writer = std.io.Writer; | 9 | const Writer = std.Io.Writer; |
| 10 | | 10 | |
| 11 | pub const ErrorBundle = @import("zig/ErrorBundle.zig"); | 11 | pub const ErrorBundle = @import("zig/ErrorBundle.zig"); |
| 12 | pub const Server = @import("zig/Server.zig"); | 12 | pub const Server = @import("zig/Server.zig"); |
| ... | @@ -426,7 +426,7 @@ pub const FormatId = struct { | ... | @@ -426,7 +426,7 @@ pub const FormatId = struct { |
| 426 | }; | 426 | }; |
| 427 | | 427 | |
| 428 | /// Print the string as a Zig identifier, escaping it with `@""` syntax if needed. | 428 | /// Print the string as a Zig identifier, escaping it with `@""` syntax if needed. |
| 429 | fn render(ctx: FormatId, writer: *std.io.Writer) std.io.Writer.Error!void { | 429 | fn render(ctx: FormatId, writer: *Writer) Writer.Error!void { |
| 430 | const bytes = ctx.bytes; | 430 | const bytes = ctx.bytes; |
| 431 | if (isValidId(bytes) and | 431 | if (isValidId(bytes) and |
| 432 | (ctx.flags.allow_primitive or !std.zig.isPrimitive(bytes)) and | 432 | (ctx.flags.allow_primitive or !std.zig.isPrimitive(bytes)) and |
| ... | @@ -464,7 +464,7 @@ test fmtChar { | ... | @@ -464,7 +464,7 @@ test fmtChar { |
| 464 | } | 464 | } |
| 465 | | 465 | |
| 466 | /// Print the string as escaped contents of a double quoted string. | 466 | /// Print the string as escaped contents of a double quoted string. |
| 467 | pub fn stringEscape(bytes: []const u8, w: *std.io.Writer) std.io.Writer.Error!void { | 467 | pub fn stringEscape(bytes: []const u8, w: *Writer) Writer.Error!void { |
| 468 | for (bytes) |byte| switch (byte) { | 468 | for (bytes) |byte| switch (byte) { |
| 469 | '\n' => try w.writeAll("\\n"), | 469 | '\n' => try w.writeAll("\\n"), |
| 470 | '\r' => try w.writeAll("\\r"), | 470 | '\r' => try w.writeAll("\\r"), |
| ... | @@ -481,7 +481,7 @@ pub fn stringEscape(bytes: []const u8, w: *std.io.Writer) std.io.Writer.Error!vo | ... | @@ -481,7 +481,7 @@ pub fn stringEscape(bytes: []const u8, w: *std.io.Writer) std.io.Writer.Error!vo |
| 481 | } | 481 | } |
| 482 | | 482 | |
| 483 | /// Print the string as escaped contents of a single-quoted string. | 483 | /// Print the string as escaped contents of a single-quoted string. |
| 484 | pub fn charEscape(bytes: []const u8, w: *std.io.Writer) std.io.Writer.Error!void { | 484 | pub fn charEscape(bytes: []const u8, w: *Writer) Writer.Error!void { |
| 485 | for (bytes) |byte| switch (byte) { | 485 | for (bytes) |byte| switch (byte) { |
| 486 | '\n' => try w.writeAll("\\n"), | 486 | '\n' => try w.writeAll("\\n"), |
| 487 | '\r' => try w.writeAll("\\r"), | 487 | '\r' => try w.writeAll("\\r"), |