Refactored interpreter into just functions, added a REPL to the main kraken.

This commit is contained in:
Nathan Braswell
2016-07-03 15:32:45 -07:00
parent 87c2b1d2c1
commit 6fee942756
8 changed files with 846 additions and 896 deletions

View File

@@ -20,6 +20,14 @@ fun error(message: string::string) {
io::printlnerr(message)
os::exit(-1)
}
fun assert(works: bool, message: *char) {
if (!works)
error(message)
}
fun assert(works: bool, message: string::string) {
if (!works)
error(message)
}
fun deref_equality<T>(a: *T, b: *T): bool {
if ( (a && b && !(*a == *b)) || (a && !b) || (!a && b) )