aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.html
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-27 19:07:13 -0500
committerAlon Zakai <alonzakai@gmail.com>2012-12-27 19:07:13 -0500
commit0bf4db93ed9f57809c75739430bb619a693aed96 (patch)
treef36ba3224f4b2aa2771e6861fe86fb00c08e1037 /src/compiler.html
parent275adcf5ce7729295d0fa706cbb2f45ac0a875ef (diff)
compile and run in compiler.html
Diffstat (limited to 'src/compiler.html')
-rw-r--r--src/compiler.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler.html b/src/compiler.html
index d73da941..76d2dc33 100644
--- a/src/compiler.html
+++ b/src/compiler.html
@@ -8,12 +8,22 @@ Open the web console to see stderr output
arguments = ['', 'hello_world.ll'];
var outputElement = document.getElementById('output');
+ var compilerOutput = '';
print = function(x) {
- outputElement.innerHTML += x;
+ //outputElement.innerHTML += x;
+ compilerOutput += x;
+ };
+
+ // For generated code
+ var Module = {
+ print: function(x) {
+ outputElement.innerHTML += x;
+ }
};
</script>
<script src="compiler.js">
</script>
+<input type="button" value="run!" onclick="eval(compilerOutput)">
</body>
</html>