mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +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();
|
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();
|
const str_len = string.len();
|
||||||
|
|
||||||
if (str_len == 0) {
|
if (str_len == 0) {
|
||||||
|
@ -676,7 +681,6 @@ test "strToScalars: Multiple 4-byte UTF-8 characters" {
|
||||||
try expect(RocList.eql(actual, expected));
|
try expect(RocList.eql(actual, expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Str.fromInt
|
// Str.fromInt
|
||||||
pub fn exportFromInt(comptime T: type, comptime name: []const u8) void {
|
pub fn exportFromInt(comptime T: type, comptime name: []const u8) void {
|
||||||
comptime var f = struct {
|
comptime var f = struct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue