Skip to content

feat(builder): compare a path with a path in conditions #297

Done

Description

@vaceslav

Found by porting a real-world template end to end (#292; epic #261, phase 4). The template matched the original in pages, words and fonts through a Stirling-PDF (LibreOffice) PDF path.

F7 — Comparing a path with a path needs a raw condition · cosmetic

a.id = b.id is Condition.Raw("a.id = b.id", a, b). It works and the contract stays complete, but it is the escape
hatch for a plain comparison. One call site in the port.

entry["id"].Eq(owner["id"])      // overloads that take a TemplatePath

Activity

  1. added
    enhancement
    builder
    on Nov 26, 2026
  2. vaceslav commented on Dec 1, 2026

    @vaceslav
    ContributorAuthor

    Done on feature/builder (e32e67d..9bb5d0e).

    • C#: Eq, NotEq, Gt, Ge, Lt, Le, Contains, StartsWith and EndsWith take another path on TemplatePath and TemplatePath<T>, so entry["ownerId"].Eq(owner["id"]) is written entry.ownerId = owner.id. Both paths go into the data contract and the loop-scope check, and Condition.Raw is no longer needed for this.
    • JSON: on the right of an operator, a word counts as a path if it has a dot or an index (owner.id, items[0]), is loop metadata (@index), or is an escaped word ([limit], the engine's identifier escape). A plain word (status = paid) stays the "quote the literal" error, because it is almost always a missing quote. The builder writes a one-segment right operand in brackets, so the JSON reads back the same.
    • Tests: written forms, fills (string, numeric, loop item, @index), scope error, JSON round trip.

    Deferred minors from the review:

    • The bracket hint is offered for exponent numbers (1e3), and 1.5e3 now reports a path error without a column.
    • The hint says "top-level value" inside loops too.
    • The writer's "one word" test (IsLetterOrDigit) is narrower than the segment grammar (\w). This only matters for names the engine cannot read anyway.
    • The doc sentence on equality does not mention the inline dialect's strict rule.
  3. vaceslav commented on Dec 2, 2026

    @vaceslav
    ContributorAuthor

    Done on feature/builder, merged to main in #316 and released in builder 0.1.0.

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

    builderenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions