パブリックドメイン版 cflow には GNU cflow の -T, --tree * Draw ASCII art treeというオプションがないので、インデントで表された呼び出し構造(オフサイドルール?)をツリー形式に変換するコマンドを書いてみた。 #!/usr/bin/python import sys def getlevel(s): return len(s) - len(s.lstrip()) def parselist(lines): if len(lines) == 0: return [[], 0] tree = [] i = 0 currentlevel = getlevel(lines[0]) while i < len(lines): level = getlevel(lines[i]) if level > currentlevel: # Indent incr
End script and style with newline? Support e4x/jsx syntax Use comma-first list style? Detect packers and obfuscators? (unsafe) Preserve inline braces/code blocks? Keep array indentation? Break lines on chained methods? Space before conditional: "if(x)" / "if (x)" Unescape printable chars encoded as \xNN or \uNNNN? Use JSLint-happy formatting tweaks? Indent <head> and <body> sections? Keep indentat
追記:Twitter / 10th543: あ・・・ボタンが��で指摘されたのでmetaタグを追加した。どちらにしろ、script要素のdefer属性を使っているので、Firefox3.1以降じゃないと動かないと思う。 FIrefoxだと、Function#toSourceに数値を渡せばきれいにインデントしてくれる。 それを使ってコードを整形する物をinstant JavaScript code formatterに書いた。 例えば、 var t = (new Date).getTime();var i;for(i=0;i<10000;++i){(function () {return 3;}())};;; (window.console && console||alert)(new Date().getTime() - t); alert("ok!"); alert(t += 2); s
Beautify Javascript /* paste in your own code and press Beautify button */ var latest_changes=new Object({'2008-02-22':'Javascript beautifier rewrite in javascript.','... boring history ...','2007-02-08':'Initial release'});var a=b?(c%d):e[f]; Beautify You can always fetch the latest version of the code from subversion repository at svn://edev.uk.to/beautify. If you're writing javascript, JSLint i
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く