SourceUnit
Defined in: preprocess/types.ts:64
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.
Properties
Section titled “Properties”content
Section titled “content”content:
string
Defined in: preprocess/types.ts:72
Raw content (not the entire file if split at includes)
displayFile?
Section titled “displayFile?”
optionaldisplayFile:string
Defined in: preprocess/types.ts:78
Display-friendly file path for error messages (e.g., relative to spec root)
file:
string
Defined in: preprocess/types.ts:66
Canonical file path
format
Section titled “format”format:
SourceFormat
Defined in: preprocess/types.ts:69
Content format
startLine
Section titled “startLine”startLine:
number
Defined in: preprocess/types.ts:84
1-indexed line number where this unit’s content starts in the source file. Used to compute accurate sourcePos for parsed AST nodes.