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

Feature/parse attr #279

Closed
wants to merge 6 commits into from
Closed

Conversation

cathaysia
Copy link
Contributor

@cathaysia cathaysia commented Mar 12, 2024

continue of #277

NOTE: I add the permission, so you can push commits to cathaysia:feature/parse_attr, then it will autoupdate to this pr.

cathaysia and others added 6 commits February 29, 2024 14:26
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
@cathaysia
Copy link
Contributor Author

In the previous pr, you add a comment: #277 (comment), I don't quite understand what you mean. What function do you want to achieve, or what is wrong with the current implementation?

@TedDriggs
Copy link
Owner

I expect this to pass: let x: NegatableIdentList = parse_meta!(inner(example::flag, my_feature)); - it didn't, which seems to be an issue with the macro construction where commas end the tt.

@cathaysia
Copy link
Contributor Author

Can you give a more detailed, working example? (Can be used to test parse_meta)

@TedDriggs
Copy link
Owner

If I could give you a working example, then the PR wouldn't need amendment. Try using the macro with anything that contains a comma, and you get an error because the tt stops consuming at that point.

@cathaysia
Copy link
Contributor Author

I don't quite understand the purpose of this way of writing. What is inner(example::flag, my_feature)? Is it a function that returns a TokenStream?

@TedDriggs
Copy link
Owner

Oh, wow, I'm sorry - this is entirely on me. I was mistakenly thinking of this as parse_quote! and was trying to write a fragment of a Meta that I expected to work here. Sorry about that. Let me have another look at this today, I think it's working properly and I'm the one who was off-base.

@cathaysia
Copy link
Contributor Author

This feature merging cycle far exceeded my expectations. On the one hand, considering that no obvious progress has been seen yet, on the other hand, this function has been completed. So I closed this pr. If you are still interested in this macro. You can implement it on your own branch.

@cathaysia cathaysia closed this Mar 23, 2024
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.

None yet

2 participants