mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-04-01 23:41:20 +00:00
Added compiler and virtual machine JS
This commit is contained in:
parent
d7058e8ada
commit
44cc17a0e1
4 changed files with 78171 additions and 18 deletions
56064
javascripts/compiler.js
56064
javascripts/compiler.js
File diff suppressed because one or more lines are too long
22093
javascripts/vm.js
Normal file
22093
javascripts/vm.js
Normal file
File diff suppressed because it is too large
Load diff
BIN
qcvm
Executable file
BIN
qcvm
Executable file
Binary file not shown.
32
test.html
32
test.html
|
@ -8,7 +8,7 @@
|
|||
<link rel="stylesheet" href="stylesheets/styles.css">
|
||||
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
|
||||
<script src="javascripts/scale.fix.js"></script>
|
||||
<script src="javascripts/compiler.js"></script>
|
||||
<script src="javascript/vm.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
|
@ -56,6 +56,34 @@
|
|||
<script type="text/javascript" src="http://www.ohloh.net/p/602517/widgets/project_partner_badge.js"></script>
|
||||
</footer>
|
||||
</div>
|
||||
<script type='text/javascript'>
|
||||
var Module = {
|
||||
preRun: [],
|
||||
noInitialRun: true,
|
||||
postRun: [],
|
||||
print: (function() {
|
||||
var element = document.getElementById('output');
|
||||
element.value = ''; // clear browser cache
|
||||
return function(text) {
|
||||
// These replacements are necessary if you render to raw HTML
|
||||
//text = text.replace(/&/g, "&");
|
||||
//text = text.replace(/</g, "<");
|
||||
//text = text.replace(/>/g, ">");
|
||||
//text = text.replace('\n', '<br>', 'g');
|
||||
element.value += text + "\n";
|
||||
element.scrollTop = 99999; // focus on bottom
|
||||
};
|
||||
})(),
|
||||
printErr: function(text) {
|
||||
if (0) { // XXX disabled for safety typeof dump == 'function') {
|
||||
dump(text + '\n'); // fast, straight to the real console
|
||||
} else {
|
||||
console.log(text);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="javascripts/compiler.js"></script>
|
||||
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue