diff options
| -rw-r--r-- | NEWS.md | 3 | ||||
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | build.zig | 7 | ||||
| -rw-r--r-- | src/code_point.zig | 6 |
4 files changed, 7 insertions, 13 deletions
| @@ -10,7 +10,8 @@ kept in static memory, where it should be. | |||
| 10 | 10 | ||
| 11 | With compression gone in the last release, the inconvenience and startup | 11 | With compression gone in the last release, the inconvenience and startup |
| 12 | penalty of moving the data, already present _in_ static memory, over to | 12 | penalty of moving the data, already present _in_ static memory, over to |
| 13 | the heap, was purely wasted effort. Just CPU head. So that's gone. | 13 | the heap, was purely wasted effort. Just CPU heat and extra clock time. |
| 14 | So that's gone. | ||
| 14 | 15 | ||
| 15 | 90% of the work here was done by Jacob Sandlund, who went on to write | 16 | 90% of the work here was done by Jacob Sandlund, who went on to write |
| 16 | his own rather interesting Unicode library, [uucode][uucode], which you | 17 | his own rather interesting Unicode library, [uucode][uucode], which you |
| @@ -579,7 +579,7 @@ const Scripts = @import("Scripts"); | |||
| 579 | 579 | ||
| 580 | test "Scripts" { | 580 | test "Scripts" { |
| 581 | // To see the full list of Scripts, look at the | 581 | // To see the full list of Scripts, look at the |
| 582 | // `src/Scripts.zig` file. They are list in an enum. | 582 | // `src/Scripts.zig` file. They are listed as an enum. |
| 583 | try expect(Scripts.script('A') == .Latin); | 583 | try expect(Scripts.script('A') == .Latin); |
| 584 | try expect(Scripts.script('Ω') == .Greek); | 584 | try expect(Scripts.script('Ω') == .Greek); |
| 585 | try expect(Scripts.script('צ') == .Hebrew); | 585 | try expect(Scripts.script('צ') == .Hebrew); |
| @@ -621,7 +621,7 @@ the fragment (`CodePoint` uses a `u3` for length, actually). | |||
| 621 | 4GiB is a lot of string. There are a few reasons to work with that much | 621 | 4GiB is a lot of string. There are a few reasons to work with that much |
| 622 | string, log files primarily, but fewer to bring it all into memory at | 622 | string, log files primarily, but fewer to bring it all into memory at |
| 623 | once, and practically no reason at all to do anything to such a string | 623 | once, and practically no reason at all to do anything to such a string |
| 624 | without breaking it into smaller piece to work with. | 624 | without breaking it into smaller pieces to work with. |
| 625 | 625 | ||
| 626 | Also, Zig compiles on 32 bit systems, where `usize` is a `u32`. Code | 626 | Also, Zig compiles on 32 bit systems, where `usize` is a `u32`. Code |
| 627 | running on such systems has no choice but to handle slices in smaller | 627 | running on such systems has no choice but to handle slices in smaller |
| @@ -532,13 +532,6 @@ pub fn build(b: *std.Build) void { | |||
| 532 | 532 | ||
| 533 | const run_unicode_tests = b.addRunArtifact(unicode_tests); | 533 | const run_unicode_tests = b.addRunArtifact(unicode_tests); |
| 534 | 534 | ||
| 535 | const test_unicode_step = b.step("unicode", "Rune unicode tests"); | ||
| 536 | test_unicode_step.dependOn(&run_unicode_tests.step); | ||
| 537 | test_unicode_step.dependOn(&display_width_tr.step); | ||
| 538 | test_unicode_step.dependOn(&words_tr.step); | ||
| 539 | test_unicode_step.dependOn(&norm_tr.step); | ||
| 540 | test_unicode_step.dependOn(&case_fold_tr.step); | ||
| 541 | |||
| 542 | const test_step = b.step("test", "Run all module tests"); | 535 | const test_step = b.step("test", "Run all module tests"); |
| 543 | test_step.dependOn(&run_unicode_tests.step); | 536 | test_step.dependOn(&run_unicode_tests.step); |
| 544 | test_step.dependOn(&code_point_tr.step); | 537 | test_step.dependOn(&code_point_tr.step); |
diff --git a/src/code_point.zig b/src/code_point.zig index 5f6c61c..2332c8b 100644 --- a/src/code_point.zig +++ b/src/code_point.zig | |||
| @@ -31,7 +31,7 @@ pub const CodePoint = struct { | |||
| 31 | /// Use `decodeAtIndex` or `decodeAtCursor`. | 31 | /// Use `decodeAtIndex` or `decodeAtCursor`. |
| 32 | pub fn decode(bytes: []const u8, offset: uoffset) ?CodePoint { | 32 | pub fn decode(bytes: []const u8, offset: uoffset) ?CodePoint { |
| 33 | _ = .{ bytes, offset }; | 33 | _ = .{ bytes, offset }; |
| 34 | @compileError("decode has been removed, use `decodeAtIndex`."); | 34 | @compileError("decode has been removed, use `decodeAtIndex` or `decodeAtCursor`."); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | /// Return the codepoint at `index`, even if `index` is in the middle | 37 | /// Return the codepoint at `index`, even if `index` is in the middle |
| @@ -211,8 +211,8 @@ pub const Iterator = struct { | |||
| 211 | // speed increase in exchange. | 211 | // speed increase in exchange. |
| 212 | // | 212 | // |
| 213 | // Credit for the algorithm goes to Björn Höhrmann, who wrote it up at | 213 | // Credit for the algorithm goes to Björn Höhrmann, who wrote it up at |
| 214 | // https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ . The original | 214 | // https://bjoern.hoehrmann.de/utf-8/decoder/dfa/. The license to the |
| 215 | // license may be found in the ./credits folder. | 215 | // original code may be found in the ./credits folder. |
| 216 | // | 216 | // |
| 217 | 217 | ||
| 218 | /// Successful codepoint parse | 218 | /// Successful codepoint parse |