Skip to content

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.

content: string

Defined in: preprocess/types.ts:72

Raw content (not the entire file if split at includes)


optional displayFile: 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: SourceFormat

Defined in: preprocess/types.ts:69

Content format


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.