Add C and C++ library support

import "zlib.h" reads the header (cc -E + a small C declaration
parser), links via pkg-config or link "name", and builds .c/.cpp
files next to the program. C structs become Dino structs, pointers
become pointer types (nil = NULL), T* parameters take variables or
lists. Adds dino header, editor completion/hover for C names,
docs chapter 13, a raylib example, and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Your NameandClaude Opus 5.5 committed 2026-11-08 12:55:41 +01:00
1 parent 5b42e2a3bd
commit 2f44f09b6a
26 files changed
+3418 -70

No files matched your search

+9
View File
@@ -104,3 +104,12 @@ fn doc_examples_are_stable() {
}
assert!(n > 20, "only {n} doc examples were formattable");
}
#[test]
fn step_as_a_name_and_c_imports() {
let src = "import \"raylib.h\" { Color,RED }\nimport \"zlib.h\" link \"z\"\n\nfunc step(dt: f32) {}\n\nfunc main() {\n step(1.0)\n for i in 0..10 step 2 { print(i) }\n}\n";
assert_eq!(
fmt(src),
"import \"raylib.h\" { Color, RED }\nimport \"zlib.h\" link \"z\"\n\nfunc step(dt: f32) {}\n\nfunc main() {\n step(1.0)\n for i in 0..10 step 2 { print(i) }\n}\n"
);
}