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§
- Content
Format Spec - Content-string format specification for rich terminal/HTML output.
- Table
Format Spec - Typed table rendering configuration for interpolation.
Enums§
- Align
Spec - Alignment for content-string rendering.
- Border
Style Spec - Border style for content-string table rendering.
- Chart
Type Spec - Chart type hint for content format spec.
- Color
Spec - Color specification for content strings.
- Format
Alignment - Horizontal alignment for formatted output.
- Format
Color - Color hint for formatted output.
- Interpolation
Format Spec - Typed format specification for interpolation expressions.
- Interpolation
Part - A parsed segment of an interpolated string.
- Named
Content Color - Named colors for content strings.
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_
content_ format_ spec - Parse a content-string format spec like
"fg(red), bold, fixed(2)". - parse_
content_ interpolation_ with_ mode - Parse a content string payload into interpolation parts.
- 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_ content_ format_ spec - Split interpolation content for content strings.
- split_
expression_ and_ format_ spec - Split interpolation content
expr[:spec]at the top-level format separator.