Improve CPP support: Output checking with --write-mode=inplace #74

Open
opened 2017-12-08 23:38:15 +01:00 by lspitzner · 0 comments
lspitzner commented 2017-12-08 23:38:15 +01:00 (Migrated from github.com)

Currently the (somewhat hidden) config setting to try cope with CPP disables the output check, due to the way that CPP preprocessing works in GHC. But with --write-mode=inplace it would be possible to

a) make backup
b) apply brittany transformation inplace
c) parse again, and revert to the backup on failure

This is some annoying logic to write (and we'd really want to ensure that this failsafe is safe of failing itself..) but might be worth it if sufficiently many people use brittany on modules that require CPP.

At the moment i put this at low priority, so this is mostly a note for future consideration.

Currently the (somewhat hidden) config setting to try cope with `CPP` disables the output check, due to the way that `CPP` preprocessing works in GHC. But with `--write-mode=inplace` it would be possible to a) make backup b) apply brittany transformation inplace c) parse again, and revert to the backup on failure This is some annoying logic to write (and we'd really want to ensure that this failsafe is safe of failing itself..) but might be worth it if sufficiently many people use brittany on modules that require CPP. At the moment i put this at low priority, so this is mostly a note for future consideration.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#74
There is no content yet.