| author | |
| committer | |
| log | 89adf9cf5ccb613926ac30248df05e6d4c9455dc |
| tree | 65e43b72a92ac29b25193a92d55727536d2fbebe |
| parent | 797b2b01b237099923aeda5127b8e0c56e56f9ad |
2 files changed, 9 insertions(+), 9 deletions(-)
lib/std/zig.zig+4-4| ... | ... | @@ -6,7 +6,7 @@ const std = @import("std.zig"); |
| 6 | 6 | const tokenizer = @import("zig/tokenizer.zig"); |
| 7 | 7 | const assert = std.debug.assert; |
| 8 | 8 | const Allocator = std.mem.Allocator; |
| 9 | const Writer = std.io.Writer; | |
| 9 | const Writer = std.Io.Writer; | |
| 10 | 10 | |
| 11 | 11 | pub const ErrorBundle = @import("zig/ErrorBundle.zig"); |
| 12 | 12 | pub const Server = @import("zig/Server.zig"); |
| ... | ... | @@ -426,7 +426,7 @@ pub const FormatId = struct { |
| 426 | 426 | }; |
| 427 | 427 | |
| 428 | 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 | 430 | const bytes = ctx.bytes; |
| 431 | 431 | if (isValidId(bytes) and |
| 432 | 432 | (ctx.flags.allow_primitive or !std.zig.isPrimitive(bytes)) and |
| ... | ... | @@ -464,7 +464,7 @@ test fmtChar { |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 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 | 468 | for (bytes) |byte| switch (byte) { |
| 469 | 469 | '\n' => try w.writeAll("\\n"), |
| 470 | 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 | 481 | } |
| 482 | 482 | |
| 483 | 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 | 485 | for (bytes) |byte| switch (byte) { |
| 486 | 486 | '\n' => try w.writeAll("\\n"), |
| 487 | 487 | '\r' => try w.writeAll("\\r"), |
lib/std/zig/Ast.zig+5-5| ... | ... | @@ -12,7 +12,7 @@ const Token = std.zig.Token; |
| 12 | 12 | const Ast = @This(); |
| 13 | 13 | const Allocator = std.mem.Allocator; |
| 14 | 14 | const Parse = @import("Parse.zig"); |
| 15 | const Writer = std.io.Writer; | |
| 15 | const Writer = std.Io.Writer; | |
| 16 | 16 | |
| 17 | 17 | /// Reference to externally-owned data. |
| 18 | 18 | source: [:0]const u8, |
| ... | ... | @@ -205,8 +205,8 @@ pub fn parse(gpa: Allocator, source: [:0]const u8, mode: Mode) Allocator.Error!A |
| 205 | 205 | /// Caller owns the returned slice of bytes, allocated with `gpa`. |
| 206 | 206 | pub fn renderAlloc(tree: Ast, gpa: Allocator) error{OutOfMemory}![]u8 { |
| 207 | 207 | var aw: std.io.Writer.Allocating = .init(gpa); |
| 208 | errdefer aw.deinit(); | |
| 209 | render(tree, gpa, &aw.interface, .{}) catch |err| switch (err) { | |
| 208 | defer aw.deinit(); | |
| 209 | render(tree, gpa, &aw.writer, .{}) catch |err| switch (err) { | |
| 210 | 210 | error.WriteFailed => return error.OutOfMemory, |
| 211 | 211 | }; |
| 212 | 212 | return aw.toOwnedSlice(); |
| ... | ... | @@ -214,8 +214,8 @@ pub fn renderAlloc(tree: Ast, gpa: Allocator) error{OutOfMemory}![]u8 { |
| 214 | 214 | |
| 215 | 215 | pub const Render = @import("Ast/Render.zig"); |
| 216 | 216 | |
| 217 | pub fn render(tree: Ast, gpa: Allocator, bw: *Writer, fixups: Render.Fixups) Render.Error!void { | |
| 218 | return Render.tree(gpa, bw, tree, fixups); | |
| 217 | pub fn render(tree: Ast, gpa: Allocator, w: *Writer, fixups: Render.Fixups) Render.Error!void { | |
| 218 | return Render.tree(gpa, w, tree, fixups); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /// Returns an extra offset for column and byte offset of errors that |