mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-20 02:12:31 +00:00
Executor on the site works now
This commit is contained in:
parent
ef80c6da7e
commit
f5884d72ce
73 changed files with 12167 additions and 2628 deletions
BIN
dat/0.dat
Normal file
BIN
dat/0.dat
Normal file
Binary file not shown.
BIN
dat/1.dat
Normal file
BIN
dat/1.dat
Normal file
Binary file not shown.
BIN
dat/10.dat
Normal file
BIN
dat/10.dat
Normal file
Binary file not shown.
BIN
dat/11.dat
Normal file
BIN
dat/11.dat
Normal file
Binary file not shown.
BIN
dat/2.dat
Normal file
BIN
dat/2.dat
Normal file
Binary file not shown.
BIN
dat/3.dat
Normal file
BIN
dat/3.dat
Normal file
Binary file not shown.
BIN
dat/4.dat
Normal file
BIN
dat/4.dat
Normal file
Binary file not shown.
BIN
dat/5.dat
Normal file
BIN
dat/5.dat
Normal file
Binary file not shown.
BIN
dat/6.dat
Normal file
BIN
dat/6.dat
Normal file
Binary file not shown.
BIN
dat/7.dat
Normal file
BIN
dat/7.dat
Normal file
Binary file not shown.
BIN
dat/8.dat
Normal file
BIN
dat/8.dat
Normal file
Binary file not shown.
BIN
dat/9.dat
Normal file
BIN
dat/9.dat
Normal file
Binary file not shown.
|
@ -3,9 +3,11 @@
|
|||
* just reference these as files, aparently that's not possible, w/e
|
||||
*/
|
||||
var examples = new Array();
|
||||
var eargs = new Array();
|
||||
|
||||
/* example code */
|
||||
examples[0] = 'void(string) print = #1;\nvoid(string what) main = {\n\tprint(what);\n\tprint("\\n");\n};\n';
|
||||
eargs[0] = '-string "Hello World"';
|
||||
examples[1] = '\
|
||||
void(string, ...) print = #1;\n\
|
||||
string(float) ftos = #2;\n\
|
||||
|
@ -21,6 +23,7 @@ void(float a, float b, float c) main = {\n\
|
|||
\tsum(sum(a, b, c), b, c));\n\
|
||||
\tprint(ftos(f), \"\\n\");\n\
|
||||
};\n';
|
||||
eargs[1] = '-float 100 -float 200 -float 300';
|
||||
examples[2] = '\
|
||||
void(string, ...) print = #1;\n\
|
||||
string(float) ftos = #2;\n\
|
||||
|
@ -33,6 +36,7 @@ void(float a, float b) main = {\n\
|
|||
\tif (a >= b) print("ge\\n");\n\
|
||||
\tif (a <= b) print("le\\n");\n\
|
||||
};\n';
|
||||
eargs[2] = '-float 1000 -float 2000';
|
||||
examples[3] = '\
|
||||
void(string, string) print = #1;\n\
|
||||
entity() spawn = #3;\n\
|
||||
|
@ -51,6 +55,7 @@ void() main = {\n\
|
|||
\te.b = "bar";\n\
|
||||
\tcallout(e, b);\n\
|
||||
};\n';
|
||||
eargs[3] = '';
|
||||
examples[4] = '\
|
||||
.float globf;\n\
|
||||
.vector globv;\n\
|
||||
|
@ -98,6 +103,7 @@ void(vector a, vector b) main = {\n\
|
|||
\n\
|
||||
\tprint("vis: ", ftos(visible(targ)), "\\n");\n\
|
||||
};\n';
|
||||
eargs[5] = "-vector '100 200 0' -vector '2000 1 10'";
|
||||
examples[6] = '\
|
||||
void(string, string) print = #1;\n\
|
||||
\n\
|
||||
|
@ -112,6 +118,7 @@ void(string() f) printer = {\n\
|
|||
void() main = {\n\
|
||||
\tprinter(getter);\n\
|
||||
};\n';
|
||||
eargs[6] = '';
|
||||
examples[7] = '\
|
||||
.float globf;\n\
|
||||
.vector globv;\n\
|
||||
|
@ -130,6 +137,7 @@ void(float c) main = {\n\
|
|||
\telse\n\
|
||||
\t\tprint("Else\\n");\n\
|
||||
};\n';
|
||||
eargs[8] = '-float 1000.45f';
|
||||
examples[9] = '\
|
||||
void(string, ...) print = #1;\n\
|
||||
string(float) ftos = #2;\n\
|
||||
|
@ -153,6 +161,7 @@ void(float n) main = {\n\
|
|||
\t\ti += 1;\n\
|
||||
\t} while (i < n);\n\
|
||||
};\n';
|
||||
eargs[9] = '-float 10';
|
||||
examples[10] ='\
|
||||
void(string, ...) print = #1;\n\
|
||||
string(float) ftos = #2;\n\
|
||||
|
@ -168,6 +177,7 @@ void(float a, float b) main = {\n\
|
|||
\tprint("&& ", ftos(a&&b), "\\n");\n\
|
||||
\tprint("|| ", ftos(a||b), "\\n");\n\
|
||||
};\n';
|
||||
eargs[10] = '-float 10 -float 20';
|
||||
examples[11] = '\
|
||||
void(string, string) print = %:1;\n\
|
||||
\n\
|
||||
|
@ -175,12 +185,14 @@ void() main = ??<\n\
|
|||
\tprint("??=??\'??(??)??!??<??>??-??/??/%>", "??/n");\n\
|
||||
\tprint("#^[]|{}~\\%>", "\\n");\n\
|
||||
%>;\n';
|
||||
eargs[11] = '-string "Hello " -string "World!"';
|
||||
examples[12] = '\
|
||||
void(string, ...) print = #1;\n\
|
||||
\n\
|
||||
void(string what) main = {\n\
|
||||
\tprint(what, "\\n");\n\
|
||||
};\n';
|
||||
eargs[12] = '-string "Pizza!"';
|
||||
|
||||
/* ad-hoc eh? */
|
||||
function update() {
|
||||
|
@ -188,13 +200,19 @@ function update() {
|
|||
var doc = document.getElementById("input");
|
||||
|
||||
doc.value = examples[sel[sel.selectedIndex].value - 1];
|
||||
document.getElementById("args").value = eargs[sel[sel.selectedIndex].value - 1];
|
||||
}
|
||||
function compile() {
|
||||
var args = [
|
||||
'dat/' + document.getElementById("eg").selectedIndex.toString() + '.dat'
|
||||
].concat(document.getElementById("args").value.split());
|
||||
document.getElementById("output").value = "Executing " + args.toString().replace(',', ' ');
|
||||
run (args);
|
||||
|
||||
var args;
|
||||
//document.getElementById("args").value.split(' ').concat();
|
||||
|
||||
args = document.getElementById("args").value;
|
||||
args += ' dat/' + document.getElementById("eg").selectedIndex.toString() + '.dat';
|
||||
document.getElementById("output").value = "Executing " + args + '\n';
|
||||
|
||||
run (args.match(/(".*?"|[^" \s]+)(?=\s* |\s*$)/g));
|
||||
|
||||
}
|
||||
|
||||
/* set initial */
|
||||
|
|
14629
javascripts/vm.js
14629
javascripts/vm.js
File diff suppressed because it is too large
Load diff
|
@ -46,9 +46,8 @@
|
|||
<option value="13">Variadic Arguments</option>
|
||||
</select>
|
||||
<textarea id="input" rows="25" cols="100%" disabled="disabled"></textarea>
|
||||
<br>
|
||||
<button onclick="compile()">Execute</button>
|
||||
<textarea id="args">Test</textarea>
|
||||
<textarea id="args" rows="1" cols="100%"></textarea>
|
||||
<button onclick="compile()" width="10%">Execute</button>
|
||||
<h4>Execution Output:</h4>
|
||||
<textarea id="output" rows="25", cols="100%"></textarea>
|
||||
</section>
|
||||
|
|
1
testsuite/builtins/output
Normal file
1
testsuite/builtins/output
Normal file
|
@ -0,0 +1 @@
|
|||
A test message Yeah
|
1
testsuite/calls/output
Normal file
1
testsuite/calls/output
Normal file
|
@ -0,0 +1 @@
|
|||
632719
|
3
testsuite/equality/output
Normal file
3
testsuite/equality/output
Normal file
|
@ -0,0 +1,3 @@
|
|||
ne
|
||||
lt
|
||||
le
|
1
testsuite/field-parameters/output
Normal file
1
testsuite/field-parameters/output
Normal file
|
@ -0,0 +1 @@
|
|||
bar
|
5
testsuite/fielddefs/deflist
Normal file
5
testsuite/fielddefs/deflist
Normal file
|
@ -0,0 +1,5 @@
|
|||
Field: void at 0
|
||||
Field: float globf at 0
|
||||
Field: vector globv at 1
|
||||
Field: string globs at 4
|
||||
Field: function globfunc at 5
|
3
testsuite/fields1/output
Normal file
3
testsuite/fields1/output
Normal file
|
@ -0,0 +1,3 @@
|
|||
spot1 = '150 2000 175'
|
||||
spot2 = '220 1300 -175'
|
||||
vis: 0
|
1
testsuite/functions-as-parameters/output
Normal file
1
testsuite/functions-as-parameters/output
Normal file
|
@ -0,0 +1 @@
|
|||
correct
|
0
testsuite/globaldefs/deflist
Normal file
0
testsuite/globaldefs/deflist
Normal file
1
testsuite/if1/output
Normal file
1
testsuite/if1/output
Normal file
|
@ -0,0 +1 @@
|
|||
Else
|
30
testsuite/loops1/output
Normal file
30
testsuite/loops1/output
Normal file
|
@ -0,0 +1,30 @@
|
|||
for 0
|
||||
for 1
|
||||
for 2
|
||||
for 3
|
||||
for 4
|
||||
for 5
|
||||
for 6
|
||||
for 7
|
||||
for 8
|
||||
for 9
|
||||
while 0
|
||||
while 1
|
||||
while 2
|
||||
while 3
|
||||
while 4
|
||||
while 5
|
||||
while 6
|
||||
while 7
|
||||
while 8
|
||||
while 9
|
||||
do 0
|
||||
do 1
|
||||
do 2
|
||||
do 3
|
||||
do 4
|
||||
do 5
|
||||
do 6
|
||||
do 7
|
||||
do 8
|
||||
do 9
|
8
testsuite/maths1/output
Normal file
8
testsuite/maths1/output
Normal file
|
@ -0,0 +1,8 @@
|
|||
input: 0 and 0
|
||||
+ 0
|
||||
* 0
|
||||
/ 0
|
||||
& 0
|
||||
| 0
|
||||
&& 0
|
||||
|| 0
|
1
testsuite/maths2/output
Normal file
1
testsuite/maths2/output
Normal file
|
@ -0,0 +1 @@
|
|||
dot = 0
|
2
testsuite/ngraphs/output
Normal file
2
testsuite/ngraphs/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
#^[]|{}~\%>
|
||||
#^[]|{}~\%>
|
BIN
testsuite/obj/builtins.qcc.dat
Normal file
BIN
testsuite/obj/builtins.qcc.dat
Normal file
Binary file not shown.
0
testsuite/obj/builtins.qcc.dat.err
Normal file
0
testsuite/obj/builtins.qcc.dat.err
Normal file
4
testsuite/obj/builtins.qcc.dat.out
Normal file
4
testsuite/obj/builtins.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: builtins/main.qc (qc)
|
||||
writing 'obj/builtins.qcc.dat'...
|
BIN
testsuite/obj/calls.qcc.dat
Normal file
BIN
testsuite/obj/calls.qcc.dat
Normal file
Binary file not shown.
1
testsuite/obj/calls.qcc.dat.err
Normal file
1
testsuite/obj/calls.qcc.dat.err
Normal file
|
@ -0,0 +1 @@
|
|||
[0;36mcalls/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/calls.qcc.dat.out
Normal file
4
testsuite/obj/calls.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: calls/main.qc (qc)
|
||||
writing 'obj/calls.qcc.dat'...
|
BIN
testsuite/obj/equality.qcc.dat
Normal file
BIN
testsuite/obj/equality.qcc.dat
Normal file
Binary file not shown.
1
testsuite/obj/equality.qcc.dat.err
Normal file
1
testsuite/obj/equality.qcc.dat.err
Normal file
|
@ -0,0 +1 @@
|
|||
[0;36mequality/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/equality.qcc.dat.out
Normal file
4
testsuite/obj/equality.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: equality/main.qc (qc)
|
||||
writing 'obj/equality.qcc.dat'...
|
BIN
testsuite/obj/field-parameters.qcc.dat
Normal file
BIN
testsuite/obj/field-parameters.qcc.dat
Normal file
Binary file not shown.
0
testsuite/obj/field-parameters.qcc.dat.err
Normal file
0
testsuite/obj/field-parameters.qcc.dat.err
Normal file
4
testsuite/obj/field-parameters.qcc.dat.out
Normal file
4
testsuite/obj/field-parameters.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: field-parameters/main.qc (qc)
|
||||
writing 'obj/field-parameters.qcc.dat'...
|
BIN
testsuite/obj/fielddefs.gm.dat
Normal file
BIN
testsuite/obj/fielddefs.gm.dat
Normal file
Binary file not shown.
0
testsuite/obj/fielddefs.gm.dat.err
Normal file
0
testsuite/obj/fielddefs.gm.dat.err
Normal file
4
testsuite/obj/fielddefs.gm.dat.out
Normal file
4
testsuite/obj/fielddefs.gm.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: fielddefs/main.qc (qc)
|
||||
writing 'obj/fielddefs.gm.dat'...
|
BIN
testsuite/obj/fields1.qcc.dat
Normal file
BIN
testsuite/obj/fields1.qcc.dat
Normal file
Binary file not shown.
2
testsuite/obj/fields1.qcc.dat.err
Normal file
2
testsuite/obj/fields1.qcc.dat.err
Normal file
|
@ -0,0 +1,2 @@
|
|||
[0;36mfields1/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
||||
[0;36mfields1/main.qc:5: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/fields1.qcc.dat.out
Normal file
4
testsuite/obj/fields1.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: fields1/main.qc (qc)
|
||||
writing 'obj/fields1.qcc.dat'...
|
BIN
testsuite/obj/functions-as-parameters.qcc.dat
Normal file
BIN
testsuite/obj/functions-as-parameters.qcc.dat
Normal file
Binary file not shown.
0
testsuite/obj/functions-as-parameters.qcc.dat.err
Normal file
0
testsuite/obj/functions-as-parameters.qcc.dat.err
Normal file
4
testsuite/obj/functions-as-parameters.qcc.dat.out
Normal file
4
testsuite/obj/functions-as-parameters.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: functions-as-parameters/main.qc (qc)
|
||||
writing 'obj/functions-as-parameters.qcc.dat'...
|
BIN
testsuite/obj/globaldefs.gm.dat
Normal file
BIN
testsuite/obj/globaldefs.gm.dat
Normal file
Binary file not shown.
4
testsuite/obj/globaldefs.gm.dat.err
Normal file
4
testsuite/obj/globaldefs.gm.dat.err
Normal file
|
@ -0,0 +1,4 @@
|
|||
[0;36mglobaldefs/main.qc:1: [0;36mwarning: [0munused global: `globf`
|
||||
[0;36mglobaldefs/main.qc:2: [0;36mwarning: [0munused global: `globv`
|
||||
[0;36mglobaldefs/main.qc:3: [0;36mwarning: [0munused global: `globs`
|
||||
[0;36mglobaldefs/main.qc:4: [0;36mwarning: [0mfunction `globfunc` has no body and in QC implicitly becomes a function-pointer
|
4
testsuite/obj/globaldefs.gm.dat.out
Normal file
4
testsuite/obj/globaldefs.gm.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: globaldefs/main.qc (qc)
|
||||
writing 'obj/globaldefs.gm.dat'...
|
BIN
testsuite/obj/if1.qcc.dat
Normal file
BIN
testsuite/obj/if1.qcc.dat
Normal file
Binary file not shown.
1
testsuite/obj/if1.qcc.dat.err
Normal file
1
testsuite/obj/if1.qcc.dat.err
Normal file
|
@ -0,0 +1 @@
|
|||
[0;36mif1/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/if1.qcc.dat.out
Normal file
4
testsuite/obj/if1.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: if1/main.qc (qc)
|
||||
writing 'obj/if1.qcc.dat'...
|
0
testsuite/obj/invalid-types-ok
Normal file
0
testsuite/obj/invalid-types-ok
Normal file
5
testsuite/obj/invalid.out
Normal file
5
testsuite/obj/invalid.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
[0;36minvalid-assign/main.qc:3: [0;31merror: [0mnot an l-value (binop)
|
||||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: invalid-assign/main.qc (qc)
|
||||
failed to generate function main
|
BIN
testsuite/obj/loops1.qcc.dat
Normal file
BIN
testsuite/obj/loops1.qcc.dat
Normal file
Binary file not shown.
2
testsuite/obj/loops1.qcc.dat.err
Normal file
2
testsuite/obj/loops1.qcc.dat.err
Normal file
|
@ -0,0 +1,2 @@
|
|||
[0;36mloops1/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
||||
[0;36mloops1/main.qc:7: [0;36mwarning: [0mfor loops are not recognized in the original Quake C standard, to enable try an alternate standard --std=?
|
4
testsuite/obj/loops1.qcc.dat.out
Normal file
4
testsuite/obj/loops1.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: loops1/main.qc (qc)
|
||||
writing 'obj/loops1.qcc.dat'...
|
BIN
testsuite/obj/maths1.qcc.dat
Normal file
BIN
testsuite/obj/maths1.qcc.dat
Normal file
Binary file not shown.
1
testsuite/obj/maths1.qcc.dat.err
Normal file
1
testsuite/obj/maths1.qcc.dat.err
Normal file
|
@ -0,0 +1 @@
|
|||
[0;36mmaths1/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/maths1.qcc.dat.out
Normal file
4
testsuite/obj/maths1.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: maths1/main.qc (qc)
|
||||
writing 'obj/maths1.qcc.dat'...
|
BIN
testsuite/obj/maths2.qcc.dat
Normal file
BIN
testsuite/obj/maths2.qcc.dat
Normal file
Binary file not shown.
1
testsuite/obj/maths2.qcc.dat.err
Normal file
1
testsuite/obj/maths2.qcc.dat.err
Normal file
|
@ -0,0 +1 @@
|
|||
[0;36mmaths2/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/maths2.qcc.dat.out
Normal file
4
testsuite/obj/maths2.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: maths2/main.qc (qc)
|
||||
writing 'obj/maths2.qcc.dat'...
|
BIN
testsuite/obj/ngraphs.qcc.dat
Normal file
BIN
testsuite/obj/ngraphs.qcc.dat
Normal file
Binary file not shown.
0
testsuite/obj/ngraphs.qcc.dat.err
Normal file
0
testsuite/obj/ngraphs.qcc.dat.err
Normal file
4
testsuite/obj/ngraphs.qcc.dat.out
Normal file
4
testsuite/obj/ngraphs.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: ngraphs/main.qc (qc)
|
||||
writing 'obj/ngraphs.qcc.dat'...
|
BIN
testsuite/obj/variadic.qcc.dat
Normal file
BIN
testsuite/obj/variadic.qcc.dat
Normal file
Binary file not shown.
1
testsuite/obj/variadic.qcc.dat.err
Normal file
1
testsuite/obj/variadic.qcc.dat.err
Normal file
|
@ -0,0 +1 @@
|
|||
[0;36mvariadic/main.qc:1: [0;36mwarning: [0mvariadic functions are not available in this standard
|
4
testsuite/obj/variadic.qcc.dat.out
Normal file
4
testsuite/obj/variadic.qcc.dat.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Mode: manual
|
||||
There are 1 items to compile:
|
||||
item: variadic/main.qc (qc)
|
||||
writing 'obj/variadic.qcc.dat'...
|
1
testsuite/variadic/output
Normal file
1
testsuite/variadic/output
Normal file
|
@ -0,0 +1 @@
|
|||
A test message Yeah
|
Loading…
Reference in a new issue