Skip to content

Release 1.4.0: parse an .mlx unit as mlx did - #4

Merged
zaiev merged 1 commit into
mainfrom
release-1.4.0-parse-an-mlx-unit-as-mlx-did
Nov 23, 2026
Merged

zaiev merged 1 commit into
mainfrom
release-1.4.0-parse-an-mlx-unit-as-mlx-did

Conversation

@zaiev

@zaiev zaiev commented Nov 23, 2026

Copy link
Copy Markdown

Why

litany parsed every unit's source with OCaml's own parser, which cannot read JSX, so any .mlx that spelt an attribute was reported degraded ("editable source does not parse") and lost attribute rules, [@litany.allow] and corroboration. mlx-pp already writes its parse of the .mlx as a marshalled AST in the .mlx's own positions; litany reads that rather than take mlx's parser as a dependency.

Changes

  • An .mlx unit is parsed from the AST mlx-pp wrote, so attribute rules and [@litany.allow] work there and it is no longer reported degraded.
  • Roster.Entry.v takes an optional ?parsed_source, and a unit file a parsed-source field.
  • An .mlx in a native library with no ppx is linted; it was skipped as missing its artifact.
  • Releases 1.4.0.

Verified

  • A new cram test builds a project with an mlx dialect run by a stand-in preprocessor: the unit is linted, not degraded, and its suppression holds; the new unit tests fail without the fix.
  • On a Melange project with 26 degraded .mlx units under 1.2.2, this build reports none, with every other count unchanged.
  • make test, make lint, make coverage (90.2%) and make docs pass.

litany parsed every unit's source with OCaml's own parser, which cannot
read JSX, so any .mlx that spelt an attribute -- the demand for a parse
-- was reported degraded and lost attribute rules, [@litany.allow] and
corroboration. The cause looked like parser state carried across items,
since removing an [@@mel.get] made the failure vanish; it removed the
demand, not the failure.

mlx-pp already writes its parse of the .mlx beside the build's copy, as
a marshalled AST in the .mlx's own positions: litany reads that rather
than take mlx's parser as a dependency, and a roster entry names it as
its parsed source, so a unit file can carry it too. A native .mlx with
no ppx, whose compiler input is that same file, was skipped as missing
its artifact and is now linted.
@zaiev
zaiev merged commit 17f1775 into main Nov 23, 2026
4 checks passed
@zaiev
zaiev deleted the release-1.4.0-parse-an-mlx-unit-as-mlx-did branch November 23, 2026 22:32
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