Skip to main content

Module interpolation

Module interpolation 

Source
Expand description

Shared parsing for ${...} expression holes.

The lexer stores an interpolation hole as source text plus the line and column where it starts. Everything that needs the expression back — the typechecker, the linter, and harn fix — parses it through here, so every consumer sees spans in the containing file’s coordinates rather than offsets relative to the hole (harn#5850).

Functions§

lexer
Build the lexer parse_expression uses, for callers that need the tokens.
parse_expression
Parse one ${...} hole into an expression whose spans address source.