mclangc/include/util.mcl
MCorange 7e46c07cca Finalising functions
typechecking still buggy, but close enough cause i cant handle any more
typechecker dev

added:
 - Functions
 - Constants
 - Better file positions for error reporting
 - Better error reporting, with examples being drawn in term

-MC
2023-04-13 00:34:08 +03:00

15 lines
302 B
Plaintext

// Assert implementation
// args: [condition, str_len, str_ptr]
// @arg condition: Bool
// @arg str_len: Int
// @arg str_ptr: Ptr
// @ret NULL/NEVER
fn assert with bool int ptr returns void then
rot
if else
"Assert failed: \"" eputs eputs
"\". Exiting!\n" eputs
1 exit
end
done