Marwes / combine

A parser combinator library for Rust
https://docs.rs/combine/*/combine/
MIT License
1.29k stars 93 forks source link

XML parsing for React.js to Solid.js conversion #341

Open rrjanbiah opened 2 years ago

rrjanbiah commented 2 years ago

Combine is recommended in https://www.reddit.com/r/rust/comments/t37twl/hey_rustaceans_got_an_easy_question_ask_here_92022/hyycpd6/?utm_source=reddit&utm_medium=web2x&context=3

But, I can't seem to find any XML parsing done using Combine. Is that possible and any comments on that?

r4v3n6101 commented 2 years ago

Of course, it's possible as LL(1) parser can represent XML data by parsing tags. But IMO your choice should be over the serde crate as more fitting solution for structs from text conversions and vice versa. Is that appropriate or combine is preferable?

rrjanbiah commented 2 years ago

@r4v3n6101 Many thanks for your suggestion. Quick glance at serde is promising for the React.js to Solid.js conversion. But, I'm worried that it seems to demand hand coding a lot. Anyway, let me closely check that. Thanks again.

Marwes commented 2 years ago

Can't have examples for any given format :) . But since xml is a common format there already exists parsers for it so I'd first look at using an existing parser https://crates.io/search?q=xml .

rrjanbiah commented 2 years ago

@Marwes Many thanks for your comments and suggestions