Skip to content

Conversation

@istathar
Copy link
Member

@istathar istathar commented Aug 12, 2025

For reasons that are not entirely clear, the code to format Technique sources was almost entirely duplicated in the problem module used to embellish code snippets used in examples when printing error messages. Clean up this duplication.

Along the way made some improvements to the way tagging of fragments is done by the formatter code, considerably reducing the amount of allocation being done.

While we have a fairly extensive battery of parsing and formatting tests, the only real way to ensure the overall shape of the output is correct is to have a set of golden tests comparing known-good inputs that must be identical after being formatted. Add a test case which works through any files in examples/golden/ and fail if differences are detected.

@istathar istathar self-assigned this Aug 12, 2025
@istathar istathar marked this pull request as draft August 12, 2025 13:50
@istathar istathar marked this pull request as ready for review August 14, 2025 04:13
@istathar istathar merged commit 4a1260f into technique-lang:main Aug 14, 2025
1 check passed
@istathar istathar deleted the anti-duplication branch August 14, 2025 13:11
@istathar
Copy link
Member Author

Turns out this closes #18.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant