UnitParser
Defined in: packages/speculator/src/parse/types.ts:22
Interface for format-specific unit parsers
Both markdown and HTML parsers implement this interface, allowing the orchestrator to route units to the correct parser.
Properties
Section titled “Properties”format
Section titled “format”
readonlyformat:SourceFormat
Defined in: packages/speculator/src/parse/types.ts:24
Format this parser handles
Methods
Section titled “Methods”parse()
Section titled “parse()”Call Signature
Section titled “Call Signature”Defined in: packages/speculator/src/parse/types.ts:37
Parse a final composed string into AST blocks using a source mapper for location tracking.
Overload 1: New API with content string and SourceMapper Overload 2: Legacy API with SourceUnit-like object (backwards compat for tests)
Parameters
Section titled “Parameters”content
Section titled “content”string
Full composed source string
sourceMapper
Section titled “sourceMapper”SourceMapper
Mapper to resolve absolute offsets to original files
Returns
Section titled “Returns”Array of top-level blocks/sections
Call Signature
Section titled “Call Signature”Defined in: packages/speculator/src/parse/types.ts:38
Parameters
Section titled “Parameters”content
Section titled “content”string
string
format
Section titled “format”string
sideFiles?
Section titled “sideFiles?”Record<string, string>
startLine
Section titled “startLine”number