Repository navigation
Release 1.4.0: parse an .mlx unit as mlx did - #4
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.mlxunit 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.vtakes an optional?parsed_source, and a unit file aparsed-sourcefield..mlxin a native library with no ppx is linted; it was skipped as missing its artifact.Verified
.mlxunits under 1.2.2, this build reports none, with every other count unchanged.make test,make lint,make coverage(90.2%) andmake docspass.