Files
bux-lang/bootstrap/source_location.nim
T
dimgigov 61ac06ab5f 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.
2026-07-15 16:00:21 +03:00

13 lines
405 B
Nim

type
SourceLocation* = object
line*: uint32 ## 1-based
column*: uint32 ## 1-based (UTF-8 byte offset in line)
offset*: uint32 ## byte offset from start of file
file*: string ## source file path (empty if unknown)
proc `$`*(loc: SourceLocation): string =
if loc.file.len > 0:
loc.file & ":" & $loc.line & ":" & $loc.column
else:
$loc.line & ":" & $loc.column