diff options
| author | 2024-02-17 13:31:45 -0400 | |
|---|---|---|
| committer | 2024-02-17 13:31:45 -0400 | |
| commit | ae5d7a0c310c7b0acd7a51e97ee46893f3d5b79e (patch) | |
| tree | 2c777053752e347b7b0f27127a17bdda97795e8d /src/main.zig | |
| parent | display_width tweaks (diff) | |
| download | zg-ae5d7a0c310c7b0acd7a51e97ee46893f3d5b79e.tar.gz zg-ae5d7a0c310c7b0acd7a51e97ee46893f3d5b79e.tar.xz zg-ae5d7a0c310c7b0acd7a51e97ee46893f3d5b79e.zip | |
Fixed isAsciiOnly and CodePointIterator ASCII bugs
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index 38ba343..7ff07ee 100644 --- a/src/main.zig +++ b/src/main.zig | |||
| @@ -6,7 +6,7 @@ const std = @import("std"); | |||
| 6 | // const codePointWidth = @import("display_width").codePointWidth; | 6 | // const codePointWidth = @import("display_width").codePointWidth; |
| 7 | // const strWidth = @import("ziglyph").display_width.strWidth; | 7 | // const strWidth = @import("ziglyph").display_width.strWidth; |
| 8 | const strWidth = @import("display_width").strWidth; | 8 | const strWidth = @import("display_width").strWidth; |
| 9 | const CodePointIterator = @import("CodePoint").CodePointIterator; | 9 | // const CodePointIterator = @import("CodePoint").CodePointIterator; |
| 10 | 10 | ||
| 11 | pub fn main() !void { | 11 | pub fn main() !void { |
| 12 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | 12 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; |
| @@ -16,12 +16,12 @@ pub fn main() !void { | |||
| 16 | const input = try std.fs.cwd().readFileAlloc(allocator, "lang_mix.txt", std.math.maxInt(u32)); | 16 | const input = try std.fs.cwd().readFileAlloc(allocator, "lang_mix.txt", std.math.maxInt(u32)); |
| 17 | defer allocator.free(input); | 17 | defer allocator.free(input); |
| 18 | 18 | ||
| 19 | var result: usize = 0; | ||
| 20 | // var result: isize = 0; | ||
| 21 | // var iter = GraphemeIterator.init(input); | 19 | // var iter = GraphemeIterator.init(input); |
| 22 | // var iter = CodePointIterator{ .bytes = input }; | 20 | // var iter = CodePointIterator{ .bytes = input }; |
| 23 | var iter = std.mem.splitScalar(u8, input, '\n'); | 21 | var iter = std.mem.splitScalar(u8, input, '\n'); |
| 24 | 22 | ||
| 23 | var result: usize = 0; | ||
| 24 | // var result: isize = 0; | ||
| 25 | var timer = try std.time.Timer.start(); | 25 | var timer = try std.time.Timer.start(); |
| 26 | 26 | ||
| 27 | // for (0..50) |_| { | 27 | // for (0..50) |_| { |