authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-06-20 18:39:15-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-06-20 18:39:15-04:00
logda549a72e19d4f24520ca151bbd4cd0e74dc752c
treeea091fd06e7795887e042dd85a47686906d09027
parentd87cd06296a759ce398b50a437b8a1444413c6be

zig fmt


6 files changed, 63 insertions(+), 65 deletions(-)

lib/std/array_list.zig+1-1
......@@ -162,7 +162,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
162162 mem.copy(T, self.items[oldlen..], items);
163163 }
164164
165 pub usingnamespace if (T != u8) struct { } else struct {
165 pub usingnamespace if (T != u8) struct {} else struct {
166166 pub const Writer = std.io.Writer(*Self, error{OutOfMemory}, appendWrite);
167167
168168 /// Initializes a Writer which will append to the list.
lib/std/c/tokenizer.zig+50-50
......@@ -278,62 +278,62 @@ pub const Token = struct {
278278
279279 // TODO extensions
280280 pub const keywords = std.ComptimeStringMap(Id, .{
281 .{"auto", .Keyword_auto},
282 .{"break", .Keyword_break},
283 .{"case", .Keyword_case},
284 .{"char", .Keyword_char},
285 .{"const", .Keyword_const},
286 .{"continue", .Keyword_continue},
287 .{"default", .Keyword_default},
288 .{"do", .Keyword_do},
289 .{"double", .Keyword_double},
290 .{"else", .Keyword_else},
291 .{"enum", .Keyword_enum},
292 .{"extern", .Keyword_extern},
293 .{"float", .Keyword_float},
294 .{"for", .Keyword_for},
295 .{"goto", .Keyword_goto},
296 .{"if", .Keyword_if},
297 .{"int", .Keyword_int},
298 .{"long", .Keyword_long},
299 .{"register", .Keyword_register},
300 .{"return", .Keyword_return},
301 .{"short", .Keyword_short},
302 .{"signed", .Keyword_signed},
303 .{"sizeof", .Keyword_sizeof},
304 .{"static", .Keyword_static},
305 .{"struct", .Keyword_struct},
306 .{"switch", .Keyword_switch},
307 .{"typedef", .Keyword_typedef},
308 .{"union", .Keyword_union},
309 .{"unsigned", .Keyword_unsigned},
310 .{"void", .Keyword_void},
311 .{"volatile", .Keyword_volatile},
312 .{"while", .Keyword_while},
281 .{ "auto", .Keyword_auto },
282 .{ "break", .Keyword_break },
283 .{ "case", .Keyword_case },
284 .{ "char", .Keyword_char },
285 .{ "const", .Keyword_const },
286 .{ "continue", .Keyword_continue },
287 .{ "default", .Keyword_default },
288 .{ "do", .Keyword_do },
289 .{ "double", .Keyword_double },
290 .{ "else", .Keyword_else },
291 .{ "enum", .Keyword_enum },
292 .{ "extern", .Keyword_extern },
293 .{ "float", .Keyword_float },
294 .{ "for", .Keyword_for },
295 .{ "goto", .Keyword_goto },
296 .{ "if", .Keyword_if },
297 .{ "int", .Keyword_int },
298 .{ "long", .Keyword_long },
299 .{ "register", .Keyword_register },
300 .{ "return", .Keyword_return },
301 .{ "short", .Keyword_short },
302 .{ "signed", .Keyword_signed },
303 .{ "sizeof", .Keyword_sizeof },
304 .{ "static", .Keyword_static },
305 .{ "struct", .Keyword_struct },
306 .{ "switch", .Keyword_switch },
307 .{ "typedef", .Keyword_typedef },
308 .{ "union", .Keyword_union },
309 .{ "unsigned", .Keyword_unsigned },
310 .{ "void", .Keyword_void },
311 .{ "volatile", .Keyword_volatile },
312 .{ "while", .Keyword_while },
313313
314314 // ISO C99
315 .{"_Bool", .Keyword_bool},
316 .{"_Complex", .Keyword_complex},
317 .{"_Imaginary", .Keyword_imaginary},
318 .{"inline", .Keyword_inline},
319 .{"restrict", .Keyword_restrict},
315 .{ "_Bool", .Keyword_bool },
316 .{ "_Complex", .Keyword_complex },
317 .{ "_Imaginary", .Keyword_imaginary },
318 .{ "inline", .Keyword_inline },
319 .{ "restrict", .Keyword_restrict },
320320
321321 // ISO C11
322 .{"_Alignas", .Keyword_alignas},
323 .{"_Alignof", .Keyword_alignof},
324 .{"_Atomic", .Keyword_atomic},
325 .{"_Generic", .Keyword_generic},
326 .{"_Noreturn", .Keyword_noreturn},
327 .{"_Static_assert", .Keyword_static_assert},
328 .{"_Thread_local", .Keyword_thread_local},
322 .{ "_Alignas", .Keyword_alignas },
323 .{ "_Alignof", .Keyword_alignof },
324 .{ "_Atomic", .Keyword_atomic },
325 .{ "_Generic", .Keyword_generic },
326 .{ "_Noreturn", .Keyword_noreturn },
327 .{ "_Static_assert", .Keyword_static_assert },
328 .{ "_Thread_local", .Keyword_thread_local },
329329
330330 // Preprocessor directives
331 .{"include", .Keyword_include},
332 .{"define", .Keyword_define},
333 .{"ifdef", .Keyword_ifdef},
334 .{"ifndef", .Keyword_ifndef},
335 .{"error", .Keyword_error},
336 .{"pragma", .Keyword_pragma},
331 .{ "include", .Keyword_include },
332 .{ "define", .Keyword_define },
333 .{ "ifdef", .Keyword_ifdef },
334 .{ "ifndef", .Keyword_ifndef },
335 .{ "error", .Keyword_error },
336 .{ "pragma", .Keyword_pragma },
337337 });
338338
339339 // TODO do this in the preprocessor
lib/std/io/buffered_out_stream.zig+1-1
......@@ -2,4 +2,4 @@
22pub const BufferedOutStream = @import("./buffered_writer.zig").BufferedWriter;
33
44/// Deprecated: use `std.io.buffered_writer.bufferedWriter`
5pub const bufferedOutStream = @import("./buffered_writer.zig").bufferedWriter
5pub const bufferedOutStream = @import("./buffered_writer.zig").bufferedWriter;
lib/std/json.zig+2-3
......@@ -2576,8 +2576,8 @@ pub fn stringify(
25762576 },
25772577 .Array => return stringify(&value, options, out_stream),
25782578 .Vector => |info| {
2579 const array: [info.len]info.child = value;
2580 return stringify(&array, options, out_stream);
2579 const array: [info.len]info.child = value;
2580 return stringify(&array, options, out_stream);
25812581 },
25822582 else => @compileError("Unable to stringify type '" ++ @typeName(T) ++ "'"),
25832583 }
......@@ -2770,4 +2770,3 @@ test "stringify struct with custom stringifier" {
27702770test "stringify vector" {
27712771 try teststringify("[1,1]", @splat(2, @as(u32, 1)), StringifyOptions{});
27722772}
2773
lib/std/os/windows/ws2_32.zig+9-9
......@@ -163,16 +163,16 @@ pub const IPPROTO_UDP = 17;
163163pub const IPPROTO_ICMPV6 = 58;
164164pub const IPPROTO_RM = 113;
165165
166pub const AI_PASSIVE = 0x00001;
167pub const AI_CANONNAME = 0x00002;
168pub const AI_NUMERICHOST = 0x00004;
169pub const AI_NUMERICSERV = 0x00008;
170pub const AI_ADDRCONFIG = 0x00400;
171pub const AI_V4MAPPED = 0x00800;
172pub const AI_NON_AUTHORITATIVE = 0x04000;
173pub const AI_SECURE = 0x08000;
166pub const AI_PASSIVE = 0x00001;
167pub const AI_CANONNAME = 0x00002;
168pub const AI_NUMERICHOST = 0x00004;
169pub const AI_NUMERICSERV = 0x00008;
170pub const AI_ADDRCONFIG = 0x00400;
171pub const AI_V4MAPPED = 0x00800;
172pub const AI_NON_AUTHORITATIVE = 0x04000;
173pub const AI_SECURE = 0x08000;
174174pub const AI_RETURN_PREFERRED_NAMES = 0x10000;
175pub const AI_DISABLE_IDN_ENCODING = 0x80000;
175pub const AI_DISABLE_IDN_ENCODING = 0x80000;
176176
177177pub const FIONBIO = -2147195266;
178178
lib/std/zig/parse.zig-1
......@@ -937,7 +937,6 @@ const Parser = struct {
937937 return node;
938938 }
939939
940
941940 while_prefix.body = try p.expectNode(parseAssignExpr, .{
942941 .ExpectedBlockOrAssignment = .{ .token = p.tok_i },
943942 });