mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-14 01:55:00 +00:00
11 lines
477 B
Zig
11 lines
477 B
Zig
const std = @import("std");
|
|
const builtin = @import("builtin");
|
|
const RocStr = @import("str.zig").RocStr;
|
|
|
|
// An optional debug impl to be called during `roc test`
|
|
pub fn dbg_impl(loc: *const RocStr, msg: *const RocStr, src: *const RocStr) callconv(.C) void {
|
|
if (builtin.target.cpu.arch != .wasm32) {
|
|
const stderr = std.io.getStdErr().writer();
|
|
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
|
}
|
|
}
|