Skip to main content

Module interpolation

Module interpolation 

Source
Expand description

Shared formatted-string interpolation parsing.

This module is intentionally syntax-only. It extracts literal and expression segments from f"..." strings so all consumers (compiler, type checker, LSP) can run their normal expression pipelines on the extracted {...} expressions.

Structs§

TableFormatSpec
Typed table rendering configuration for interpolation.

Enums§

FormatAlignment
Horizontal alignment for formatted output.
FormatColor
Color hint for formatted output.
InterpolationFormatSpec
Typed format specification for interpolation expressions.
InterpolationPart
A parsed segment of an interpolated string.

Functions§

find_top_level_format_colon
Find the top-level format-separator : in an interpolation expression.
has_interpolation
Check whether a string contains at least one interpolation segment.
has_interpolation_with_mode
Check whether a string contains at least one interpolation segment for the mode.
parse_interpolation
Parse a formatted string payload into interpolation parts.
parse_interpolation_with_mode
Parse a formatted string payload into interpolation parts using the given mode.
split_expression_and_format_spec
Split interpolation content expr[:spec] at the top-level format separator.