Files
bux-lang/tests/test_parse_ast.nim
dimgigov 2698ca92b7 fix(selfhost): stdlib path + merge all modules, not just imports
- Fix Cli_FindStdlibDir: search for lib/ instead of stdlib/
- Fix Cli_CollectStdlibImports → merge ALL lib/*.bux via bux_list_dir
- Fix Cli_CollectStdlibImports path: remove Std/ subdir (now flat)
- Add ../../ fallback for rt/ paths (build/selfhost depth)
- Update PLAN.md with v0.3.0 structure + v1.0.0 roadmap
- Remaining: 7 sema cross-module resolution bugs (pre-existing)
2026-06-06 05:02:48 +03:00

17 lines
594 B
Nim

import "../bootstrap/lexer", "../bootstrap/parser", "../bootstrap/ast", "../bootstrap/token"
import std/os
let source = readFile("../src/ast.bux")
let lexRes = tokenize(source, "ast.bux")
echo "Tokens: ", lexRes.tokens.len
echo "Errors: ", lexRes.hasErrors
let res = parse(lexRes.tokens, "ast.bux")
if res.module == nil:
echo "Parse failed, diagnostics: ", res.diagnostics.len
for d in res.diagnostics:
echo " ", d.message
else:
echo "Parsed OK, items: ", res.module.items.len
for i, decl in res.module.items:
echo "Decl ", i, " kind=", decl.kind, " name=", decl.declFuncName