@cm0002 to Programmer [email protected] • 24 hours agoWhat's stopping you from writing your Rust like this?lemmy.mlimagemessage-square56arrow-up1362arrow-down18
arrow-up1354arrow-down1imageWhat's stopping you from writing your Rust like this?lemmy.ml@cm0002 to Programmer [email protected] • 24 hours agomessage-square56
minus-square@[email protected]linkfedilink2•11 hours agoIf you do that, you lose formatting and comments every time you load the source from disk
minus-square@[email protected]linkfedilink3•edit-29 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-square@[email protected]linkfedilink3•6 hours agoOr by including comments in the parse tree. (& Yes, it is done various places for various languages and formats.)
minus-square@[email protected]linkfedilink1•edit-24 hours agoDo you have some examples? (That is what I meant by giving them a symbol, maybe I worded it poorly)
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)