Annotationless exact-printer #9385
Draft
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.
Potentially closes #7544.
Skeleton parser
Currently able to parse every single manifest stored on Hackage and to render it back into the exact same representation.
Implementation choices:
All whitespace is treated as spaces;
Data representation cannot be delayed in either dimension:
parsec
not supporting returning the remainder of the input (parsec
is the only available parser, per Meta: Exact-printer Mega-issue #7544 (comment)).Curly bracket syntax is treated more leniently than in the lexer (see Meta: Exact-printer Mega-issue #7544 (comment) for examples, all of these are accepted here);
Trailing whitespace and newlines are preserved everywhere in the format due to curly bracket positions depending on them.
Fields are allowed to have names with spaces in them, due to the fact that certain extremely old packages allowed that (see e.g.Patches are the current fix to this specific issue, field representation has been narrowed down to exclude spaces.build depends
at the very end of smartworld-0.0.0.5).Further extensions
Layout
encoding with automatic consistent offset incrementsLayout -> [Field Position]
Discarded ideas
Layout
manipulation (e.g. Meta: Exact-printer Mega-issue #7544 (comment))