cm0002@lemmy.world to Programmer Humor · 18 hours agoWhat's stopping you from writing your Rust like this?lemmy.mlimagemessage-square54fedilinkarrow-up1338arrow-down16cross-posted to: [email protected]
arrow-up1332arrow-down1imageWhat's stopping you from writing your Rust like this?lemmy.mlcm0002@lemmy.world to Programmer Humor · 18 hours agomessage-square54fedilinkcross-posted to: [email protected]
minus-squareLightfire228@pawb.sociallinkfedilinkarrow-up2·5 hours agoIf you do that, you lose formatting and comments every time you load the source from disk
minus-squareCanadaPlus@lemmy.sdf.orglinkfedilinkarrow-up3·edit-23 hours 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-squaredjehutilinkfedilinkarrow-up1·18 minutes agoOr by including comments in the parse tree. (& Yes, it is done various places for various languages and formats.)
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.)