export class SourceMapBuilder {
    currentKey = "";
    map = {};
    enterScope(moduleId, scopeName) {
        this.currentKey = `${moduleId}:${scopeName}`;
        if (!this.map[this.currentKey]) {
            this.map[this.currentKey] = {};
        }
    }
    record(subStepPath, loc) {
        if (!loc || !this.currentKey)
            return;
        this.map[this.currentKey][subStepPath.join(".")] = { line: loc.line, col: loc.col };
    }
    build() {
        return structuredClone(this.map);
    }
}
