Module system
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
module "main"
|
||||
import "test"
|
||||
|
||||
extern "puts" func puts(text: cstring)
|
||||
export extern "puts" func puts(text: cstring)
|
||||
|
||||
struct Human
|
||||
{
|
||||
name: cstring
|
||||
age: u64
|
||||
}
|
||||
|
||||
func main(args: []cstring): i64
|
||||
{
|
||||
puts("test")
|
||||
let me: main::Human = {
|
||||
name = "Oliver"
|
||||
age = 21
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ out: .build/out.o
|
||||
gcc -nostartfiles -o out x86_64.s .build/out.o
|
||||
|
||||
.build/out.o: $(NUBC) main.nub
|
||||
$(NUBC) main.nub module.nub
|
||||
$(NUBC) main.nub
|
||||
|
||||
.PHONY: $(NUBC)
|
||||
$(NUBC):
|
||||
|
||||
Reference in New Issue
Block a user