Skip to content

Conversation

@sellout
Copy link
Contributor

@sellout sellout commented Oct 2, 2025

Overview

We pull types, ablities, and use to the beginning of files and
definitions. But if they occur at the end of a block, they don’t have a
trailing Semi. Reordering in that case would create an invalid stanza.

This ensures we add trailing Semis to any stanza not at the end of a
block.

Fixes #686.

Implementation notes

This drops some empty stanzas that weren’t dropped before, which accounts for the changed hashes in some other tests.

Test coverage

Adds a new transcript with two known failure cases.

We pull types, ablities, and `use` to the beginning of files and
definitions. But if they occur at the end of a block, they don’t have a
trailing `Semi`. Reordering in that case would create an invalid stanza.

This ensures we add trailing `Semi`s to any stanza not at the end of a
block.

Fixes unisonweb#686.
Copy link
Contributor

@aryairani aryairani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@aryairani aryairani merged commit d8b58ea into unisonweb:trunk Oct 2, 2025
17 checks passed
@sellout sellout deleted the final-use branch October 2, 2025 17:14
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.

Parse failure if the last line in a scratch file is use

2 participants