diff options
| author | 2026-02-04 15:02:12 -0500 | |
|---|---|---|
| committer | 2026-02-04 15:02:12 -0500 | |
| commit | 1a9168ab7d1d5337ec954f7897c2e6b51a0bd95e (patch) | |
| tree | 35847e74f41a0a75870b08d8a5fbbb0f1bd0d378 /codegen/dwp.zig | |
| parent | Merge pull request 'Move part of the `DisplayWidth.strWidth` into its own `Di... (diff) | |
| download | zg-1a9168ab7d1d5337ec954f7897c2e6b51a0bd95e.tar.gz zg-1a9168ab7d1d5337ec954f7897c2e6b51a0bd95e.tar.xz zg-1a9168ab7d1d5337ec954f7897c2e6b51a0bd95e.zip | |
Convert Graphemes to static allocation
And DisplayWidth, although untested at present.
The plan is to just work through the codegen / module pairings, and
move tests over until everything is covered.
Diffstat (limited to 'codegen/dwp.zig')
| -rw-r--r-- | codegen/dwp.zig | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/codegen/dwp.zig b/codegen/dwp.zig index 75ac68e..b4d1ed0 100644 --- a/codegen/dwp.zig +++ b/codegen/dwp.zig | |||
| @@ -235,12 +235,24 @@ pub fn main() anyerror!void { | |||
| 235 | defer out_file.close(); | 235 | defer out_file.close(); |
| 236 | var writer = out_file.writer(&write_buf); | 236 | var writer = out_file.writer(&write_buf); |
| 237 | 237 | ||
| 238 | const endian = builtin.cpu.arch.endian(); | 238 | try writer.interface.print( |
| 239 | try writer.interface.writeInt(u16, @intCast(stage1.items.len), endian); | 239 | \\//! This file is auto-generated. Do not edit. |
| 240 | for (stage1.items) |i| try writer.interface.writeInt(u16, i, endian); | 240 | \\ |
| 241 | 241 | \\pub const s1: [{}]u16 = .{{ | |
| 242 | try writer.interface.writeInt(u16, @intCast(stage2.items.len), endian); | 242 | , .{stage1.items.len}); |
| 243 | for (stage2.items) |i| try writer.interface.writeInt(i8, i, endian); | 243 | for (stage1.items) |entry| try writer.interface.print("{}, ", .{entry}); |
| 244 | |||
| 245 | try writer.interface.print( | ||
| 246 | \\ | ||
| 247 | \\}}; | ||
| 248 | \\ | ||
| 249 | \\pub const s2: [{}]i4 = .{{ | ||
| 250 | , .{stage2.items.len}); | ||
| 251 | for (stage2.items) |entry| try writer.interface.print("{}, ", .{entry}); | ||
| 252 | |||
| 253 | try writer.interface.writeAll( | ||
| 254 | \\}; | ||
| 255 | ); | ||
| 244 | 256 | ||
| 245 | try writer.interface.flush(); | 257 | try writer.interface.flush(); |
| 246 | } | 258 | } |