diff options
| author | 2025-11-08 19:59:08 +1100 | |
|---|---|---|
| committer | 2025-11-08 19:59:08 +1100 | |
| commit | 2f02c3b16c073d0bd3d9368a66ce272a574f75a3 (patch) | |
| tree | 8b3f9062edde82724c73147abf42143a885640fc /codegen/dwp.zig | |
| parent | Embed data files in scripts rather than relying on filesystem access for easi... (diff) | |
| download | zg-2f02c3b16c073d0bd3d9368a66ce272a574f75a3.tar.gz zg-2f02c3b16c073d0bd3d9368a66ce272a574f75a3.tar.xz zg-2f02c3b16c073d0bd3d9368a66ce272a574f75a3.zip | |
Use takeDelimiterInclusive to support Zig 0.15.2
Diffstat (limited to 'codegen/dwp.zig')
| -rw-r--r-- | codegen/dwp.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/codegen/dwp.zig b/codegen/dwp.zig index 8189ad8..75ac68e 100644 --- a/codegen/dwp.zig +++ b/codegen/dwp.zig | |||
| @@ -34,7 +34,8 @@ pub fn main() anyerror!void { | |||
| 34 | // Process DerivedEastAsianWidth.txt | 34 | // Process DerivedEastAsianWidth.txt |
| 35 | var deaw_reader = std.io.Reader.fixed(@embedFile("DerivedEastAsianWidth.txt")); | 35 | var deaw_reader = std.io.Reader.fixed(@embedFile("DerivedEastAsianWidth.txt")); |
| 36 | 36 | ||
| 37 | while (deaw_reader.takeDelimiterExclusive('\n')) |line| { | 37 | while (deaw_reader.takeDelimiterInclusive('\n')) |took| { |
| 38 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 38 | if (line.len == 0) continue; | 39 | if (line.len == 0) continue; |
| 39 | 40 | ||
| 40 | // @missing ranges | 41 | // @missing ranges |
| @@ -92,7 +93,8 @@ pub fn main() anyerror!void { | |||
| 92 | // Process DerivedGeneralCategory.txt | 93 | // Process DerivedGeneralCategory.txt |
| 93 | var dgc_reader = std.io.Reader.fixed(@embedFile("DerivedGeneralCategory.txt")); | 94 | var dgc_reader = std.io.Reader.fixed(@embedFile("DerivedGeneralCategory.txt")); |
| 94 | 95 | ||
| 95 | while (dgc_reader.takeDelimiterExclusive('\n')) |line| { | 96 | while (dgc_reader.takeDelimiterInclusive('\n')) |took| { |
| 97 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 96 | if (line.len == 0 or line[0] == '#') continue; | 98 | if (line.len == 0 or line[0] == '#') continue; |
| 97 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 99 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 98 | 100 | ||