diff options
| author | 2025-11-08 19:59:08 +1100 | |
|---|---|---|
| committer | 2025-11-08 19:59:08 +1100 | |
| commit | 2f02c3b16c073d0bd3d9368a66ce272a574f75a3 (patch) | |
| tree | 8b3f9062edde82724c73147abf42143a885640fc /codegen | |
| 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')
| -rw-r--r-- | codegen/canon.zig | 3 | ||||
| -rw-r--r-- | codegen/case_prop.zig | 3 | ||||
| -rw-r--r-- | codegen/ccc.zig | 3 | ||||
| -rw-r--r-- | codegen/compat.zig | 3 | ||||
| -rw-r--r-- | codegen/core_props.zig | 3 | ||||
| -rw-r--r-- | codegen/dwp.zig | 6 | ||||
| -rw-r--r-- | codegen/fold.zig | 6 | ||||
| -rw-r--r-- | codegen/gbp.zig | 9 | ||||
| -rw-r--r-- | codegen/gencat.zig | 3 | ||||
| -rw-r--r-- | codegen/hangul.zig | 3 | ||||
| -rw-r--r-- | codegen/lower.zig | 3 | ||||
| -rw-r--r-- | codegen/normp.zig | 3 | ||||
| -rw-r--r-- | codegen/numeric.zig | 3 | ||||
| -rw-r--r-- | codegen/props.zig | 3 | ||||
| -rw-r--r-- | codegen/scripts.zig | 3 | ||||
| -rw-r--r-- | codegen/upper.zig | 3 | ||||
| -rw-r--r-- | codegen/wbp.zig | 3 |
17 files changed, 42 insertions, 21 deletions
diff --git a/codegen/canon.zig b/codegen/canon.zig index 34e720f..d95a905 100644 --- a/codegen/canon.zig +++ b/codegen/canon.zig | |||
| @@ -20,7 +20,8 @@ pub fn main() anyerror!void { | |||
| 20 | var writer = &file_writer.interface; | 20 | var writer = &file_writer.interface; |
| 21 | const endian = builtin.cpu.arch.endian(); | 21 | const endian = builtin.cpu.arch.endian(); |
| 22 | 22 | ||
| 23 | lines: while (in_reader.takeDelimiterInclusive('\n')) |line| { | 23 | lines: while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 24 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 24 | if (line.len == 0) continue; | 25 | if (line.len == 0) continue; |
| 25 | 26 | ||
| 26 | var field_iter = std.mem.splitScalar(u8, line, ';'); | 27 | var field_iter = std.mem.splitScalar(u8, line, ';'); |
diff --git a/codegen/case_prop.zig b/codegen/case_prop.zig index 46b8e65..613f7f6 100644 --- a/codegen/case_prop.zig +++ b/codegen/case_prop.zig | |||
| @@ -32,7 +32,8 @@ pub fn main() anyerror!void { | |||
| 32 | 32 | ||
| 33 | // Process DerivedCoreProperties.txt | 33 | // Process DerivedCoreProperties.txt |
| 34 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedCoreProperties.txt")); | 34 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedCoreProperties.txt")); |
| 35 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 35 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 36 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 36 | if (line.len == 0 or line[0] == '#') continue; | 37 | if (line.len == 0 or line[0] == '#') continue; |
| 37 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 38 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 38 | 39 | ||
diff --git a/codegen/ccc.zig b/codegen/ccc.zig index 48d3a9d..4e470ae 100644 --- a/codegen/ccc.zig +++ b/codegen/ccc.zig | |||
| @@ -31,7 +31,8 @@ pub fn main() anyerror!void { | |||
| 31 | 31 | ||
| 32 | // Process DerivedCombiningClass.txt | 32 | // Process DerivedCombiningClass.txt |
| 33 | var cc_reader = std.io.Reader.fixed(@embedFile("DerivedCombiningClass.txt")); | 33 | var cc_reader = std.io.Reader.fixed(@embedFile("DerivedCombiningClass.txt")); |
| 34 | while (cc_reader.takeDelimiterExclusive('\n')) |line| { | 34 | while (cc_reader.takeDelimiterInclusive('\n')) |took| { |
| 35 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 35 | if (line.len == 0 or line[0] == '#') continue; | 36 | if (line.len == 0 or line[0] == '#') continue; |
| 36 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 37 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 37 | 38 | ||
diff --git a/codegen/compat.zig b/codegen/compat.zig index 0a06c44..debb83d 100644 --- a/codegen/compat.zig +++ b/codegen/compat.zig | |||
| @@ -21,7 +21,8 @@ pub fn main() anyerror!void { | |||
| 21 | 21 | ||
| 22 | const endian = builtin.cpu.arch.endian(); | 22 | const endian = builtin.cpu.arch.endian(); |
| 23 | 23 | ||
| 24 | lines: while (in_reader.takeDelimiterExclusive('\n')) |line| { | 24 | lines: while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 25 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 25 | if (line.len == 0) continue; | 26 | if (line.len == 0) continue; |
| 26 | 27 | ||
| 27 | var field_iter = std.mem.splitScalar(u8, line, ';'); | 28 | var field_iter = std.mem.splitScalar(u8, line, ';'); |
diff --git a/codegen/core_props.zig b/codegen/core_props.zig index d59a77e..6ffdf91 100644 --- a/codegen/core_props.zig +++ b/codegen/core_props.zig | |||
| @@ -32,7 +32,8 @@ pub fn main() anyerror!void { | |||
| 32 | 32 | ||
| 33 | // Process DerivedCoreProperties.txt | 33 | // Process DerivedCoreProperties.txt |
| 34 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedCoreProperties.txt")); | 34 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedCoreProperties.txt")); |
| 35 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 35 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 36 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 36 | if (line.len == 0 or line[0] == '#') continue; | 37 | if (line.len == 0 or line[0] == '#') continue; |
| 37 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 38 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 38 | 39 | ||
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 | ||
diff --git a/codegen/fold.zig b/codegen/fold.zig index d927795..366ed79 100644 --- a/codegen/fold.zig +++ b/codegen/fold.zig | |||
| @@ -13,7 +13,8 @@ pub fn main() anyerror!void { | |||
| 13 | var props_map = std.AutoHashMap(u21, void).init(allocator); | 13 | var props_map = std.AutoHashMap(u21, void).init(allocator); |
| 14 | defer props_map.deinit(); | 14 | defer props_map.deinit(); |
| 15 | 15 | ||
| 16 | props_lines: while (props_reader.takeDelimiterExclusive('\n')) |line| { | 16 | props_lines: while (props_reader.takeDelimiterInclusive('\n')) |took| { |
| 17 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 17 | if (line.len == 0 or line[0] == '#') continue; | 18 | if (line.len == 0 or line[0] == '#') continue; |
| 18 | 19 | ||
| 19 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 20 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| @@ -56,7 +57,8 @@ pub fn main() anyerror!void { | |||
| 56 | // Process CaseFolding.txt | 57 | // Process CaseFolding.txt |
| 57 | 58 | ||
| 58 | var cp_reader = std.io.Reader.fixed(@embedFile("CaseFolding.txt")); | 59 | var cp_reader = std.io.Reader.fixed(@embedFile("CaseFolding.txt")); |
| 59 | while (cp_reader.takeDelimiterExclusive('\n')) |line| { | 60 | while (cp_reader.takeDelimiterInclusive('\n')) |took| { |
| 61 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 60 | if (line.len == 0 or line[0] == '#') continue; | 62 | if (line.len == 0 or line[0] == '#') continue; |
| 61 | 63 | ||
| 62 | var field_it = std.mem.splitScalar(u8, line, ';'); | 64 | var field_it = std.mem.splitScalar(u8, line, ';'); |
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; |
diff --git a/codegen/gencat.zig b/codegen/gencat.zig index 79fa072..9800f1d 100644 --- a/codegen/gencat.zig +++ b/codegen/gencat.zig | |||
| @@ -64,7 +64,8 @@ pub fn main() !void { | |||
| 64 | 64 | ||
| 65 | // Process DerivedGeneralCategory.txt | 65 | // Process DerivedGeneralCategory.txt |
| 66 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedGeneralCategory.txt")); | 66 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedGeneralCategory.txt")); |
| 67 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 67 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 68 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 68 | if (line.len == 0 or line[0] == '#') continue; | 69 | if (line.len == 0 or line[0] == '#') continue; |
| 69 | 70 | ||
| 70 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 71 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
diff --git a/codegen/hangul.zig b/codegen/hangul.zig index 64ab11c..2e4c175 100644 --- a/codegen/hangul.zig +++ b/codegen/hangul.zig | |||
| @@ -40,7 +40,8 @@ pub fn main() anyerror!void { | |||
| 40 | 40 | ||
| 41 | // Process HangulSyllableType.txt | 41 | // Process HangulSyllableType.txt |
| 42 | var in_reader = std.io.Reader.fixed(@embedFile("HangulSyllableType.txt")); | 42 | var in_reader = std.io.Reader.fixed(@embedFile("HangulSyllableType.txt")); |
| 43 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 43 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 44 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 44 | if (line.len == 0 or line[0] == '#') continue; | 45 | if (line.len == 0 or line[0] == '#') continue; |
| 45 | 46 | ||
| 46 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 47 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
diff --git a/codegen/lower.zig b/codegen/lower.zig index 987f004..91f3ef2 100644 --- a/codegen/lower.zig +++ b/codegen/lower.zig | |||
| @@ -20,7 +20,8 @@ pub fn main() !void { | |||
| 20 | 20 | ||
| 21 | const endian = builtin.cpu.arch.endian(); | 21 | const endian = builtin.cpu.arch.endian(); |
| 22 | 22 | ||
| 23 | lines: while (in_reader.takeDelimiterExclusive('\n')) |line| { | 23 | lines: while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 24 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 24 | if (line.len == 0) continue; | 25 | if (line.len == 0) continue; |
| 25 | 26 | ||
| 26 | var field_iter = std.mem.splitScalar(u8, line, ';'); | 27 | var field_iter = std.mem.splitScalar(u8, line, ';'); |
diff --git a/codegen/normp.zig b/codegen/normp.zig index 3cdd770..eaf6989 100644 --- a/codegen/normp.zig +++ b/codegen/normp.zig | |||
| @@ -31,7 +31,8 @@ pub fn main() anyerror!void { | |||
| 31 | 31 | ||
| 32 | // Process DerivedNormalizationProps.txt | 32 | // Process DerivedNormalizationProps.txt |
| 33 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedNormalizationProps.txt")); | 33 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedNormalizationProps.txt")); |
| 34 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 34 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 35 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 35 | if (line.len == 0 or line[0] == '#') continue; | 36 | if (line.len == 0 or line[0] == '#') continue; |
| 36 | 37 | ||
| 37 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 38 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
diff --git a/codegen/numeric.zig b/codegen/numeric.zig index d6b3165..b304349 100644 --- a/codegen/numeric.zig +++ b/codegen/numeric.zig | |||
| @@ -32,7 +32,8 @@ pub fn main() anyerror!void { | |||
| 32 | 32 | ||
| 33 | // Process DerivedNumericType.txt | 33 | // Process DerivedNumericType.txt |
| 34 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedNumericType.txt")); | 34 | var in_reader = std.io.Reader.fixed(@embedFile("DerivedNumericType.txt")); |
| 35 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 35 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 36 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 36 | if (line.len == 0 or line[0] == '#') continue; | 37 | if (line.len == 0 or line[0] == '#') continue; |
| 37 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 38 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 38 | 39 | ||
diff --git a/codegen/props.zig b/codegen/props.zig index ca42987..35c7dfb 100644 --- a/codegen/props.zig +++ b/codegen/props.zig | |||
| @@ -32,7 +32,8 @@ pub fn main() anyerror!void { | |||
| 32 | 32 | ||
| 33 | // Process PropList.txt | 33 | // Process PropList.txt |
| 34 | var in_reader = std.io.Reader.fixed(@embedFile("PropList.txt")); | 34 | var in_reader = std.io.Reader.fixed(@embedFile("PropList.txt")); |
| 35 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 35 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 36 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 36 | if (line.len == 0 or line[0] == '#') continue; | 37 | if (line.len == 0 or line[0] == '#') continue; |
| 37 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 38 | const no_comment = if (mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
| 38 | 39 | ||
diff --git a/codegen/scripts.zig b/codegen/scripts.zig index 81511cc..0f0194c 100644 --- a/codegen/scripts.zig +++ b/codegen/scripts.zig | |||
| @@ -205,7 +205,8 @@ pub fn main() anyerror!void { | |||
| 205 | 205 | ||
| 206 | // Process Scripts.txt | 206 | // Process Scripts.txt |
| 207 | var in_reader = std.io.Reader.fixed(@embedFile("Scripts.txt")); | 207 | var in_reader = std.io.Reader.fixed(@embedFile("Scripts.txt")); |
| 208 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 208 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 209 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 209 | if (line.len == 0 or line[0] == '#') continue; | 210 | if (line.len == 0 or line[0] == '#') continue; |
| 210 | 211 | ||
| 211 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 212 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |
diff --git a/codegen/upper.zig b/codegen/upper.zig index 108fdbd..5eb29e7 100644 --- a/codegen/upper.zig +++ b/codegen/upper.zig | |||
| @@ -19,7 +19,8 @@ pub fn main() anyerror!void { | |||
| 19 | var file_writer = out_file.writer(&write_buf); | 19 | var file_writer = out_file.writer(&write_buf); |
| 20 | const endian = builtin.cpu.arch.endian(); | 20 | const endian = builtin.cpu.arch.endian(); |
| 21 | 21 | ||
| 22 | lines: while (in_reader.takeDelimiterExclusive('\n')) |line| { | 22 | lines: while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 23 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 23 | if (line.len == 0) continue; | 24 | if (line.len == 0) continue; |
| 24 | 25 | ||
| 25 | var field_iter = std.mem.splitScalar(u8, line, ';'); | 26 | var field_iter = std.mem.splitScalar(u8, line, ';'); |
diff --git a/codegen/wbp.zig b/codegen/wbp.zig index dfdc32e..33eeea5 100644 --- a/codegen/wbp.zig +++ b/codegen/wbp.zig | |||
| @@ -54,7 +54,8 @@ pub fn main() anyerror!void { | |||
| 54 | // Process HangulSyllableType.txt | 54 | // Process HangulSyllableType.txt |
| 55 | const in_file = @embedFile("WordBreakProperty.txt"); | 55 | const in_file = @embedFile("WordBreakProperty.txt"); |
| 56 | var in_reader = std.io.Reader.fixed(in_file); | 56 | var in_reader = std.io.Reader.fixed(in_file); |
| 57 | while (in_reader.takeDelimiterExclusive('\n')) |line| { | 57 | while (in_reader.takeDelimiterInclusive('\n')) |took| { |
| 58 | const line = std.mem.trimRight(u8, took, "\n"); | ||
| 58 | if (line.len == 0 or line[0] == '#') continue; | 59 | if (line.len == 0 or line[0] == '#') continue; |
| 59 | 60 | ||
| 60 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; | 61 | const no_comment = if (std.mem.indexOfScalar(u8, line, '#')) |octo| line[0..octo] else line; |