Comments (7)
@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.
@LukasKalbertodt I stumbled across this crate and really love it. Thank you so much for doing this!
from litrs.
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.
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.
I was imagining proc_macro::Literal
and proc_macro::TokenTree
(along with proc_macro2
equivalents).
from litrs.
Yeah TokenTree
also makes sense. Sweet, thanks.
from litrs.
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)
- Support non-number suffixes HOT 2
- Example for proc macro HOT 2
- Conversion to proc_macro2::Literal HOT 6
- Pull out majority of parsing code into non-generic functions HOT 1
- Broken external link in documentation
- Return `String` from `StringLit<String>::into_value`
- Remove `proc-macro2` from default features
- Floatlit fails with 27f32 HOT 4
- Possible to add value_as_str? HOT 5
- Update escape logic according to RFC 3349
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from litrs.