Expand description
Source map: tracks JS source locations → generated Zig line numbers.
Two output formats:
- Inline comments:
// @src(file.js:42)embedded in generated Zig - JSON mapping file:
{ "mappings": [...] }for tooling
Structs§
- Line
Index - Pre-computed line-start byte offsets for O(log n) byte→line lookup.
- Source
Map - Accumulated source map for a single JS→Zig translation.
- Source
Mapping - A single mapping entry: one Zig output line ↔ one JS source location.
Functions§
- count_
lines - Count newlines in a string to determine the current 1-based line number. The line after the last newline is the current line being written.