extern
This commit is contained in:
@@ -10,4 +10,6 @@ popd
|
||||
|
||||
pushd program
|
||||
dotnet run --project ../../compiler main.nub ../math/.build/out.nublib ../core/.build/out.nublib
|
||||
popd
|
||||
popd
|
||||
|
||||
./program/.build/out
|
||||
@@ -1,6 +1,11 @@
|
||||
module print
|
||||
module core
|
||||
|
||||
extern func puts(^u8 text)
|
||||
export extern func malloc(size: u64): ^void
|
||||
export extern func free(size: ^void)
|
||||
|
||||
export func print(text: string) {
|
||||
extern func puts(text: ^u8)
|
||||
|
||||
export func print(text: string)
|
||||
{
|
||||
puts(text.ptr)
|
||||
}
|
||||
@@ -1,17 +1,9 @@
|
||||
module main
|
||||
|
||||
struct Pos {
|
||||
x: i32
|
||||
y: i32
|
||||
}
|
||||
|
||||
func main(): i32
|
||||
{
|
||||
test({ x = 23 y = 23 })
|
||||
|
||||
return 1
|
||||
core::print("Hello, world")
|
||||
let ptr = core::malloc(64)
|
||||
core::free(ptr)
|
||||
return 0
|
||||
}
|
||||
|
||||
func test(x: Pos): void
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user