LeopoldArkham / Molten

[WIP] Molten - Style-preserving TOML parser.
Apache License 2.0
40 stars 8 forks source link

Merge consecutive whitespace #21

Closed LeopoldArkham closed 6 years ago

LeopoldArkham commented 6 years ago

Currently the parser ends whitespace whenever a newline is reached. When appending a WS item, check that it does not follow another WS item,and merge them together if it does.

Look for the todo in parse_item(), currently on line 135.

jeremydavis519 commented 6 years ago

I'd like to take this one if you don't mind. I should have a working version soon. But just to be clear, when you refer to a "WS item," that means a line that contains nothing but whitespace, right? Nothing else seems to make sense, given the source code that I've read since discovering this project a few hours ago. (In particular, I thought at first that any whitespace surrounding a newline would count, but that's clearly not right.)

LeopoldArkham commented 6 years ago

Hey, great to have you!

Yes. I do specifically mean Item::WS elements should be concatenated into a single one if multiple of them occur consecutively.

Couple things I didn't mention in the OP:

Let me know if you need anything!