...
This commit is contained in:
8
example/compile.sh
Executable file
8
example/compile.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
object_files=$(dotnet run --project ../src/compiler/CLI/CLI.csproj src/main.nub src/c.nub)
|
||||
|
||||
echo $object_files
|
||||
|
||||
mkdir -p bin
|
||||
gcc -o bin/out $object_files
|
||||
BIN
example/lib/libruntime_x64.a
Normal file
BIN
example/lib/libruntime_x64.a
Normal file
Binary file not shown.
@@ -1,43 +0,0 @@
|
||||
namespace main
|
||||
|
||||
struct Human {
|
||||
name: cstring
|
||||
}
|
||||
|
||||
export func main(args: []cstring): i64 {
|
||||
// let human: Human
|
||||
|
||||
// human = alloc Human {
|
||||
// name = "member"
|
||||
// }
|
||||
|
||||
// c::puts(human.name)
|
||||
|
||||
// c::puts("literal")
|
||||
|
||||
// let x: cstring
|
||||
|
||||
// x = "variable"
|
||||
|
||||
// c::puts(x)
|
||||
|
||||
// let y: func(cstring)
|
||||
|
||||
// y = c::puts
|
||||
|
||||
// y("proxy")
|
||||
|
||||
// func(){ c::puts("anon") }()
|
||||
|
||||
// let z: func()
|
||||
|
||||
// z = func() { c::puts("anon variable") }
|
||||
|
||||
// z()
|
||||
|
||||
c::printf("%d\n", "test".count)
|
||||
|
||||
// c::puts("test")
|
||||
|
||||
return 0
|
||||
}
|
||||
6
example/src/main.nub
Normal file
6
example/src/main.nub
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace main
|
||||
|
||||
export func main(args: []cstring): i64 {
|
||||
c::puts("test")
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user