dimgigov
3b4456f01f
selfhost: expand Decl to 256 fields, fix unary precedence, add discard/var parsing, fix diag buffer overflow
...
- ast.bux: Decl expanded with field0..field255, variant0..7, param0..8
- parser.bux: add parserParseUnary for correct unary precedence; handle tkDiscard statements; allow var without initializer (matching bootstrap); add diagCount bounds check in parserEmitDiag
- hir.bux: HirParam changed to pointers
- hir_lower.bux: full field chains for struct lowering
- c_backend.bux: hardened -> vs . field access; null checks in CBE_GetExprTypeName
- cli.bux: add -lcrypto to linker
2026-06-07 14:58:23 +03:00
dimgigov
0bdef58182
selfhost: fix pointer field access, algebraic enums, string literal escaping
...
- hir_lower: use per-function scope instead of global scope for params
fixes p->error emission for pointer parameters
- parser: assign variant4..variant7 in enum decls (was only 0..3)
- c_backend: escape quotes, backslash, newline, tab, cr in string literals
- runtime: bux_write_file now writes raw bytes (was un-escaping sequences)
- c_backend: emit algebraic enums as tagged unions (tag enum + data union + struct)
- hir_lower: add hBreak/hContinue lowering
- sema: skip empty variant names when collecting enum globals
2026-06-06 23:54:09 +03:00
dimgigov
aff03ffb5a
fix(selfhost): resolve all sema errors — 0 undeclared identifiers
...
- Add forward declarations for mutually-recursive parser functions
(parserParseExpr, parserParseStmt, parserParseBlock,
parserParsePrimary, parserParsePostfixExpr, parserParseBinaryPrec)
- Fix HIR lowering: skip forward decls (refBody==null) to avoid
duplicate function entries and array overflow
- Bump funcs/externFuncs array size 256→512 to handle large modules
- Update PLAN.md with progress
Sema: 0 errors (was 7, then 2, now 0)
Remaining: C backend struct ordering (pre-existing, Iter/StringBuilder)
2026-06-06 05:34:19 +03:00
dimgigov
ac969b37c1
v0.3.0: restructure directories
...
- src/ ← compiler/selfhost/ (canonical Bux compiler)
- bootstrap/ ← compiler/bootstrap/ (Nim bootstrap)
- lib/ ← library/std/ (standard library)
- rt/ ← library/runtime/ (C runtime)
- tests/ ← compiler/tests/ (unit tests)
- Remove _selfhost/ (built into build/selfhost/ now)
- Update all path references (Makefile, cli.nim, cli.bux, docs)
- Bump version to 0.3.0
2026-06-06 04:53:39 +03:00