syntax aware diff tools? [closed]

自作多情 提交于 2019-11-28 07:29:41

Not GUI based, but completely syntax driven: my company's Smart Differencer tools for many langauges (incluiding Java, C#, C++, PHP, Python, JavaScript, HTML, XML, COBOL,...)

The Smart Differencer parses the source text like the compiler, so it understands that language syntax and structures the way the compiler does. It compares these structures (using ASTs) to determine the "least edit distance" in terms of edit actions (move, copy, delete, replace, rename-identifier-in-block) on these structures and report them.

In your example, it would know the curly brace on the right belongs to foo, not bar, and would tell you that the entire statement involving bar was simply deleted.

The output style is diff-like if you want to feed the result to another tool, or more human readable if you want to examine it directly.

Beyond Compare will let you realign lines that it mismatches. I generally have good luck with it matching lines properly.

I think Beyond Compare has what you are looking for http://www.scootersoftware.com/index.php

I like Source Gear's DiffMerge.

The Pretty Diff tool is syntax aware automatically. The process it uses is to minify code in order to remove comments and then beautify the code so as to normalize formatting and white space. It only supports a few web client-side languages though. This tool works on the client side so you can test it out in your browser and there is a sample page containing some demos.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!