diff options
| author | Damien Firmenich <fir.damien@gmail.com> | 2022-04-05 17:08:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-05 18:08:33 +0300 |
| commit | 5fafcc2b629e2ff00755b2bf45e903590f04aa9f (patch) | |
| tree | 143bde0c47f71678a3d7f340073f519f7c41b7d2 /src | |
| parent | 95a87e88fac3fc563ac3baaf4eb8027341f4131e (diff) | |
| download | zig-5fafcc2b629e2ff00755b2bf45e903590f04aa9f.tar.gz zig-5fafcc2b629e2ff00755b2bf45e903590f04aa9f.zip | |
zig fmt: remove trailing whitespace on doc comments
Fixes #11353
The renderer treats comments and doc comments differently since doc
comments are parsed into the Ast. This commit adds a check after getting
the text for the doc comment and trims whitespace at the end before
rendering.
The `a = 0,` in the test is here to avoid a ParseError while parsing the
test.
Diffstat (limited to 'src')
| -rw-r--r-- | src/arch/wasm/Mir.zig | 4 | ||||
| -rw-r--r-- | src/arch/x86_64/Mir.zig | 2 | ||||
| -rw-r--r-- | src/link/Elf.zig | 2 | ||||
| -rw-r--r-- | src/link/MachO.zig | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/wasm/Mir.zig b/src/arch/wasm/Mir.zig index 27f683cf1e..b15dbd9020 100644 --- a/src/arch/wasm/Mir.zig +++ b/src/arch/wasm/Mir.zig @@ -10,7 +10,7 @@ const Mir = @This(); const std = @import("std"); -/// A struct of array that represents each individual wasm +/// A struct of array that represents each individual wasm instructions: std.MultiArrayList(Inst).Slice, /// A slice of indexes where the meaning of the data is determined by the /// `Inst.Tag` value. @@ -538,7 +538,7 @@ pub const Inst = struct { /// Contains an u32 index into a wasm section entry, such as a local. /// Note: This is not an index to another instruction. /// - /// Used by e.g. `local_get`, `local_set`, etc. + /// Used by e.g. `local_get`, `local_set`, etc. label: u32, /// A 32-bit immediate value. /// diff --git a/src/arch/x86_64/Mir.zig b/src/arch/x86_64/Mir.zig index a99cd58f06..50f28d7f19 100644 --- a/src/arch/x86_64/Mir.zig +++ b/src/arch/x86_64/Mir.zig @@ -364,7 +364,7 @@ pub const Inst = struct { dbg_line, /// push registers from the callee_preserved_regs - /// data is the bitfield of which regs to push + /// data is the bitfield of which regs to push /// for example on x86_64, the callee_preserved_regs are [_]Register{ .rcx, .rsi, .rdi, .r8, .r9, .r10, .r11 }; }; /// so to push rcx and r8 one would make data 0b00000000_00000000_00000000_00001001 (the first and fourth bits are set) /// ops is unused diff --git a/src/link/Elf.zig b/src/link/Elf.zig index aa5c5e2a47..9e1ed0cf54 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -154,7 +154,7 @@ atom_by_index_table: std.AutoHashMapUnmanaged(u32, *TextBlock) = .{}, /// const Foo = struct{ /// a: u8, /// }; -/// +/// /// pub fn main() void { /// var foo = Foo{ .a = 1 }; /// _ = foo; diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 1d75eb442a..b193068361 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -232,7 +232,7 @@ atom_by_index_table: std.AutoHashMapUnmanaged(u32, *Atom) = .{}, /// const Foo = struct{ /// a: u8, /// }; -/// +/// /// pub fn main() void { /// var foo = Foo{ .a = 1 }; /// _ = foo; |
