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 the capability of skipping strikethrough for subtrees #10

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Luctins
Copy link
Contributor

@Luctins Luctins commented Nov 5, 2024

Add a new attribute named nostrike that allows you to skip subtrees for strikethrough.

initial discussion in #9

@Luctins
Copy link
Contributor Author

Luctins commented Nov 5, 2024

@jcaesar I think this does work, but not for subtrees yet.

if matches!(&attr.path[..], [TokenTree::Ident(kw)] if kw == "nostrike") {
match &attr.value {
AttributeValue::Empty => {
nostrike = true;
Copy link
Owner

Choose a reason for hiding this comment

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

For the subtrees, I think it's possible to do strike_attrs.drain(..) here. I haven't thought about whether that's wise.

@jcaesar
Copy link
Owner

jcaesar commented Nov 6, 2024

(I guess we can ignore the possibility of attribute name collisions for now. Let's see if it ever comes to bite.)

@jcaesar
Copy link
Owner

jcaesar commented Dec 15, 2024

There now is (or will very soon be) machinery for checking for attributes, and I'll rename strikethrough to structstruck::each.

Maybe you can add #[structstruck::exclude_each] or something based on that?

@Luctins
Copy link
Contributor Author

Luctins commented Dec 16, 2024

Ok! I was also keeping up with the conversation in the other issue so all good from my part.

I'm just a little swamped with work and end-of-year related things right now, so probably I'm going to take a look at this in January.

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.

2 participants