Skip to content

Conversation

@Jose-Perigolo
Copy link
Contributor

Changes

  • Transform EACH

    • ..n (current item): Skip descent when the template key is missing in the data so dparent stays on the current EACH item and ..n resolves correctly (e.g. {x0:{y0:'..n'}} with data: {a0:[{n:0},{n:1}]}).
    • .x / ...v: Correct handling of one-dot (current) and three-dot (ascend to data root) relative paths inside EACH.
    • EACH over dict with list child: When the child template from $REF is a list, only set S_DMETA on map children to avoid TypeError on list indices.
  • Transform PACK

    • Relative path resolution for paths like ...v100 and .y inside PACK now works via the shared getpath fixes.
  • getpath relative paths

    • Leading-dot count: Count the current part as the first dot so .x, .., and ..key are interpreted correctly.
    • Two dots: .. only → ascend 1 (parent); ..key in transform (with base) → current then .key; in getpath_relative (no base) → ascend 1 then .key.
    • Three dots: ... only (4 parts) or ...key → ascend to data/store root; with base (e.g. $TOP) use size(dpath)-1, without base use size(dpath).
    • Path ..: Two dots produce 3 split parts; decrement twice so the effective ascend is 1 (parent).
    • Past root: When ascends > size(dpath) return UNDEF (e.g. ....).
    • Three-dots override: Skip the normal “last part” decrement when the three-dots ascend-to-root override was applied.
  • descend()

    • Skip descent for any key missing from dparent (not only list indices), so template-only keys (e.g. x0, y0) do not overwrite dparent and ..n still resolves.

Tests

  • All 9 transform tests pass (basic, cmds, each, extra, funcval, modify, pack, paths, ref).
  • getpath_relative passes; no regressions in previously passing tests (52 passed total).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant