std.zig: move render state to struct; add fixups

This commit is contained in:
Andrew Kelley 2023-11-02 14:44:46 -07:00
parent f8c24c2cd0
commit 3263d6e6ab
2 changed files with 710 additions and 662 deletions

View File

@ -117,8 +117,10 @@ pub fn render(tree: Ast, gpa: Allocator) RenderError![]u8 {
return buffer.toOwnedSlice();
}
pub fn renderToArrayList(tree: Ast, buffer: *std.ArrayList(u8)) RenderError!void {
return @import("./render.zig").renderTree(buffer, tree);
pub const Fixups = private_render.Fixups;
pub fn renderToArrayList(tree: Ast, buffer: *std.ArrayList(u8), fixups: Fixups) RenderError!void {
return @import("./render.zig").renderTree(buffer, tree, fixups);
}
/// Returns an extra offset for column and byte offset of errors that
@ -3530,6 +3532,7 @@ const Token = std.zig.Token;
const Ast = @This();
const Allocator = std.mem.Allocator;
const Parse = @import("Parse.zig");
const private_render = @import("./render.zig");
test {
testing.refAllDecls(@This());

File diff suppressed because it is too large Load Diff