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:
+2
-1
@@ -70,7 +70,8 @@ proc matchStr(lex: var Lexer, s: string): bool =
|
||||
return true
|
||||
|
||||
proc currentLocation(lex: Lexer): SourceLocation =
|
||||
result = SourceLocation(line: lex.line, column: lex.col, offset: uint32(lex.pos))
|
||||
result = SourceLocation(line: lex.line, column: lex.col, offset: uint32(lex.pos),
|
||||
file: lex.sourceName)
|
||||
|
||||
proc emitError(lex: var Lexer, loc: SourceLocation, message: string) =
|
||||
lex.diagnostics.add(LexerDiagnostic(severity: ldsError, loc: loc, message: message))
|
||||
|
||||
Reference in New Issue
Block a user