-
Notifications
You must be signed in to change notification settings - Fork 4
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
update syn"e #4
Conversation
I haven't been able to end my end of the bargain (fixing CI etc) because of |
this is absolutely NOT urgent BTW |
c1ffa2e
to
0200c58
Compare
So I finally got the lib to compile. but now not all the tests compile anymore because I might have missed some cases. |
should revert once #4 is merged.
should revert once #4 is merged.
Looking good so far! I've migrated this project to github actions so just do a rebase on top of the latest master when you feel like it. Also noticed that I didn't quite see how should the derive functionality work in the first place :) This currently works on a duck-typing approach (mere existence of |
As far as I understand proc-macros for now you don't know much about the code other than the syntax itself. So yes, the safest thing seems to be to implement your own trait and just expect/require that all types in the fields of your struct do so too. |
ad38b90
to
2e8be3d
Compare
Merry Xmas! I kinda worked on this on and off in between some family time. Sorry about the weird format and all the dbg!() macros still, I very much intend to rebase this into something much clearer eventually. |
still missing enum support though
2e8be3d
to
c0ffee1
Compare
Hi @koivunej. I thing I got it done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
I think this is looking good, you know more than I do at this point. One question so far popped in to mind while trying to understand the diffs. Thanks for keeping my type_hopefully_is
vagueness :)
As the tests pass I'm inclined to just merge this straight away. You were interested in adding the support for raw identifiers so please go ahead. If you had some parts where you were looking for my input specifically, we can revisit this PR even after merging.
src/lib.rs
Outdated
.iter() | ||
.enumerate() | ||
.filter(|(_, field)| field.ident.is_none()) | ||
.map(|(index, _)| format_ident!("{}", abc(index).expect("so many indexes"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous way for ident generation was x{index}
... The a..=z is probably enough for everyone, just wondering if you picked this up from some material as a suggested way to generate identifiers? I wasn't able to find google this up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh that's a good idea actually, I was a bit in creative mood at that moment, but x{index}
or possibly arg_{index}
are actually more reasonable, will do that
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
In case you‘re waiting on anything regrading raw identifiers, there is nothing left to do. They come for free with the update. |
Hi there, this is my work in progress, I just spent the weekend getting up to speed with proc-macros at all.
Full transparency: this doesn't compile at all yet. I don't want to impose, but if you feel like pitching in, it would be much appreachiated, it is rather demanding work making this compile. 😉