brittany icon indicating copy to clipboard operation
brittany copied to clipboard

Make output validity check compare pre- and post-transformation syntax trees

Open lspitzner opened this issue 8 years ago • 1 comments

As demonstrated by #67, there still are cases where brittany fails without triggering the current failsafe, because the output while (syntactically) changed still is syntactically valid.

The comparison would need to ignore any location data present in the syntax trees and mostly compare just the structure (and things like identifiers). This might be a bit of a challenge due to how interwoven location information is. Trees-that-grow might make this much easier, but that's not out yet.

lspitzner avatar Nov 28 '17 12:11 lspitzner

(Just to clarify, I don't think that we need for trees-that-grow for this. In the worst case we need to write a custom equality check over the syntax tree, which we might need either way.)

lspitzner avatar Oct 17 '18 18:10 lspitzner