Skip to content

feat(format): support field selectors in interpolation #76

Description

@thiremani

Problem

String interpolation markers currently resolve only a single identifier. As a result, -p.name interpolates p and leaves .name as literal text, even though field selection is valid in normal expressions.

Desired behavior

Field selectors should be part of the interpolation marker:

  • -p.name interpolates the value of p.name.
  • -p.age%6d interpolates p.age using the explicit %6d format.

Scope

  • Parse one or more .field selectors after the marker root.
  • Resolve them with the same dot-expression semantics used outside strings.
  • Apply any explicit format to the selected value.
  • Report invalid or unknown selectors as compile errors rather than partially consuming the marker.
  • Specify interactions with escaped markers and undefined names.
  • Add compiler and end-to-end coverage for default and explicit formatting.
  • Update the formatting documentation.

This should follow PIR so interpolation expressions participate consistently in validation, dependency/range discovery, and lowering. The implementation should reuse ordinary field-access behavior rather than introduce interpolation-only lookup rules.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions