Skip to content

Cross-check that emit_value and the formatter agree on [...] / {...} style #47

Description

@djankov

Background

emit_value (the mutation layer, value-based) and the canonical formatter (CST-node-based) emit collection literals through separate code paths that are only required to agree by prose: a list is a brace-list {a, b}; an Array is a square-bracket array [a b] (1-D) or a matrix [r; r] (2-D). Nothing pins the two together, so an independent change to one path's bracket / separator / spacing convention could silently diverge — a mutated field and a formatted field would then disagree.

Both paths are correct today; this is a regression guard, not a bug.

Proposal

Add a small cross-check test that exercises equivalent collection values through both paths and asserts they produce the same spelling (bracket vs brace, the ; matrix-row separator, element spacing), so the shared convention can't drift unnoticed.

Low priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:choreTooling, infra, or hygiene

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions