| author | |
| committer | |
| log | e535057364d33819001e55d34d104916cfab1b91 |
| tree | a4ae121967db52ff9d8b01bfa5dca3a5e81767da |
| parent | 3fb030e78a04ff5eebd4e01769099b799912b9fd |
| signature |
5 files changed, 12 insertions(+), 11 deletions(-)
doc/docgen.zig+4-4| ... | ... | @@ -321,7 +321,7 @@ fn genToc(allocator: *mem.Allocator, tokenizer: *Tokenizer) !Toc { |
| 321 | 321 | var last_action = Action.Open; |
| 322 | 322 | var last_columns: ?u8 = null; |
| 323 | 323 | |
| 324 | var toc_buf = try std.Buffer.initSize(allocator, 0); | |
| 324 | var toc_buf = std.ArrayList(u8).init(allocator); | |
| 325 | 325 | defer toc_buf.deinit(); |
| 326 | 326 | |
| 327 | 327 | var toc = toc_buf.outStream(); |
| ... | ... | @@ -607,7 +607,7 @@ fn genToc(allocator: *mem.Allocator, tokenizer: *Tokenizer) !Toc { |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | fn urlize(allocator: *mem.Allocator, input: []const u8) ![]u8 { |
| 610 | var buf = try std.Buffer.initSize(allocator, 0); | |
| 610 | var buf = std.ArrayList(u8).init(allocator); | |
| 611 | 611 | defer buf.deinit(); |
| 612 | 612 | |
| 613 | 613 | const out = buf.outStream(); |
| ... | ... | @@ -626,7 +626,7 @@ fn urlize(allocator: *mem.Allocator, input: []const u8) ![]u8 { |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | fn escapeHtml(allocator: *mem.Allocator, input: []const u8) ![]u8 { |
| 629 | var buf = try std.Buffer.initSize(allocator, 0); | |
| 629 | var buf = std.ArrayList(u8).init(allocator); | |
| 630 | 630 | defer buf.deinit(); |
| 631 | 631 | |
| 632 | 632 | const out = buf.outStream(); |
| ... | ... | @@ -672,7 +672,7 @@ test "term color" { |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | fn termColor(allocator: *mem.Allocator, input: []const u8) ![]u8 { |
| 675 | var buf = try std.Buffer.initSize(allocator, 0); | |
| 675 | var buf = std.ArrayList(u8).init(allocator); | |
| 676 | 676 | defer buf.deinit(); |
| 677 | 677 | |
| 678 | 678 | var out = buf.outStream(); |
lib/std/zig/parser_test.zig+1-1| ... | ... | @@ -2953,7 +2953,7 @@ fn testParse(source: []const u8, allocator: *mem.Allocator, anything_changed: *b |
| 2953 | 2953 | return error.ParseError; |
| 2954 | 2954 | } |
| 2955 | 2955 | |
| 2956 | var buffer = try std.Buffer.initSize(allocator, 0); | |
| 2956 | var buffer = std.ArrayList(u8).init(allocator); | |
| 2957 | 2957 | errdefer buffer.deinit(); |
| 2958 | 2958 | |
| 2959 | 2959 | anything_changed.* = try std.zig.render(allocator, buffer.outStream(), tree); |
src-self-hosted/errmsg.zig+2-2| ... | ... | @@ -158,7 +158,7 @@ pub const Msg = struct { |
| 158 | 158 | parse_error: *const ast.Error, |
| 159 | 159 | ) !*Msg { |
| 160 | 160 | const loc_token = parse_error.loc(); |
| 161 | var text_buf = try std.Buffer.initSize(comp.gpa(), 0); | |
| 161 | var text_buf = std.ArrayList(u8).init(comp.gpa()); | |
| 162 | 162 | defer text_buf.deinit(); |
| 163 | 163 | |
| 164 | 164 | const realpath_copy = try mem.dupe(comp.gpa(), u8, tree_scope.root().realpath); |
| ... | ... | @@ -197,7 +197,7 @@ pub const Msg = struct { |
| 197 | 197 | realpath: []const u8, |
| 198 | 198 | ) !*Msg { |
| 199 | 199 | const loc_token = parse_error.loc(); |
| 200 | var text_buf = try std.Buffer.initSize(allocator, 0); | |
| 200 | var text_buf = std.ArrayList(u8).init(allocator); | |
| 201 | 201 | defer text_buf.deinit(); |
| 202 | 202 | |
| 203 | 203 | const realpath_copy = try mem.dupe(allocator, u8, realpath); |
src-self-hosted/stage2.zig+3-2| ... | ... | @@ -411,10 +411,11 @@ fn printErrMsgToFile( |
| 411 | 411 | const start_loc = tree.tokenLocationPtr(0, first_token); |
| 412 | 412 | const end_loc = tree.tokenLocationPtr(first_token.end, last_token); |
| 413 | 413 | |
| 414 | var text_buf = try std.Buffer.initSize(allocator, 0); | |
| 414 | var text_buf = std.ArrayList(u8).init(allocator); | |
| 415 | defer text_buf.deinit(); | |
| 415 | 416 | const out_stream = &text_buf.outStream(); |
| 416 | 417 | try parse_error.render(&tree.tokens, out_stream); |
| 417 | const text = text_buf.toOwnedSlice(); | |
| 418 | const text = text_buf.span(); | |
| 418 | 419 | |
| 419 | 420 | const stream = &file.outStream(); |
| 420 | 421 | try stream.print("{}:{}:{}: error: {}\n", .{ path, start_loc.line + 1, start_loc.column + 1, text }); |
src-self-hosted/type.zig+2-2| ... | ... | @@ -387,10 +387,10 @@ pub const Type = struct { |
| 387 | 387 | }; |
| 388 | 388 | errdefer comp.gpa().destroy(self); |
| 389 | 389 | |
| 390 | var name_buf = try std.Buffer.initSize(comp.gpa(), 0); | |
| 390 | var name_buf = std.ArrayList(u8).init(comp.gpa()); | |
| 391 | 391 | defer name_buf.deinit(); |
| 392 | 392 | |
| 393 | const name_stream = &std.io.BufferOutStream.init(&name_buf).stream; | |
| 393 | const name_stream = name_buf.outStream(); | |
| 394 | 394 | |
| 395 | 395 | switch (key.data) { |
| 396 | 396 | .Generic => |generic| { |