問題描述
適用於 xpand 的 Actionscript 3 代碼美化器(MWE2 工作流程) (Actionscript 3 code beautifier for xpand (MWE2 Workflow))
I
Currently I'm developing a code generator for Java and Actionscript3.
The generator works quiet well, but the Actionscript3 code isn't really nice.
For Java, there is an existing code beautifier integrated with xpand (MWE2 Workflow) but for Actionscript3 I cannot find anything.
Any idea? Perhaps someone have a ready to use AS3 code beautifier or knows a third party beautifier which may be integrated with xpand and MWE2 Workflow
‑‑‑‑‑
參考解法
方法 1:
Take a look at the uncrustify post‑processor. It passes the generated output to a command line tool to produce the actual output with the desired indentation. If uncrustify itself doesn't suit you, the source code of the post‑processor might help you to attach you own external tool.
方法 2:
After a long search, I have written a small beautifier at my own. It don't do much, only counting the { and indent as well as removing unnecessary line‑breaks.
The result isn't really beautifully, but at least the code is more readable.
Thanks for the help
方法 3:
Try this http://jsbeautifier.org/ I know it's for JS ,but i tried and it worked.
(by Yves、Heiko Behrens、Yves、Abel)