Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format extension types. #1387

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Format extension types. #1387

merged 4 commits into from
Feb 16, 2024

Conversation

munificent
Copy link
Member

Nothing particularly interesting here, but it did flush out a little bug in PieceFactory.createParameter() where a comment before the metadata annotation would get moved to after the parameter.

This handles metadata everywhere except on for loop variables. I'll do
that later after patterns in for loops are supported.

Since there were some metadata tests on pattern variable declarations,
this also includes a trivial implementation of that. There's a TODO to
revisit it and add real tests, but it's enough for the metadata tests.

Figuring out where to put the metadata-handling code was a little tricky
since so many places in the language can have metadata. I ultimately
decided to put it into AdjacentBuilder. Every place that was working
with metadata also had one of those builders in play, so that made it
easy to add a simple call to `b.metadata()` and get the metadata
working.

It does mean that AdjacentBuilder isn't strictly about adjacent pieces
anymore, but I think that's OK. In practice, it's used mostly as a
general "build pieces out of smaller things" builder.
Nothing particularly interesting here, but it did flush out a little
bug in PieceFactory.createParameter() where a comment before the
metadata annotation would get moved to after the parameter.
Base automatically changed from format-metadata to main February 15, 2024 23:13
# Conflicts:
#	lib/src/front_end/piece_factory.dart
#	test/declaration/metadata.unit
lib/src/piece/list.dart Outdated Show resolved Hide resolved
test/declaration/extension_type_comment.unit Show resolved Hide resolved
@munificent munificent merged commit efda436 into main Feb 16, 2024
7 checks passed
@munificent munificent deleted the format-extension-types branch February 16, 2024 15:10
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.

3 participants