From d208dc030fe068ff8a40ed49444536736b4b45d6 Mon Sep 17 00:00:00 2001 From: Waozi Date: Mon, 2 Nov 2026 04:37:45 -0300 Subject: [PATCH] Align the Kryon package graph and retain C++ host validation --- README.md | 1 + tests/css_export_test.sh | 15 +++++++++------ ziran.lock | 19 ++++++++++++++----- ziran.toml | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dc84460..0679856 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ by Kryon widget props. The exporter shares the parser, token resolution and environment rules; widget/class/state selectors become scoped DOM selectors, numeric units and axis properties are expanded, and media conditions survive. Source and saved IR run on C, C++ and Go in `tests/css_export_test.sh`. +The C++ host compiles Ziran's generated C output as C++17. The current export subset rejects unresolved imports, KSS layers, nested selector functions, native materials, unknown foreign blocks and output diff --git a/tests/css_export_test.sh b/tests/css_export_test.sh index 8246a3a..2328878 100755 --- a/tests/css_export_test.sh +++ b/tests/css_export_test.sh @@ -17,19 +17,22 @@ for source in source saved; do if [ "$source" = saved ]; then input=$build/ir/css_export_behavior.zir; root=$build/ir; fi for target in c cpp go; do output=$build/$source-$target + backend=$target + # C++ hosts compile the supported C output; Ziran has no C++ backend. + if [ "$target" = cpp ]; then backend=c; fi "$ziran" build --root "$root" --module-path src --module-path "kryon=$kryon/src/ui" \ --module-path "$toolchain/std" --module-path "$build/ir" --no-main \ - --target="$target" --entry css_export_behavior:Answer -o "$output" "$input" + --target="$backend" --entry css_export_behavior:Answer -o "$output" "$input" if [ "$target" = go ]; then rm -f "$output/driver.go" printf 'package ziran\nimport "testing"\nfunc TestCSSExport(t *testing.T) { if CssExportBehavior_Answer() != 42 { t.Fatal("CSS export") } }\n' >"$output/driver_test.go" (cd "$output" && GO111MODULE=off go test .) else - compiler=${CC:-cc}; suffix=c; header=h; standard=c11 - if [ "$target" = cpp ]; then compiler=${CXX:-c++}; suffix=cpp; header=hpp; standard=c++17; fi - printf '#include "css_export_behavior.%s"\nint main(void) { return Answer() == 42 ? 0 : 1; }\n' "$header" >"$output/driver.$suffix" - "$compiler" -std="$standard" -O2 -I"$toolchain/include" -I"$output" \ - "$output"/*."$suffix" -o "$output/run" + compiler=${CC:-cc}; language=c; standard=c11 + if [ "$target" = cpp ]; then compiler=${CXX:-c++}; language=c++; standard=c++17; fi + printf '#include "css_export_behavior.h"\nint main(void) { return Answer() == 42 ? 0 : 1; }\n' >"$output/driver.c" + "$compiler" -x "$language" -std="$standard" -O2 -I"$toolchain/include" -I"$output" \ + "$output"/*.c -o "$output/run" "$output/run" fi done diff --git a/ziran.lock b/ziran.lock index 6eb3f01..960d190 100644 --- a/ziran.lock +++ b/ziran.lock @@ -11,16 +11,25 @@ "url": "https://github.com/raysan5/raylib.git" }, { - "commit": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68", - "dependencies": {"raylib": "p5a77c9c35110e925"}, - "id": "pfa65f8437b3d3740", + "commit": "1844042d1ca751e62e61df7617dba19c98588339", + "dependencies": {}, + "id": "p651a2c7a393977c0", + "name": "libwebp", + "ref": "1844042d1ca751e62e61df7617dba19c98588339", + "source": true, + "url": "https://github.com/webmproject/libwebp.git" + }, + { + "commit": "7dc62902389544bf8d1fb3a159152cbd3b889c78", + "dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"}, + "id": "pcec085fc76d6fd7b", "name": "kryon", - "ref": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68", + "ref": "7dc62902389544bf8d1fb3a159152cbd3b889c78", "url": "https://github.com/kryonlabs/kryon.git" } ], "root": { - "dependencies": {"kryon": "pfa65f8437b3d3740"}, + "dependencies": {"kryon": "pcec085fc76d6fd7b"}, "name": "Kss" }, "toolchain": { diff --git a/ziran.toml b/ziran.toml index 374db8d..6d8e7b5 100644 --- a/ziran.toml +++ b/ziran.toml @@ -8,7 +8,7 @@ ref = "master" [dependencies.kryon] git = "https://github.com/kryonlabs/kryon.git" -ref = "f6299fa1c71a6d9930df7a9a725d1a571adcbc68" +ref = "7dc62902389544bf8d1fb3a159152cbd3b889c78" [exports] Kss = "src/Kss/module.zi"