cm0002@lemmy.world to Programmer Humor@programming.dev · 14 days agoWhat's stopping you from writing your Rust like this?lemmy.mlimagemessage-square60fedilinkarrow-up1383arrow-down19cross-posted to: programmerhumor@lemmy.ml
arrow-up1374arrow-down1imageWhat's stopping you from writing your Rust like this?lemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 14 days agomessage-square60fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareCanadaPlus@lemmy.sdf.orglinkfedilinkarrow-up10·13 days agoWow, so this is possible. Formatting is so damn arbitrary. Somebody has to have tried storing just the parse tree on disk, right?
minus-squareLightfire228@pawb.sociallinkfedilinkarrow-up2·13 days agoIf you do that, you lose formatting and comments every time you load the source from disk
minus-squareCanadaPlus@lemmy.sdf.orglinkfedilinkarrow-up3·edit-213 days agoLosing formatting other than what you’ve set in your deparser would be the point. Losing comments would be bad, but that seems easily fixable just by giving each comment block a symbol that points to it’s contents.
minus-squaredjehuti@programming.devlinkfedilinkarrow-up3·13 days agoOr by including comments in the parse tree. (& Yes, it is done various places for various languages and formats.)
minus-squareCanadaPlus@lemmy.sdf.orglinkfedilinkarrow-up1·edit-213 days agoDo you have some examples? (That is what I meant by giving them a symbol, maybe I worded it poorly)
minus-squarebrisk@aussie.zonelinkfedilinkarrow-up2·13 days agoThe closest thing I’ve seen is Combobulate
Wow, so this is possible.
Formatting is so damn arbitrary. Somebody has to have tried storing just the parse tree on disk, right?
If you do that, you lose formatting and comments every time you load the source from disk
Losing formatting other than what you’ve set in your deparser would be the point. Losing comments would be bad, but that seems easily fixable just by giving each comment block a symbol that points to it’s contents.
Or by including comments in the parse tree. (& Yes, it is done various places for various languages and formats.)
Do you have some examples?
(That is what I meant by giving them a symbol, maybe I worded it poorly)
The closest thing I’ve seen is Combobulate