This commit is contained in:
2026-02-08 18:43:50 +01:00
parent 4761cd1f83
commit 00714ea4b0
4 changed files with 154 additions and 26 deletions

View File

@@ -1,6 +1,11 @@
using Compiler;
const string contents = """
struct person {
age: i32
name: string
}
func main(): i32 {
let x: i32 = 23
x = 24
@@ -20,10 +25,12 @@ const string contents = """
x = i
}
do_something("test")
let me: person = struct person { age = 21 name = "Oliver" }
do_something(me.name)
return x
}
func do_something(text: string): void {
}
""";
@@ -32,4 +39,4 @@ var tokens = Tokenizer.Tokenize(contents);
var nodes = Parser.Parse(tokens);
var output = Generator.Emit(nodes);
File.WriteAllText("C:/Users/oliste/repos/nub-lang/compiler/Compiler/out.c", output);
File.WriteAllText("C:/Users/oliste/repos/nub-lang/compiler/Compiler/out.c", output);