lambda-fairy / maud

:pencil: Compile-time HTML templates for Rust
https://maud.lambda.xyz
Apache License 2.0
2.09k stars 137 forks source link

feat: modernize parser #412

Open vidhanio opened 8 months ago

vidhanio commented 8 months ago

parser rewritten from the ground-up using syn idioms and more strongly-typed syn structures rather than TokenStreams. passes all test cases flawlessly, and makes the code much easier to understand.

also drops proc-macro-error for a more robust solution (proc-macro2-diagnostics) which doesn't need global state and macros.

all of the edited trybuild test-cases are either adding more information/cases or fixing some bugs.

lambda-fairy commented 7 months ago

Thanks @vidhanio!

I remember playing with the syn parser and getting stuck on diagnostics. So I'm glad that you found a solution for that.

I'm really busy at the moment so apologies for the delay. I'll try to have a look some time this weekend.

vidhanio commented 7 months ago

Thanks @vidhanio!

I remember playing with the syn parser and getting stuck on diagnostics. So I'm glad that you found a solution for that.

I'm really busy at the moment so apologies for the delay. I'll try to have a look some time this weekend.

no problem!

i've since changed it a bit and repackaged it into my own library, hypertext. I could port the changes backwards to this if needed! 😁