4

When trying to compare the difference between two minified javascript files with random identifier names, about 95% of the changes are identifiers being renamed. I would like to use a tool that ignores these renames and just shows actual code addition and deletion.

Such a tool would be very useful to easily see what an app has changed in an update.

Camlan
  • 41
  • 1

1 Answers1

1

The approach you are looking for is to to parse both files into Abstract Syntax Trees and then compare the two trees for similarity.

A simple solution would be to write a lexer/tokenizer/transducer which replaces the names with just "NAMEGOESHERE" and then use diff.

If you post the two files, I can give it a try.

pythonpython
  • 878
  • 5
  • 10