libs working
This commit is contained in:
15
examples/math/.build/manifest.json
Normal file
15
examples/math/.build/manifest.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"version": 1,
|
||||
"modules": [
|
||||
{
|
||||
"name": "math",
|
||||
"customTypes": {},
|
||||
"identifiers": {
|
||||
"add": {
|
||||
"encodedType": "F(I(32),I(32),I(32))",
|
||||
"exported": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -12,10 +12,10 @@ struct nub_core_string
|
||||
|
||||
|
||||
|
||||
int32_t nub_math_add_cc3fc9d68812b10d(int32_t, int32_t);
|
||||
int32_t nub_math_add_500748c2c6d70959(int32_t, int32_t);
|
||||
|
||||
|
||||
int32_t nub_math_add_cc3fc9d68812b10d(int32_t a, int32_t b)
|
||||
int32_t nub_math_add_500748c2c6d70959(int32_t a, int32_t b)
|
||||
{
|
||||
{
|
||||
return (a + b);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
examples/program/.build/out
Executable file
BIN
examples/program/.build/out
Executable file
Binary file not shown.
29
examples/program/.build/out.c
Normal file
29
examples/program/.build/out.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <float.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct nub_core_string
|
||||
{
|
||||
const char *data;
|
||||
int length;
|
||||
};
|
||||
|
||||
|
||||
|
||||
extern int32_t nub_math_add_500748c2c6d70959(int32_t, int32_t);
|
||||
int32_t nub_main_main_55882df37f903935();
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return nub_main_main_55882df37f903935();
|
||||
}
|
||||
|
||||
int32_t nub_main_main_55882df37f903935()
|
||||
{
|
||||
{
|
||||
return nub_math_add_500748c2c6d70959(1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ module main
|
||||
|
||||
func main(): i32
|
||||
{
|
||||
return math::add(1, 2)
|
||||
return math::add(1 2)
|
||||
}
|
||||
32
examples/test/test.nub
Normal file
32
examples/test/test.nub
Normal file
@@ -0,0 +1,32 @@
|
||||
module main
|
||||
|
||||
let global: i32
|
||||
|
||||
func main(): i32 {
|
||||
let x: i32 = 23
|
||||
x = 24
|
||||
|
||||
if !true {
|
||||
x = 49
|
||||
return x
|
||||
} else {
|
||||
x = 3
|
||||
}
|
||||
|
||||
let i: i32 = 0
|
||||
|
||||
x = 1 + 2 * 34
|
||||
while i < 10 {
|
||||
i = i + 1
|
||||
x = i
|
||||
}
|
||||
|
||||
let me: test::person = struct test::person { age = 21 name = "Oliver" }
|
||||
|
||||
x = test::do_something(me.name)
|
||||
test::do_something(me.name)
|
||||
|
||||
main::global = 123
|
||||
|
||||
return main::global
|
||||
}
|
||||
10
examples/test/test2.nub
Normal file
10
examples/test/test2.nub
Normal file
@@ -0,0 +1,10 @@
|
||||
module test
|
||||
|
||||
export packed struct person {
|
||||
age: i32
|
||||
name: string
|
||||
}
|
||||
|
||||
export func do_something(name: string): i32 {
|
||||
return 3
|
||||
}
|
||||
Reference in New Issue
Block a user