...
This commit is contained in:
11
examples/build.sh
Executable file
11
examples/build.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
pushd math
|
||||
|
||||
dotnet run --project ../../compiler math.nub --type=lib
|
||||
|
||||
popd
|
||||
|
||||
pushd program
|
||||
|
||||
dotnet run --project ../../compiler main.nub ../math/.build/out.nublib
|
||||
|
||||
popd
|
||||
BIN
examples/math/.build/out.a
Normal file
BIN
examples/math/.build/out.a
Normal file
Binary file not shown.
24
examples/math/.build/out.c
Normal file
24
examples/math/.build/out.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <float.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct nub_core_string
|
||||
{
|
||||
const char *data;
|
||||
int length;
|
||||
};
|
||||
|
||||
|
||||
|
||||
int32_t nub_math_add_cc3fc9d68812b10d(int32_t, int32_t);
|
||||
|
||||
|
||||
int32_t nub_math_add_cc3fc9d68812b10d(int32_t a, int32_t b)
|
||||
{
|
||||
{
|
||||
return (a + b);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
examples/math/.build/out.nublib
Normal file
BIN
examples/math/.build/out.nublib
Normal file
Binary file not shown.
BIN
examples/math/.build/out.o
Normal file
BIN
examples/math/.build/out.o
Normal file
Binary file not shown.
6
examples/math/math.nub
Normal file
6
examples/math/math.nub
Normal file
@@ -0,0 +1,6 @@
|
||||
module math
|
||||
|
||||
export func add(a: i32 b: i32): i32
|
||||
{
|
||||
return a + b
|
||||
}
|
||||
6
examples/program/main.nub
Normal file
6
examples/program/main.nub
Normal file
@@ -0,0 +1,6 @@
|
||||
module main
|
||||
|
||||
func main(): i32
|
||||
{
|
||||
return math::add(1, 2)
|
||||
}
|
||||
Reference in New Issue
Block a user