Merge branch 'trunk' into no-implicit-zig-allocator

This commit is contained in:
Richard Feldman 2020-12-03 23:35:40 -05:00
commit f55af7282c
20 changed files with 944 additions and 752 deletions

View file

@ -4,7 +4,7 @@ const expectEqual = std.testing.expectEqual;
// This whole module is a translation of grapheme breaks from
// the https://github.com/JuliaStrings/utf8proc library.
// Thanks so much to those developer!
// Thanks so much to those developers!
//
// The only function this file exposes is `isGraphemeBreak`
//

View file

@ -19,18 +19,21 @@ comptime {
exportStrFn(str.countSegments, "count_segments");
exportStrFn(str.countGraphemeClusters, "count_grapheme_clusters");
exportStrFn(str.startsWith, "starts_with");
exportStrFn(str.strConcat, "concat");
exportStrFn(str.endsWith, "ends_with");
exportStrFn(str.strConcatC, "concat");
exportStrFn(str.strNumberOfBytes, "number_of_bytes");
exportStrFn(str.strFromIntC, "from_int");
}
// Export helpers - Must be run inside a comptime
fn exportBuiltinFn(comptime fn_target: anytype, comptime fn_name: []const u8) void {
@export(fn_target, .{ .name = "roc_builtins." ++ fn_name, .linkage = .Strong });
fn exportBuiltinFn(comptime func: anytype, comptime funcName: []const u8) void {
@export(func, .{ .name = "roc_builtins." ++ funcName, .linkage = .Strong });
}
fn exportNumFn(comptime fn_target: anytype, comptime fn_name: []const u8) void {
exportBuiltinFn(fn_target, "num." ++ fn_name);
fn exportNumFn(comptime func: anytype, comptime funcName: []const u8) void {
exportBuiltinFn(func, "num." ++ funcName);
}
fn exportStrFn(comptime fn_target: anytype, comptime fn_name: []const u8) void {
exportBuiltinFn(fn_target, "str." ++ fn_name);
fn exportStrFn(comptime func: anytype, comptime funcName: []const u8) void {
exportBuiltinFn(func, "str." ++ funcName);
}
// Run all tests in imported modules

File diff suppressed because it is too large Load diff