Skip to content

SourceMapFragment

Defined in: packages/speculator/src/preprocess/types.ts:66

A unit of source content with its origin file

The preprocess stage splits content at include points to preserve sourcePos.file for each fragment. This enables accurate error reporting that points to the correct file. /** A fragment of the composed source mapping back to its origin file

optional displayFile: string

Defined in: packages/speculator/src/preprocess/types.ts:83

Display-friendly file path for error messages (e.g., relative to spec root)


endOffset: number

Defined in: packages/speculator/src/preprocess/types.ts:71

0-indexed end offset in the final composed string (exclusive)


file: string

Defined in: packages/speculator/src/preprocess/types.ts:74

Canonical file path from which this fragment originated


format: SourceFormat

Defined in: packages/speculator/src/preprocess/types.ts:77

Content format of this file


originalStartLine: number

Defined in: packages/speculator/src/preprocess/types.ts:89

1-indexed line number where this fragment’s content starts in its origin file. Used to compute accurate sourcePos for parsed AST nodes.


optional sideFiles: Record<string, string>

Defined in: packages/speculator/src/preprocess/types.ts:97

Pre-read sibling files keyed by canonical path.

Populated by the preprocess stage for files relevant to the parser (e.g. .ttl, .jsonld vocabulary files next to the source file).


startOffset: number

Defined in: packages/speculator/src/preprocess/types.ts:68

0-indexed start offset in the final composed string