code wiki / _hdl_build / nx_g_check_lib.nx

nx_g_check_lib.nx source

↩ module page · 5 lines · 444 B

1// nx_g_check_lib.nx -- single-responsibility shared helper: g_check (2-arg PASS/FAIL emitter). 2// Calls g_puts, so it imports nx_g_puts_lib. 3-arg or otherwise-divergent g_check bodies are VARIANT 3// (self-check refuses them). license_tier: ORIGINAL 4import "nx_g_puts_lib.nx" 5func g_check(name: *u8, cond: i64) -> i64 { if cond==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return cond }