mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
update compiler
This commit is contained in:
+2
-9
@@ -530,18 +530,11 @@ test isUnderscore {
|
||||
try std.testing.expect(!isUnderscore("\\x5f"));
|
||||
}
|
||||
|
||||
pub fn readSourceFileToEndAlloc(gpa: Allocator, input: std.fs.File, size_hint: usize) ![:0]u8 {
|
||||
pub fn readSourceFileToEndAlloc(gpa: Allocator, file_reader: *std.fs.File.Reader) ![:0]u8 {
|
||||
var buffer: std.ArrayListAlignedUnmanaged(u8, .@"2") = .empty;
|
||||
defer buffer.deinit(gpa);
|
||||
|
||||
try buffer.ensureUnusedCapacity(gpa, size_hint);
|
||||
|
||||
input.readIntoArrayList(gpa, .limited(max_src_size), .@"2", &buffer) catch |err| switch (err) {
|
||||
error.ConnectionResetByPeer => unreachable,
|
||||
error.ConnectionTimedOut => unreachable,
|
||||
error.NotOpenForReading => unreachable,
|
||||
else => |e| return e,
|
||||
};
|
||||
try file_reader.interface.appendRemaining(gpa, .@"2", &buffer, .limited(max_src_size));
|
||||
|
||||
// Detect unsupported file types with their Byte Order Mark
|
||||
const unsupported_boms = [_][]const u8{
|
||||
|
||||
Reference in New Issue
Block a user