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

Community Feedback #1

Open
LukasKalbertodt opened this issue May 24, 2021 · 7 comments
Open

Community Feedback #1

LukasKalbertodt opened this issue May 24, 2021 · 7 comments

Comments

@LukasKalbertodt
Copy link
Owner

Do you have any opinions, complaints, suggestions, ideas, ... about litrs? Let me know! This issue is less formal and more relaxed than "normal issues", so feel free to just dump your thoughts here.

@jhpratt
Copy link

jhpratt commented May 25, 2021

I haven't had a chance to test this out yet, but I think having TryFrom impls could be quite convenient. It would avoid the match with a single type expected with the rest panicking (.expect could be used or some other error handling).

@LukasKalbertodt
Copy link
Owner Author

LukasKalbertodt commented May 25, 2021

I assume you are talking about TryFrom<X> for Y where Y is litrs::StringLit, litrs::IntegerLit and so on? That's a great idea! What could X be then? proc_macro[2]::Literal for sure. But also String and &str? Probably all four options, right?

EDIT: no, I wasn't thinking straight. The &str and String cases are already covered by parse, of course. But yeah, for the proc_macro[2]::Literal types it makes perfect sense!

@jhpratt
Copy link

jhpratt commented May 25, 2021

I was imagining proc_macro::Literal and proc_macro::TokenTree (along with proc_macro2 equivalents).

@LukasKalbertodt
Copy link
Owner Author

Yeah TokenTree also makes sense. Sweet, thanks.

@LukasKalbertodt
Copy link
Owner Author

@jhpratt I just published 0.2.0 which contains a large number of From and TryFrom impls. It was actually more work than expected, but I think they really improve the library and make lots of real world uses cases easier. Thanks for the suggestion again!

@wycats
Copy link

wycats commented Oct 2, 2021

@LukasKalbertodt I stumbled across this crate and really love it. Thank you so much for doing this!

@xiyuzhai
Copy link

xiyuzhai commented Dec 26, 2022

I'm working on my own programming language https://github.com/xiyuzhai-husky-lang/husky/. I shall work out the literal part of my language based on this project. Amazing work!!!

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

No branches or pull requests

4 participants