diff options
| author | Baitinq <[email protected]> | 2025-06-04 22:45:31 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-06-04 22:45:31 +0200 |
| commit | e9e453f1571acde76f15d7e40a8d1e06cfb8e1b5 (patch) | |
| tree | 64762e6b8000ebca047aed56721a47c190c1ccb6 | |
| parent | Bootstrap: Codegen: Initialize all targets (diff) | |
| download | pry-lang-e9e453f1571acde76f15d7e40a8d1e06cfb8e1b5.tar.gz pry-lang-e9e453f1571acde76f15d7e40a8d1e06cfb8e1b5.tar.bz2 pry-lang-e9e453f1571acde76f15d7e40a8d1e06cfb8e1b5.zip | |
std: Add assert impl
| -rw-r--r-- | std/stdlib.src | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/std/stdlib.src b/std/stdlib.src index 004c249..90e28d6 100644 --- a/std/stdlib.src +++ b/std/stdlib.src @@ -1,4 +1,5 @@ extern printf = (*i8, varargs) => void; +extern exit = (i64) => void; /* TODO: This has a bug (with varargs i think) */ let println = (str: *i8, args: varargs) => void { @@ -78,3 +79,12 @@ let iswhitespace = (c: i8) => bool { return false; }; + +let assert = (cond: bool) => void { + if !cond { + println("UNREACHABLE"); + exit(1); + }; + + return; +}; |