ref
This commit is contained in:
6
examples/playgroud/build.sh
Executable file
6
examples/playgroud/build.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
obj=$(nubc main.nub)
|
||||
clang $obj ../../runtime/.build/runtime.o -o .build/out
|
||||
20
examples/playgroud/main.nub
Normal file
20
examples/playgroud/main.nub
Normal file
@@ -0,0 +1,20 @@
|
||||
module main
|
||||
|
||||
extern "puts" func puts(text: ^i8)
|
||||
|
||||
struct Human
|
||||
{
|
||||
age: u64
|
||||
name: ^i8
|
||||
}
|
||||
|
||||
extern "main" func main(argc: i64, argv: [?]^i8): i64
|
||||
{
|
||||
let x: &Human = {
|
||||
age = 23
|
||||
name = "test"
|
||||
}
|
||||
|
||||
puts(x^.name)
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user