2014-08-05から1日間の記事一覧

WSHでCoffeeScript簡易コンパイラを作る

// CoffeeScript簡易コンパイラ // CoffeeCompile.jse // カレントをスクリプトのあるパスにする var fso = new ActiveXObject("Scripting.FileSystemObject") var WShell = new ActiveXObject("WScript.Shell") WShell.CurrentDirectory = fso.GetFile(WScr…

coffee-script.jsのコンパイルでsyntax errorが出た行を取得する方法

s=""; s+="f=->\n"; s+=" alert[ 'Hello. #{language}.'\n"; try { compiled = CoffeeScript.compile(s); console.log(compiled); } catch(e) { console.log(e.location.first_line); console.log(e.location.first_column); console.log(e.message); }