Phase 2: Fix sema stub — add full function body type checking

- Iterate function body statements and call Sema_CheckStmt on each
- Add Sema_CheckBlock helper for child scope creation in if/while/for/loop blocks
- Extend Sema_CheckStmt to handle all statement kinds: skIf, skWhile, skDoWhile,
  skLoop, skFor, skMatch, skBreak, skContinue, skDecl, skReturn
- Extend Sema_CheckExpr with ekAssign, ekField, ekIndex, ekBlock, ekSelf
- Fix ekCall to resolve return type from function declaration
- Fix ekBinary to handle assignment operators (tkAssign, +=, -=, etc.)
- Add Sema_CollectGlobals handling for dkUse (imports), dkConst, dkEnum variants
- Add tkColonColon path parsing in parser (Color::Red)
- Add decl field to Symbol struct for function/type resolution
- Add Sema_ZeroInitSymbol helper to avoid garbage from uninitialized struct fields
- Fix concurrency.bux missing Task_Join import

All examples now pass buxc2 check. make selfhost succeeds.
This commit is contained in:
2026-06-05 14:07:38 +03:00
parent f0f94f30e1
commit 5ae85d5bd9
9 changed files with 667 additions and 20 deletions
+1
View File
@@ -1,5 +1,6 @@
import Std::Io::{PrintLine, PrintInt};
import Std::Task::TaskHandle;
import Std::Task::Task_Join;
import Std::Channel::Channel;
func Worker(arg: *void) -> *void {