We have a VERY SILL KRAKEN COMPILER\! simple_passthroughs are now emitted by the c_generator and test_compiler has been extended to write the C to a file and then call cc on it, so the self-hosted Kraken compiler can compile its very first thing\! (though that thing is a hello world C program written entirely in a simple_passthrough...
This commit is contained in:
19
stdlib/os.krak
Normal file
19
stdlib/os.krak
Normal file
@@ -0,0 +1,19 @@
|
||||
import string:*
|
||||
import mem:*
|
||||
|
||||
fun system(call_string: string):int {
|
||||
var c_call_string = call_string.toCharArray()
|
||||
var result = system(c_call_string)
|
||||
delete(c_call_string)
|
||||
return result
|
||||
}
|
||||
fun system(call_string: *char): int {
|
||||
__if_comp__ __C__ {
|
||||
simple_passthrough(call_string::) """
|
||||
return system(call_string);
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user