mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
zig fmt: fix typo in firstToken() for pointer types
This commit is contained in:
parent
58db3d2775
commit
80b719d967
@ -408,10 +408,10 @@ pub const Tree = struct {
|
||||
const main_token = main_tokens[n];
|
||||
return switch (token_tags[main_token]) {
|
||||
.Asterisk => switch (token_tags[main_token - 1]) {
|
||||
.LBrace => main_token - 1,
|
||||
.LBracket => main_token - 1,
|
||||
else => main_token,
|
||||
},
|
||||
.LBrace => main_token,
|
||||
.LBracket => main_token,
|
||||
else => unreachable,
|
||||
} - end_offset;
|
||||
},
|
||||
|
||||
@ -423,16 +423,16 @@ test "zig fmt: sentinel slice with modifiers" {
|
||||
);
|
||||
}
|
||||
|
||||
//test "zig fmt: anon literal in array" {
|
||||
// try testCanonical(
|
||||
// \\var arr: [2]Foo = .{
|
||||
// \\ .{ .a = 2 },
|
||||
// \\ .{ .b = 3 },
|
||||
// \\};
|
||||
// \\
|
||||
// );
|
||||
//}
|
||||
//
|
||||
test "zig fmt: anon literal in array" {
|
||||
try testCanonical(
|
||||
\\var arr: [2]Foo = .{
|
||||
\\ .{ .a = 2 },
|
||||
\\ .{ .b = 3 },
|
||||
\\};
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
//test "zig fmt: alignment in anonymous literal" {
|
||||
// try testTransform(
|
||||
// \\const a = .{
|
||||
@ -751,12 +751,12 @@ test "zig fmt: tagged union with enum values" {
|
||||
);
|
||||
}
|
||||
|
||||
//test "zig fmt: allowzero pointer" {
|
||||
// try testCanonical(
|
||||
// \\const T = [*]allowzero const u8;
|
||||
// \\
|
||||
// );
|
||||
//}
|
||||
test "zig fmt: allowzero pointer" {
|
||||
try testCanonical(
|
||||
\\const T = [*]allowzero const u8;
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: enum literal" {
|
||||
try testCanonical(
|
||||
@ -806,13 +806,13 @@ test "zig fmt: character literal larger than u8" {
|
||||
// \\
|
||||
// );
|
||||
//}
|
||||
//
|
||||
//test "zig fmt: C pointers" {
|
||||
// try testCanonical(
|
||||
// \\const Ptr = [*c]i32;
|
||||
// \\
|
||||
// );
|
||||
//}
|
||||
|
||||
test "zig fmt: C pointers" {
|
||||
try testCanonical(
|
||||
\\const Ptr = [*c]i32;
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: threadlocal" {
|
||||
try testCanonical(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user