Git Product home page Git Product logo

Comments (7)

LukasKalbertodt avatar LukasKalbertodt commented on May 24, 2024 1

@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!

from litrs.

wycats avatar wycats commented on May 24, 2024 1

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

from litrs.

jhpratt avatar jhpratt commented on May 24, 2024

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).

from litrs.

LukasKalbertodt avatar LukasKalbertodt commented on May 24, 2024

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!

from litrs.

jhpratt avatar jhpratt commented on May 24, 2024

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

from litrs.

LukasKalbertodt avatar LukasKalbertodt commented on May 24, 2024

Yeah TokenTree also makes sense. Sweet, thanks.

from litrs.

xiyuzhai avatar xiyuzhai commented on May 24, 2024

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!!!

from litrs.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.