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

Add doc comments everywhere #41

Merged
merged 44 commits into from
Mar 17, 2020
Merged

Add doc comments everywhere #41

merged 44 commits into from
Mar 17, 2020

Conversation

cpcloud
Copy link
Collaborator

@cpcloud cpcloud commented Mar 7, 2020

Closes #36

@cpcloud
Copy link
Collaborator Author

cpcloud commented Mar 7, 2020

@magnet Also could use your review.

Copy link
Collaborator

@lovesegfault lovesegfault left a comment

Choose a reason for hiding this comment

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

Looks good, but now I'm starting to think about how to maintain a large number of tests of the kind sample_fb -> expected (code|ast). I'm not sure how rustc does this, maybe @nagisa could weigh in.

Copy link
Contributor

@magnet magnet left a comment

Choose a reason for hiding this comment

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

LGTM overall!

One thing that may be worth looking into is forwarding the comments to the IR layer when adding it to new types (e.g EnumVal)

butte-build/src/ast/parser.rs Outdated Show resolved Hide resolved
@cpcloud
Copy link
Collaborator Author

cpcloud commented Mar 7, 2020

One thing that may be worth looking into is forwarding the comments to the IR layer when adding it to new types (e.g EnumVal)

Ah yeah, let me do that.

@nagisa
Copy link

nagisa commented Mar 8, 2020

I'm starting to think about how to maintain a large number of tests of the kind sample_fb -> expected (code|ast). I'm not sure how rustc does this,

Tests for distinct output families are different tests, so it makes all the sense for them to be separate tests in the first place. rustc only reuses the same test for testing different auxiliary inputs (such as… architecture, flags, etc.) and so does butte – by construction.

@magnet
Copy link
Contributor

magnet commented Mar 8, 2020

I'm starting to think about how to maintain a large number of tests of the kind sample_fb -> expected (code|ast). I'm not sure how rustc does this,

I'd like to add even more of these, e.g fb -> Rust code (using quote!()). These would likely be in codegen.rs and help make sure we don't accidentally break things.

We're getting larger and larger modules & would be happy splitting things up a bit, while keeping tests within modules. Opinions welcome 🙂

@cpcloud
Copy link
Collaborator Author

cpcloud commented Mar 9, 2020

After tinkering some more with flatc to see what it generates I don't think it makes sense to generate comments for attribute or root_type statements (we still need to accept them in the parser though). file_identifier and file_extension make sense, since they are generated consts.

@cpcloud
Copy link
Collaborator Author

cpcloud commented Mar 9, 2020

For namespaces I've created #44 since it's a fair amount of code and should be reviewed separately.

@cpcloud
Copy link
Collaborator Author

cpcloud commented Mar 9, 2020

@magnet @lovesegfault This could use another round of review, as I've done some refactoring.

@lovesegfault lovesegfault merged commit 18c0e5e into butte-rs:master Mar 17, 2020
@cpcloud cpcloud deleted the fix-field-doc-comment branch March 18, 2020 04:19
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.

Preserve doc comments
4 participants