summaryrefslogtreecommitdiff
path: root/src/code_point.zig
diff options
context:
space:
mode:
authorGravatar Sam Atman2025-05-13 17:19:56 -0400
committerGravatar Sam Atman2025-05-15 15:32:38 -0400
commit5cc8c1875a21bfb398e6685b03a29d6ba1cbf74a (patch)
treef46287fbc0d92238644c23d0b176354567b647d1 /src/code_point.zig
parentReverse Word Iterator (diff)
downloadzg-5cc8c1875a21bfb398e6685b03a29d6ba1cbf74a.tar.gz
zg-5cc8c1875a21bfb398e6685b03a29d6ba1cbf74a.tar.xz
zg-5cc8c1875a21bfb398e6685b03a29d6ba1cbf74a.zip
Hooked up break test, some bugs squashed
The handling of ignorables is really different, because they 'adhere' to the future of the iteration, not the past.
Diffstat (limited to 'src/code_point.zig')
-rw-r--r--src/code_point.zig10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/code_point.zig b/src/code_point.zig
index a5b10d4..ba0b434 100644
--- a/src/code_point.zig
+++ b/src/code_point.zig
@@ -53,22 +53,12 @@ pub fn decodeAtCursor(bytes: []const u8, cursor: *u32) ?CodePoint {
53 }; 53 };
54 // Multibyte 54 // Multibyte
55 55
56<<<<<<< HEAD
57 // Second: 56 // Second:
58 var class: u4 = @intCast(u8dfa[byte]); 57 var class: u4 = @intCast(u8dfa[byte]);
59 var st: u32 = state_dfa[class]; 58 var st: u32 = state_dfa[class];
60 if (st == RUNE_REJECT or cursor.* == bytes.len) { 59 if (st == RUNE_REJECT or cursor.* == bytes.len) {
61 @branchHint(.cold); 60 @branchHint(.cold);
62 // First one is never a truncation 61 // First one is never a truncation
63||||||| parent of ad4b046 (Various small iterator improvements)
64 // Return replacement if we don' have a complete codepoint remaining. Consumes only one byte
65 if (cp.len > bytes.len) {
66 // Unicode replacement code point.
67=======
68 // Return replacement if we don't have a complete codepoint remaining. Consumes only one byte.
69 if (cp.len > bytes.len) {
70 // Unicode replacement code point.
71>>>>>>> ad4b046 (Various small iterator improvements)
72 return .{ 62 return .{
73 .code = 0xfffd, 63 .code = 0xfffd,
74 .len = 1, 64 .len = 1,