test: expand golden C-codegen tests from 2 to 8 examples

Add golden tests for: structs, generics, algebraic_enums, enums,
methods, strings. Each test captures the expected C output from the
bootstrap compiler for regression detection.

Also remove leftover 'PARSER FIX V2 ACTIVE' debug print from parser.bux.
This commit is contained in:
2026-06-09 15:58:44 +03:00
parent 3ed5891de2
commit 265bda850d
20 changed files with 29235 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
[Package]
Name = "structs"
Version = "0.1.0"
Type = "bin"
[Build]
Output = "Bin"
File diff suppressed because it is too large Load Diff
+29
View File
@@ -0,0 +1,29 @@
// Structs - Basic struct usage
import Std::Io::{PrintLine, PrintInt};
struct Point {
x: int;
y: int;
}
func AddPoints(a: Point, b: Point) -> Point {
let result: Point = Point { x: a.x + b.x, y: a.y + b.y };
return result;
}
func Main() -> int {
let p1: Point = Point { x: 10, y: 20 };
let p2: Point = Point { x: 5, y: 15 };
let sum: Point = AddPoints(p1, p2);
PrintLine("Point sum:");
PrintLine("x = ");
PrintInt(sum.x);
PrintLine("");
PrintLine("y = ");
PrintInt(sum.y);
PrintLine("");
return 0;
}