feat: multi-instance closures, richer stdlib, and Rust-style diagnostics
Introduce fat function pointers (BuxFn {code, env}) so capturing closures
are heap-allocated per value in both bootstrap and selfhost. Expand
Array/Map/Set/String/Test/Result APIs, add proper tuple codegen and
error snippets with multi-char underlines, golden diagnostic tests, and
LSP diagnostics via buxc check.
This commit is contained in:
@@ -399,6 +399,15 @@ func parserParsePrimary(p: *Parser) -> *Expr {
|
||||
return parserParseClosure(p);
|
||||
}
|
||||
|
||||
// unsafe { ... } — unsafe block expression
|
||||
if kind == tkUnsafe {
|
||||
discard parserAdvance(p);
|
||||
let e: *Expr = parserMakeExpr(ekBlock, line, col);
|
||||
e.boolValue = true; // marks this block as unsafe
|
||||
e.refBlock = parserParseBlock(p);
|
||||
return e;
|
||||
}
|
||||
|
||||
parserEmitDiag(p, line, col, "expected expression");
|
||||
return parserMakeExpr(ekLiteral, line, col);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user