feat: bux test runner, bitwise-not parsing, stdlib discovery hardening\n\n- Add 'bux test' runner: discovers tests/*.bux, builds each in a temp package, runs and reports PASS/FAIL.\n- Fix unary ~ parsing and C emission in self-hosted compiler.\n- Harden stdlib discovery (require Fs.bux, avoid system /lib) and lstat in directory traversal.\n- Selfhost loop passes: buxc2 builds src/ and produces identical C output + stripped binary.\n- Update PLAN.md with completed milestones.

This commit is contained in:
2026-06-12 22:19:13 +03:00
parent a668127721
commit 84df4bba9d
18 changed files with 21917 additions and 20942 deletions
+2 -2
View File
@@ -675,7 +675,7 @@ static int bux_count_files_recursive(const char* dir, const char* ext, size_t ex
if (!path) continue;
snprintf(path, path_len, "%s/%s", dir, entry->d_name);
struct stat st;
if (stat(path, &st) == 0) {
if (lstat(path, &st) == 0) {
if (S_ISDIR(st.st_mode)) {
count += bux_count_files_recursive(path, ext, ext_len);
} else {
@@ -702,7 +702,7 @@ static int bux_collect_files_recursive(const char* dir, const char* ext, size_t
if (!path) continue;
snprintf(path, path_len, "%s/%s", dir, entry->d_name);
struct stat st;
if (stat(path, &st) == 0) {
if (lstat(path, &st) == 0) {
if (S_ISDIR(st.st_mode)) {
idx = bux_collect_files_recursive(path, ext, ext_len, result, idx);
free(path);