Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为 ocaml 寻找代码格式化程序或漂亮的打印机。go 编程语言的 gofmt 之类的东西。它最好保留评论。
我正在更正手稿,并且某些代码的格式使其难以阅读。
如果你不关心评论,你可以使用camlp4:
camlp4 <file> -parser o -printer o > <new-file>
或者您可以使用外部压头工具,如ocp-indent。