...
This commit is contained in:
@@ -4,12 +4,8 @@ pushd core
|
||||
dotnet run --project ../../compiler mem.nub print.nub --type=lib
|
||||
popd
|
||||
|
||||
pushd math
|
||||
dotnet run --project ../../compiler math.nub --type=lib
|
||||
popd
|
||||
|
||||
pushd program
|
||||
dotnet run --project ../../compiler main.nub ../math/.build/out.nublib ../core/.build/out.nublib
|
||||
dotnet run --project ../../compiler main.nub ../core/.build/out.nublib
|
||||
popd
|
||||
|
||||
./program/.build/out
|
||||
@@ -1,44 +0,0 @@
|
||||
module math
|
||||
|
||||
export struct Human {
|
||||
name: string
|
||||
age: i32
|
||||
}
|
||||
|
||||
export struct Pos {
|
||||
x: i32
|
||||
y: i32
|
||||
}
|
||||
|
||||
export enum Message {
|
||||
Quit: {}
|
||||
Move: Pos
|
||||
}
|
||||
|
||||
let x: i32
|
||||
|
||||
export func add(a: i32 b: i32): i32
|
||||
{
|
||||
let x = "test"
|
||||
|
||||
let msg: Message = enum Message::Move {
|
||||
x = 10
|
||||
y = 10
|
||||
}
|
||||
|
||||
match msg {
|
||||
Quit q {
|
||||
// quit
|
||||
}
|
||||
Move m {
|
||||
// move
|
||||
}
|
||||
}
|
||||
|
||||
return add_internal(a b)
|
||||
}
|
||||
|
||||
func add_internal(a: i32 b: i32): i32
|
||||
{
|
||||
return a + b
|
||||
}
|
||||
Reference in New Issue
Block a user