Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (54 sloc) 1.32 KB
<!DOCTYPE html>
<title>treehugger.js demo</title>
<script data-main="lib/demo" src="lib/require.js"></script>
textarea {
font-family: "Courier new";
font-size: 11pt;
width: 100%;
height: 100%;
table {
width: 100%;
border: 0;
<h1>Treehugger.js playground</h1>
<td><textarea id="code" rows="15" cols="42">var a = 10, b;
console.log(a, b, c);</textarea></td>
<td><textarea id="ast" rows="15" cols="42" readonly style="background-color: #eee;"></textarea></td>
<th>Analysis code <button id="runbutton">Run</button></th>
<td><textarea id="analysis" rows="15" cols="42">var declared = {console: true};
'VarDecl(x)', function(b) {
declared[b.x.value] = true;
'VarDeclInit(x, _)', function(b) {
declared[b.x.value] = true;
'Var(x)', function(b) {
log("Variable " + b.x.value + " is not declared.");
<td><textarea id="output" rows="15" cols="42" readonly style="background-color: #eee;"></textarea></td>
Something went wrong with that request. Please try again.