mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Export Str.toScalars from Zig
This commit is contained in:
parent
5f20d31617
commit
b1fe76adbf
1 changed files with 7 additions and 3 deletions
|
@ -467,8 +467,13 @@ pub fn strNumberOfBytes(string: RocStr) callconv(.C) usize {
|
|||
return string.len();
|
||||
}
|
||||
|
||||
// Str.toCodePts : Str -> List U32
|
||||
pub fn strToScalars(string: RocStr) callconv(.C) RocList {
|
||||
|
||||
// Str.toScalars
|
||||
pub fn strToScalarsC(str: RocStr) callconv(.C) RocList {
|
||||
return @call(.{ .modifier = always_inline }, strToScalars, .{ RocStr, str });
|
||||
}
|
||||
|
||||
fn strToScalars(string: RocStr) callconv(.C) RocList {
|
||||
const str_len = string.len();
|
||||
|
||||
if (str_len == 0) {
|
||||
|
@ -676,7 +681,6 @@ test "strToScalars: Multiple 4-byte UTF-8 characters" {
|
|||
try expect(RocList.eql(actual, expected));
|
||||
}
|
||||
|
||||
|
||||
// Str.fromInt
|
||||
pub fn exportFromInt(comptime T: type, comptime name: []const u8) void {
|
||||
comptime var f = struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue