summaryrefslogtreecommitdiff
path: root/src/code_point.zig
diff options
context:
space:
mode:
authorGravatar Sam Atman2025-05-12 15:22:37 -0400
committerGravatar Sam Atman2025-05-15 15:31:16 -0400
commitcf8d8fe5d640511f6c4134fdaa36e930232ca7da (patch)
tree410a3c5195ea0780b637f740ebcb6e80e63db09c /src/code_point.zig
parentImplement Word iterator (diff)
downloadzg-cf8d8fe5d640511f6c4134fdaa36e930232ca7da.tar.gz
zg-cf8d8fe5d640511f6c4134fdaa36e930232ca7da.tar.xz
zg-cf8d8fe5d640511f6c4134fdaa36e930232ca7da.zip
Begin conformance test
I'm not sure the details of this strategy can actually be made to work. But, something can.
Diffstat (limited to 'src/code_point.zig')
-rw-r--r--src/code_point.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/code_point.zig b/src/code_point.zig
index b3c9aea..79ee5cd 100644
--- a/src/code_point.zig
+++ b/src/code_point.zig
@@ -10,6 +10,11 @@ pub const CodePoint = struct {
10 code: u21, 10 code: u21,
11 len: u3, 11 len: u3,
12 offset: u32, 12 offset: u32,
13
14 /// Return the slice of this codepoint, given the original string.
15 pub fn bytes(cp: CodePoint, str: []const u8) []const u8 {
16 return str[cp.offset..][0..cp.len];
17 }
13}; 18};
14 19
15/// This function is deprecated and will be removed in a later release. 20/// This function is deprecated and will be removed in a later release.