diff options
| author | 2025-11-08 19:59:08 +1100 | |
|---|---|---|
| committer | 2025-11-08 19:59:08 +1100 | |
| commit | 2f02c3b16c073d0bd3d9368a66ce272a574f75a3 (patch) | |
| tree | 8b3f9062edde82724c73147abf42143a885640fc /codegen/gbp.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/gbp.zig')
| -rw-r--r-- | codegen/gbp.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/codegen/gbp.zig b/codegen/gbp.zig index 895aa7a..1d06e9a 100644 --- a/codegen/gbp.zig +++ b/codegen/gbp.zig | |||
| @@ -65,7 +65,8 @@ pub fn main() anyerror!void { | |||
| 65 | const indic_file = @embedFile("DerivedCoreProperties.txt"); | 65 | const indic_file = @embedFile("DerivedCoreProperties.txt"); |
| 66 | var indic_reader = std.io.Reader.fixed(indic_file); | 66 | var indic_reader = std.io.Reader.fixed(indic_file); |
| 67 | 67 | ||
| 68 | while (indic_reader.takeDelimiterExclusive('\n')) |line| { | 68 | while (indic_reader.takeDelimiterInclusive('\n')) |took| { |
| 69 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 69 | if (line.len == 0 or line[0] == '#') continue; | 70 | if (line.len == 0 or line[0] == '#') continue; |
| 70 | if (std.mem.indexOf(u8, line, "InCB") == null) continue; | 71 | if (std.mem.indexOf(u8, line, "InCB") == null) continue; |
| 71 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 72 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| @@ -106,7 +107,8 @@ pub fn main() anyerror!void { | |||
| 106 | 107 | ||
| 107 | var gbp_reader = std.io.Reader.fixed(@embedFile("GraphemeBreakProperty.txt")); | 108 | var gbp_reader = std.io.Reader.fixed(@embedFile("GraphemeBreakProperty.txt")); |
| 108 | 109 | ||
| 109 | while (gbp_reader.takeDelimiterExclusive('\n')) |line| { | 110 | while (gbp_reader.takeDelimiterInclusive('\n')) |took| { |
| 111 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 110 | if (line.len == 0 or line[0] == '#') continue; | 112 | if (line.len == 0 or line[0] == '#') continue; |
| 111 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 113 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 112 | 114 | ||
| @@ -146,7 +148,8 @@ pub fn main() anyerror!void { | |||
| 146 | 148 | ||
| 147 | var emoji_reader = std.io.Reader.fixed(@embedFile("emoji-data.txt")); | 149 | var emoji_reader = std.io.Reader.fixed(@embedFile("emoji-data.txt")); |
| 148 | 150 | ||
| 149 | while (emoji_reader.takeDelimiterExclusive('\n')) |line| { | 151 | while (emoji_reader.takeDelimiterInclusive('\n')) |took| { |
| 152 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 150 | if (line.len == 0 or line[0] == '#') continue; | 153 | if (line.len == 0 or line[0] == '#') continue; |
| 151 | if (std.mem.indexOf(u8, line, "Extended_Pictographic") == null) continue; | 154 | if (std.mem.indexOf(u8, line, "Extended_Pictographic") == null) continue; |
| 152 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 155 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |