fix: selfhost CLI run command, lexer char literal, parser test path, calloc in runtime

- Fix lexer unterminated char error test (was treating 'a as lifetime)
- Fix parser test sample.bux path for root-dir execution
- Add bux_system() to runtime.c and run command to selfhost CLI
- Switch bux_alloc from malloc to calloc for zero-init
- Fix module flattening in Cli_Check/Cli_Compile to scan full decl list
- Make test passes fully, selfhost builds successfully
This commit is contained in:
2026-06-02 00:50:16 +03:00
parent 2b911410cb
commit 975cc347d0
7 changed files with 93 additions and 12 deletions
+2
View File
@@ -553,6 +553,8 @@ proc nextToken(lex: var Lexer): Token =
# Simple heuristic: if peek(2) is ', it's a char literal; else lifetime
if lex.peek(2) == '\'':
return lex.scanChar(startLoc, 0)
elif lex.peek(2) == '\0':
return lex.scanChar(startLoc, 0)
else:
# Lifetime: consume ' and then identifier chars
discard lex.advance() # '