-Subproject commit 6860cd22ad558e5efa3bb183fa71bf3c10bc80a7
+Subproject commit 1b4487bfbb845050d0b5c0ed1a1564c9edf4f7ec
## Get the sources
-The source is accessible on [github](https://github.com).
+The source is accessible on [github](https:#!github.com).
Provided you have git installed, you can get it with:
``` sh
-git clone https://github.com/fennecdjay/gwion
+git clone https:#!github.com/fennecdjay/gwion
```
then change to the source directory
# Tests
-[test.sh](https://github.com/fennecdjay/Gwion/blob/dev/util/test.sh)
-requires [valgrind](http://valgrind.org/)
+[test.sh](https:#!github.com/fennecdjay/Gwion/blob/dev/util/test.sh)
+requires [valgrind](http:#!valgrind.org/)
there are two kinds of tests:
* [gwion](#gwion-tests)
* [bash](#bash-tests)
## Gwion tests
those tests are just gwion (.gw) files, handling special comments:
- * `// [skip]` (*optionally* followed by reason to skip)
- * `// [todo]` (*optionally* followed by reason to delay testing)
- * `// [contains]` followed by string to match
- * `// [excludes]` followed by string not to match
+ * `#! [skip]` (*optionally* followed by reason to skip)
+ * `#! [todo]` (*optionally* followed by reason to delay testing)
+ * `#! [contains]` followed by string to match
+ * `#! [excludes]` followed by string not to match
## Shell test
those tests are just bash (.sh) files.
@``` decl1.gw
Object @ref;
<<< "Reference points to no object yet: ", ref >>>;
-//Object o @=> ref;
+#!Object o @=> ref;
new Object @=> ref;
<<< "But now it does: ", ref >>>;
@```
## a simple (commented example)
@``` function0.gw
-// declare function 'test_function'
-// with return type int
-// taking an int as argument
+#! declare function 'test_function'
+#! with return type int
+#! taking an int as argument
fun int test_function(int arg) {
- // return the argument + 2
+ #! return the argument + 2
return arg + 2;
}
-// now call the function (and debug print the result)
+#! now call the function (and debug print the result)
<<< test_function(0) >>>;
-// or use alternate syntax
+#! or use alternate syntax
<<< 1 => test_function >>>;
@```
@exec make -s function0.test
--- /dev/null
+# Benchmarks
+
+We'll need a bash script
+
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+``` sh
+#!/bin/sh
+language=("gwion" "wren" "lua")
+extension=("gw" "wren" "lua")
+test_dir="tests/benchmark"
+plot_script="bench.plot"
+: "${repeats:=10}"
+
+run() {
+ perf stat -r"$repeats" "$1" "$test_dir/$3.$2" 2>&1 | grep "time elapsed" |
+ sed 's/ *\([0-9]*\),\([0-9]*\) .* seconds time elapsed *( +- *\([0-9]*\),\([0-9]*\)% )/\1.\2 \3.\4/'
+}
+
+get_list() {
+ for file in $test_dir/*.gw
+ do basename "$file" .gw
+ done
+}
+
+get_test() {
+ for (( i=0; i<=$(( ${#language[@]} -1 )); i++ ))
+ do echo "${language[$i]} $(run "${language[$i]}" "${extension[$i]}" "$1")"
+ done > "docs/assets/benchmark/$1.dat"
+}
+
+plot() {
+ gnuplot -e "bench='$1'" "$plot_script"
+}
+
+for bench in $(get_list)
+do
+echo $bench
+ get_test "$bench"
+ plot "$bench"
+ echo "### $bench"
+ echo '<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">'
+ echo "\`\`\`"
+ cat "$test_dir/$bench.gw"
+ echo "\`\`\`"
+ echo '</a></a></li></ul></ul></div>'
+ echo "![](assets/benchmark/$bench.png)"
+done
+```
+</a></a></li></ul></ul></div>
+
+### and a gnuplot script
+
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+``` plot
+set terminal png truecolor
+
+#if (!exists("bench"))
+# bench = 'bench'
+if (!exists("test_dir"))
+ test_dir = 'tests/benchmark'
+
+dat_name = sprintf("docs/assets/benchmark/%s.dat", bench)
+
+stats dat_name using 0:2 noout
+max = STATS_max_y+(0.1*STATS_max_y)
+
+set title bench
+set output sprintf("docs/assets/benchmark/%s.png", bench)
+set xrange [-0.5:((ceil(STATS_max_x))+0.5)]
+set yrange [0:max]
+set boxwidth 0.50
+set nokey
+set xtics nomirror
+set ytics nomirror
+
+set style fill transparent solid 0.25 # partial transparency
+set style fill noborder # no separate top/bottom lines
+
+plot dat_name using 0:2:($2*($3/100.0)):xtic(2) with boxerrorbar lc "blue" notitle, \
+ '' using 0:(max-(0.05*max)):1 with labels
+```
+</a></a></li></ul></ul></div>
+
+## Show the results
+Then just run it
+binary-trees
+### binary-trees
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+```
+// Ported from the Wren version.
+
+class Tree {
+ int item;
+ Tree @left, right;
+
+ fun static Tree new_Tree(int it, int depth) {
+ Tree t;
+ it => t.item;
+ if (depth > 0) {
+ it + it => int item2;
+ --depth;
+ Tree.new_Tree(item2 - 1, depth) @=> t.left;
+ Tree.new_Tree(item2, depth) @=> t.right;
+ }
+ return t;
+ }
+
+ fun int check() {
+ if (!left)
+ return item;
+ return item + left.check() - right.check();
+ }
+}
+
+4 => int minDepth;
+12 => int maxDepth;
+maxDepth + 1 => int stretchDepth;
+
+<<< "stretch tree of depth ", stretchDepth, " check: ",
+ Tree.new_Tree(0, stretchDepth).check() >>>;
+
+Tree.new_Tree(0, maxDepth) @=> Tree@ longLivedTree;
+
+// iterations = 2 ** maxDepth
+1 => int iterations;
+for (int d; d < maxDepth; ++d)
+ 2 *=> iterations;
+
+minDepth => int depth;
+while (depth < stretchDepth) {
+ int check;
+ for (int i; i < iterations; ++i)
+ Tree.new_Tree(i, depth).check() + Tree.new_Tree(-i, depth).check() +=> check;
+
+ <<< iterations * 2, " trees of depth ", depth, " check: ", check >>>;
+ 4 /=> iterations;
+ 2 +=> depth;
+}
+
+<<< "long lived tree of depth ", maxDepth, " check: ", longLivedTree.check() >>>;
+```
+</a></a></li></ul></ul></div>
+![](assets/benchmark/binary-trees.png)
+fib
+### fib
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+```
+class Fib {
+ fun static int get(int n) {
+ if (n < 2) return n;
+ return get(n - 1) + get(n - 2);
+ }
+}
+repeat(5)
+ <<< Fib.get(28) >>>;
+```
+</a></a></li></ul></ul></div>
+![](assets/benchmark/fib.png)
+fib-recurs
+### fib-recurs
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+```
+fun int recursive_fib(int n) {
+ if (n < 2)
+ return n;
+ else
+ return recursive_fib(n - 2) + recursive_fib(n - 1);
+}
+//<<< 5 => recursive_fib >>>;
+<<< 40 => recursive_fib >>>;
+```
+</a></a></li></ul></ul></div>
+![](assets/benchmark/fib-recurs.png)
+method-call
+### method-call
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+```
+class Toggle {
+ bool state;
+ fun bool value() { return state; }
+ fun Toggle activate() {
+ !state => state;
+ return this;
+ }
+}
+
+class NthToggle extends Toggle {
+ int count, countMax;
+ fun Toggle activate() {
+ if(++count >= countMax) {
+ (this $ Toggle).activate();
+ 0 => count;
+ }
+ return this;
+ }
+}
+
+100000 => int n;
+
+Toggle toggle;
+true => bool val => toggle.state;
+
+repeat(n) {
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+ toggle.activate().value() => val;
+}
+
+<<< toggle.value() >>>;
+
+NthToggle ntoggle;
+true => val => ntoggle.state;
+3 => ntoggle.countMax;
+
+repeat(n) {
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+ ntoggle.activate().value() => val;
+}
+
+<<< ntoggle.value() >>>;
+```
+</a></a></li></ul></ul></div>
+![](assets/benchmark/method-call.png)
-gwion 0.191172 0.51
-wren 0.23937 0.44
-lua 0.30958 0.46
+gwion 0.18819 0.63
+wren 0.24076 2.13
+lua 0.32172 0.82
-gwion 5.3121 0.52
-wren 13.5283 0.47
-lua 7.4075 0.63
+gwion 5.4137 0.34
+wren 13.5268 0.22
+lua 7.2720 0.33
-gwion 0.086447 0.50
-wren 0.22208 0.66
-lua 0.21990 0.76
+gwion 0.086401 0.30
+wren 0.220461 0.23
+lua 0.22028 0.93
-gwion 0.091942 0.20
-wren 0.108581 0.42
-lua 0.25822 1.11
+gwion 0.091115 0.35
+wren 0.107178 0.46
+lua 0.25818 1.72
-// Ported from the Wren version.
+#! Ported from the Wren version.
class Tree {
int item;
Tree.new_Tree(0, maxDepth) @=> Tree@ longLivedTree;
-// iterations = 2 ** maxDepth
+#! iterations = 2 ** maxDepth
1 => int iterations;
for (int d; d < maxDepth; ++d)
2 *=> iterations;
else
return recursive_fib(n - 2) + recursive_fib(n - 1);
}
-//<<< 5 => recursive_fib >>>;
+#!<<< 5 => recursive_fib >>>;
<<< 40 => recursive_fib >>>;
Object o;
Object @ref;
"test" => string s;
-//<<< t.assert_equal("test", 1, 1) >>>;
-//<<< t.assert_equal("test", 2, 1) >>>;
+#!<<< t.assert_equal("test", 1, 1) >>>;
+#!<<< t.assert_equal("test", 2, 1) >>>;
<<< t.assert_equal(s, 1, 1) >>>;
<<< t.assert_equal(s, 2, 1 + 1) >>>;
<<< t.assert_equal(s, 2, 1) >>>;
-//! doc for class 'C'
+#!! doc for class 'C'
class C
{
- //! has an int
+ #!! has an int
int i;
- //! a fun
+ #!! a fun
fun void test() {}
- //! operator
+ #!! operator
operator => void(C c, C d){
<<< c, " ", d >>>;
}
do { <<< i-- >>>; } while(i);
5 => float f;
do { <<< 1 -=> f >>>; } while(f > 0.0);
-// do { <<< 1 -=> f >>>; } while(f > 0);
+#! do { <<< 1 -=> f >>>; } while(f > 0);
5 => f;
do { <<< 1 -=> f >>>; } until(f == 0);
-//do { <<< 1 -=> f >>>; } until(f == 0.0);
+#!do { <<< 1 -=> f >>>; } until(f == 0.0);
5 => i;
do { <<< i-- >>>; } until(!i);
-// thanks to afl-fuzz
+#! thanks to afl-fuzz
SinOsc@s, t;
Gain g => dac;
1 => t.freq;
-// coverage for 'float'. (generated by util/coverage.sh)
+#! coverage for 'float'. (generated by util/coverage.sh)
float a;
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1=variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1+variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1-variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1*variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
1 => float variable2;
<<< variable1/variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1&&variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1||variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1==variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1!=variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1>variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1>=variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1<variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1<=variable2 >>>;
}
-//testing operator for and float
+#!testing operator for and float
{
float variable2;
<<< -variable2 >>>;
}
-//testing operator for and int
+#!testing operator for and int
{
int variable2;
<<< !variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1=>variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1+=>variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1-=>variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1*=>variable2 >>>;
}
-//testing operator for float and float
+#!testing operator for float and float
{
float variable1;
float variable2;
<<< variable1/=>variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1=variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1+variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1-variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1*variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1/variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1&&variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1||variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1==variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1!=variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1>variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1>=variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1<variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1<=variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1=>variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1+=>variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1-=>variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1*=>variable2 >>>;
}
-//testing operator for int and float
+#!testing operator for int and float
{
int variable1;
float variable2;
<<< variable1/=>variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1+variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1-variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1*variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1/variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1&&variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1||variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1==variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1!=variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1>variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1>=variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1<variable2 >>>;
}
-//testing operator for float and int
+#!testing operator for float and int
{
float variable1;
int variable2;
<<< variable1<=variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1=>variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1+variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1-variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1*variable2 >>>;
}
-//testing operator for dur and float
+#!testing operator for dur and float
{
dur variable1;
float variable2;
<<< variable1*variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1/variable2 >>>;
}
-//testing operator for dur and float
+#!testing operator for dur and float
{
dur variable1;
float variable2;
<<< variable1/variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1>variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1>=variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1<variable2 >>>;
}
-//testing operator for dur and dur
+#!testing operator for dur and dur
{
dur variable1;
dur variable2;
<<< variable1<=variable2 >>>;
}
-//testing operator for time and time
+#!testing operator for time and time
{
time variable1;
time variable2;
<<< variable1=>variable2 >>>;
}
-//testing operator for dur and time
+#!testing operator for dur and time
{
dur variable1;
time variable2;
<<< variable1=>variable2 >>>;
}
-//testing operator for dur and
+#!testing operator for dur and
{
dur variable1;
<<< variable1=> now >>>;
}
-//testing operator for time and dur
+#!testing operator for time and dur
{
time variable1;
dur variable2;
<<< variable1+variable2 >>>;
}
-//testing operator for dur and time
+#!testing operator for dur and time
{
dur variable1;
time variable2;
<<< variable1+variable2 >>>;
}
-//testing operator for time and time
+#!testing operator for time and time
{
time variable1;
time variable2;
<<< variable1>variable2 >>>;
}
-//testing operator for time and time
+#!testing operator for time and time
{
time variable1;
time variable2;
<<< variable1>=variable2 >>>;
}
-//testing operator for time and time
+#!testing operator for time and time
{
time variable1;
time variable2;
<<< variable1<variable2 >>>;
}
-//testing operator for time and time
+#!testing operator for time and time
{
time variable1;
time variable2;
<<< 0.0 || i >>>;
-//<<< 1.0 == i >>>;
-//<<< 1.0 != i >>>;
+#!<<< 1.0 == i >>>;
+#!<<< 1.0 != i >>>;
<<< 1.0 +=> i >>>;
UGen @u;
-//u.last(); // should fail => fails.
+#!u.last(); // should fail => fails.
SinOsc s => Gain g => dac;
for(-1 => int i;i < 6; i++)
i => g.op;
samp => now;
s.last();
-//s.chan(2);
-//dac.chan(1);
+#!s.chan(2);
+#!dac.chan(1);
samp => now;
-// there a bug somewhere.
-// probably deref 'dac' to many mul ...
-//dac => blackhole;
-//dac =< blackhole;
-//dac =< s;
-//dac =< s;
+#! there a bug somewhere.
+#! probably deref 'dac' to many mul ...
+#!dac => blackhole;
+#!dac =< blackhole;
+#!dac =< s;
+#!dac =< s;
s =< dac;
s =< dac;
-//dac =< s;
+#!dac =< s;
-// [contains] cannot
+#! [contains] cannot
void this_won_t_work;
-// [contains] is abstract, declare as ref
+#! [contains] is abstract, declare as ref
Shred shred;
-// [contains] has already been defined in parent class
+#! [contains] has already been defined in parent class
class C {
int i;
}
-// [contains] primitive types cannot be used as reference
+#! [contains] primitive types cannot be used as reference
fun void test(int @i){}
-// [contains] this is reserved
+#! [contains] this is reserved
fun void test(int this){}
-// [contains] do not provide array
+#! [contains] do not provide array
[1,2,3,4] @=> int loop[1];
-// [contains] array depths do not match
+#! [contains] array depths do not match
[1,2,3,4] @=> int k[1][1];
-// [contains] partially empty array init
+#! [contains] partially empty array init
int i[2][];
-// [contains] partially empty array init
+#! [contains] partially empty array init
int i[][3];
-// [contains] exceeds defined dimension
+#! [contains] exceeds defined dimension
int i[2];
i[0][0];
-// [contains] contains incompatible types
+#! [contains] contains incompatible types
[null, 1];
-// [contains] must be of type 'int'
+#! [contains] must be of type 'int'
int i[4];
i[null];
-// [contains] invalid format for array init
+#! [contains] invalid format for array init
[ [1,2] [3,4] ];
-// [contains] NullPtrException
+#! [contains] NullPtrException
int i[1][1];
null @=> i[0];
<<< i[0][0] >>>;
-// [contains] ArrayOutofBounds
+#! [contains] ArrayOutofBounds
Object o[1][1];
o[1];
-// [contains] non-mutable
+#! [contains] non-mutable
[1,2,3,4] @=> [1][1];
-// [contains] has no member
+#! [contains] has no member
int i[2][2];
i[0].test;
-// [contains] ArrayOutofBounds
+#! [contains] ArrayOutofBounds
Object i[1];
i[1];
-// [contains] ArrayOutofBounds
+#! [contains] ArrayOutofBounds
Object i[1][1];
i[1][0];
-// [contains] array types do not match
+#! [contains] array types do not match
[1,2,3,4] @=> Object k[1];
-// [contains] not allowed in auto loop
+#! [contains] not allowed in auto loop
Object i;
for(auto a: i)
<<< a >>>;
-// [contains] 'break' found outside of for/while/until
+#! [contains] 'break' found outside of for/while/until
break;
-// [contains] cannot find class
+#! [contains] cannot find class
class C {
class D {
int i;
-// [contains] is not constant
-// also coverage for 'case'
+#! [contains] is not constant
+#! also coverage for 'case'
enum {zero, one, a , b, c };
class C {
-// [contains] is not const
+#! [contains] is not const
int i;
switch(maybe) {
case i:
-// [contains] unhandled expression type
+#! [contains] unhandled expression type
int i[1];
switch(maybe) {
case i[0]: break;
-// [contains] unknown type
+#! [contains] unknown type
1 $ UnknownType;
-// [contains] unary operator '--' cannot be used on non-mutable data-types
+#! [contains] unary operator '--' cannot be used on non-mutable data-types
class C
{
enum { a, b };
-// [contains] declared inside itself
+#! [contains] declared inside itself
class c {
c var;
}
-// [contains] extraneous component of complex value
+#! [contains] extraneous component of complex value
#(0,0,0,0);
-// [contains] function name 'test' conflicts with previously defined value
+#! [contains] function name 'test' conflicts with previously defined value
class C { int test;
}
-// [contains] right-side operand is non-mutable
+#! [contains] right-side operand is non-mutable
fun void test(const int i) {
10 => i;
}
-// [contains] right-side operand is non-mutable
+#! [contains] right-side operand is non-mutable
10 => const int i;
12 => i;
<<< i >>>;
-// [contains] 'continue' found outside of for/while/until
+#! [contains] 'continue' found outside of for/while/until
continue;
-// (contains] default case already defined
+#! (contains] default case already defined
switch(maybe) {
default:
default:
-// [contains] already defined
+#! [contains] already defined
class C{}
class C{}
-// [contains] ZeroDivideException
+#! [contains] ZeroDivideException
[ #(0.0, 0/0) ];
-// [contains] dtor must be in class def!!
+#! [contains] dtor must be in class def!!
dtor {}
-// [contains] duplicated cases value
+#! [contains] duplicated cases value
switch(maybe) {
case 1:
case 1:
-// [contains] empty for loop condition
+#! [contains] empty for loop condition
<<< "test" >>>;
for(;;){}
-// [contains] NullPtrException
+#! [contains] NullPtrException
class C
{
typedef void test();
-// [contains] NullPtrException
+#! [contains] NullPtrException
class C
{
int i;
-// [contains] already been defined
+#! [contains] already been defined
int i;
enum
{
-// [contains] already declared
+#! [contains] already declared
enum
{
first
-// [contains] already been defined
+#! [contains] already been defined
int i;
enum
{
-// [contains] already declared
+#! [contains] already declared
enum
{
first
-// [contains] already declared as variable
+#! [contains] already declared as variable
enum
{
first,
-// [contains] right-side operand is non-mutable
+#! [contains] right-side operand is non-mutable
const int i;
12 => i;
-// [contains] NullEventWait
+#! [contains] NullEventWait
Event @e;
e => now;
-// [contains] not allowed
+#! [contains] not allowed
class C extends Event{}
Event e @=> C o;
-// [contains] must be defined with empty
+#! [contains] must be defined with empty
fun int[] my_func(int i[2]){}
-// [contains] already declared
+#! [contains] already declared
fun void test(int i, int i){}
-// [contains] unknown type
+#! [contains] unknown type
fun void my_func(unknown_type unknown_arg){}
-// [contains] in function:
+#! [contains] in function:
fun void test() { <<< b >>>; }
-// [contains] unknown type
+#! [contains] unknown type
fun void test() { skfuv sd; }
-// [contains] argument type(s) do not match for fun
+#! [contains] argument type(s) do not match for fun
fun void test(){}
fun void test(int i[], int j[]){}
test(1,2);
-// [contains] function call using a non-function value
+#! [contains] function call using a non-function value
null();
-// [contains] NullPtrException
+#! [contains] NullPtrException
typedef void Test()
Test test;
test();
-// [contains] must be defined with empty
+#! [contains] must be defined with empty
fun int[1] my_func(int i[]){}
-// [contains] unknown type
+#! [contains] unknown type
fun unknwon_type my_function(){}
-// [contains] cannot declare variables of size
+#! [contains] cannot declare variables of size
fun void test(void v){}
-// [contains]
+#! [contains]
fun void test()
{
fun void nested(){}
-// [contains] primitive types cannot be used as reference
+#! [contains] primitive types cannot be used as reference
fun int@ test(){}
-// [contains] is already used by another value
+#! [contains] is already used by another value
int i;
fun void i(){}
-// [contains] global function 'test' already defined for those arguments
+#! [contains] global function 'test' already defined for those arguments
fun void test(){}
fun void test(){}
-// [contains] incompatible types
+#! [contains] incompatible types
maybe ? null : 1;
-// [contains] Invalid type
+#! [contains] Invalid type
null ? <<< 1 >>> : <<< 2 >>>;
-// [contains] invalid array acces expression
+#! [contains] invalid array acces expression
int j[];
j[1,2,3,4] @=> i;
-// [contains] no match found for operator
+#! [contains] no match found for operator
class C {}
class D {}
D d;
-// [contains] in 'for' condition
+#! [contains] in 'for' condition
for(;null;);
-// [contains] invalid return type
+#! [contains] invalid return type
fun void test() { return 1; }
-// [contains] conditional must be of type
+#! [contains] conditional must be of type
switch(null){}
-// [contains] in 'until' condition
+#! [contains] in 'until' condition
until(null);
-// [contains] in 'while' condition
+#! [contains] in 'while' condition
while(null);
-// [contains] already defined
+#! [contains] already defined
test:
test:
;
-// [contains] defined but not used
+#! [contains] defined but not used
test:
;
-// [contains] used but not defined
+#! [contains] used but not defined
goto test;
-// [contains] used but not defined
+#! [contains] used but not defined
goto here;
here:
goto test;
-// [contains] argument number does not match for lambda
+#! [contains] argument number does not match for lambda
\a b { <<< a, " ", b >>>; }(1);
-// [contains] argument number does not match for lambda
+#! [contains] argument number does not match for lambda
typedef void ptr_t(int i);
\a b { <<< a, " ", b >>>; } @=> ptr_t ptr;
ptr(2);
-// [contains] argument number does not match for lambda
+#! [contains] argument number does not match for lambda
typedef void ptr_t(int i);
\a b { <<< a, " ", b >>>; } @=> ptr_t ptr;
fun void test(ptr_t ptr) {
-// [contains] conditional must be of type
+#! [contains] conditional must be of type
complex c;
repeat(c)
<<< "error" >>>;
-// [contains]
+#! [contains]
class C {
int i;
fun static void test() {
-// [contains] ZeroDivideException
+#! [contains] ZeroDivideException
[ 1%0, 2, 3, 4, 5 ];
-// [contains] from/to a multi-variable declaration
+#! [contains] from/to a multi-variable declaration
int i, ii => float f;
-// [contains] conflicts with previously defined value
+#! [contains] conflicts with previously defined value
class C {
int test;
}
-// [contains] can only be used at class scope.
+#! [contains] can only be used at class scope.
union private { int i; } u;
-// [contains] can only be used at class scope.
+#! [contains] can only be used at class scope.
union static private { int i; } u;
-// [contains] can only be used at class scope.
+#! [contains] can only be used at class scope.
union static { int i; } u;
-// [contains] NegativeArraySize: while allocating arrays
+#! [contains] NegativeArraySize: while allocating arrays
int i[-1];
<<< i >>>;
-// [contains] ArrayOutofBounds
+#! [contains] ArrayOutofBounds
int i[2][2];
<<< i[1][-1] >>>;
<<< -1 >>>;
-// [contains] instantiate with empty
+#! [contains] instantiate with empty
new Object[];
-// [contains] primitive types cannot be used as reference
+#! [contains] primitive types cannot be used as reference
new int;
-// [contains] no match found for operator
+#! [contains] no match found for operator
class C{}
class D{}
-// [contains] must be of type 'int'
+#! [contains] must be of type 'int'
int i[4];
Object o;
i[o];
-// [contains] incompatible array subscript type
+#! [contains] incompatible array subscript type
Object o;
int i[o];
<<< i >>>;
-// [contains] does not have members - invalid use in dot expression
+#! [contains] does not have members - invalid use in dot expression
int i;
i.nothing;
-// [contains] template call of non-function value
+#! [contains] template call of non-function value
int test;
test<~int~>();
-// [contains] not legit
+#! [contains] not legit
s;
-// [contains] NullPtrException
+#! [contains] NullPtrException
int i[];
i[0];
-// [contains] NullPtrException
+#! [contains] NullPtrException
int i[][];
i[0][0];
-// [contains] NullPtrException
+#! [contains] NullPtrException
int i[];
for(auto a : i)
<<< a >>>;
-// [contains] no match found for operator
+#! [contains] no match found for operator
Object o;
null +=> o;
-// [contains] no match found for operator
+#! [contains] no match found for operator
class C
{
-// [contains] conflicts with previously defined value
+#! [contains] conflicts with previously defined value
class C
{
int test;
-// [contains] but cannot override
+#! [contains] but cannot override
class C
{
fun static void test() {}
-// [contains] but cannot override
+#! [contains] but cannot override
class C
{
fun void test() {}
-// [contains] can only be used at class scope
+#! [contains] can only be used at class scope
typedef static void my_fun(){}
-// [contains] unknown type
+#! [contains] unknown type
typedef unknown_type my_fun(){}
-// [contains] unknown type
+#! [contains] unknown type
typedef void my_func(unknown_type type);
-// [contains] polar value #1
+#! [contains] polar value #1
%(null, 0);
-// [contains] polar value #2
+#! [contains] polar value #2
%(0, null);
-// [contains] extraneous component of polar value
+#! [contains] extraneous component of polar value
%(0,0,0,0);
-// [contains] cannot be used on non-mutable data-type
+#! [contains] cannot be used on non-mutable data-type
1++;
-// [contains] cannot be used on non-mutable data-type
+#! [contains] cannot be used on non-mutable data-type
true++;
-// [contains] no match found for operator
+#! [contains] no match found for operator
Object o;
o++;
-// [contains] cannot extend primitive
+#! [contains] cannot extend primitive
class C extends int {}
-// [contains] primitive types cannot be used as reference
+#! [contains] primitive types cannot be used as reference
int @i;
-// [contains] can't access private
+#! [contains] can't access private
class C { private int i; }
C c;
-// [contains] can't access private
+#! [contains] can't access private
class C {
fun private void test(){}
}
-// [contains] can't access private
+#! [contains] can't access private
class C {
fun private void test(){}
}
-// [contains] can only be used at class scope
+#! [contains] can only be used at class scope
fun private void test(){}
-// [contains] can only be used at class scope
+#! [contains] can only be used at class scope
private int i;
-// [contains] can't access private
+#! [contains] can't access private
class C { private int i; }
class D {
-// [contains] must provide values/expressions for array
+#! [contains] must provide values/expressions for array
[ ];
-// [contains] cannot declare variables of size '0'
+#! [contains] cannot declare variables of size '0'
typedef void my_func(void arg){}
-// [contains] must be defined with empty
+#! [contains] must be defined with empty
typedef void my_func (int i[4]){}
-// [contains] can't assign non member function to member function pointer
+#! [contains] can't assign non member function to member function pointer
class C {
typedef void Test();
Test test;
-// [contains] can't assign member function to non member function pointer
+#! [contains] can't assign member function to non member function pointer
typedef void Test();
Test test;
class D {
-// [contains] can't assign member function to a pointer of an other class
+#! [contains] can't assign member function to a pointer of an other class
class C {
typedef void Test();
Test test;
-// [contains] has already been defined in the same scope
+#! [contains] has already been defined in the same scope
int i;
typedef void i(){}
-// [contains] no match found
+#! [contains] no match found
fun void test(int i){}
fun void test(float f){}
-// [contains] primitive types cannot be used as reference
+#! [contains] primitive types cannot be used as reference
typedef void my_func(int @i){}
-// [contains] can only be used at class scope
+#! [contains] can only be used at class scope
typedef static void Test();
-// [contains] can only be used at class scope
+#! [contains] can only be used at class scope
typedef static void Test(int i);
-// [contains] recursive
+#! [contains] recursive
class C {}
class D extends C {}
class E extends F {}
-// [contains] 'return' statement found outside function definition
+#! [contains] 'return' statement found outside function definition
return;
-// [contains] right-side operand is non-mutable
+#! [contains] right-side operand is non-mutable
2 => 1;
-// [contains] only function calls can be sporked
+#! [contains] only function calls can be sporked
int i;
<<< i >>>;
spork i;
-// [contains] can only be used at class scope
+#! [contains] can only be used at class scope
static int i;
-// [contains somewhere] stray in program
+#! [contains somewhere] stray in program
**µ
-// [contains] you must provide template types
+#! [contains] you must provide template types
class<~A~> C {
A a;
}
-// [contains]
+#! [contains]
fun void test<~A,B~>(){}
test();
-// [contains] arguments do not match for template call
+#! [contains] arguments do not match for template call
fun void test<~A~>(){ <<< "func" >>>;}
fun void test<~A~>(int i){<<< "other func" >>>;}
test<~int, float, int~>();
-//test<~int~>();
+#!test<~int~>();
-// [contains] arguments do not match for template call
+#! [contains] arguments do not match for template call
class C {
fun void test<~A~>(float f) {}
fun void test<~A~>() {}
}
C c;
-//c.test<~int~>();
+#!c.test<~int~>();
c.test<~int~>(2.3);
c.test<~int~>(2.3, 2.3);
-// [contains]
+#! [contains]
Math.rand<~int~>();
-// [contains] invalid expression for function call
+#! [contains] invalid expression for function call
fun void test<~A~>(A a){}
(maybe ? test : test)(1);
-// [contains] unknown type
+#! [contains] unknown type
fun void my_function<~A~>() { <<< "test" >>>; }
my_function<~unknown_type~>();
-// [contains] keyword 'this' can be used only inside class definition
+#! [contains] keyword 'this' can be used only inside class definition
this;
-// [contains] keyword 'this' must be associated with object instance
+#! [contains] keyword 'this' must be associated with object instance
class C {}
C.this;
-// [contains] keyword 'this' cannot be used inside static functions
+#! [contains] keyword 'this' cannot be used inside static functions
class C
{
fun static void test(){ <<< this >>>; }
-// [contains] is not template
+#! [contains] is not template
<~int~>Object o;
-// [contains] unknown type
+#! [contains] unknown type
fun void test(B->C a){}
-// [contains] no match found for operator
+#! [contains] no match found for operator
int i;
*i;
-// [contains] unknown type
+#! [contains] unknown type
class C extends Undefined {}
C c;
<<< c >>>;
\ No newline at end of file
-// [contains]
+#! [contains]
union
{
one; two;
-// [contains] must be defined with empty
+#! [contains] must be defined with empty
union {
int i;
int @array[4];
-// [contains] can only be used at class scope.
+#! [contains] can only be used at class scope.
union static { int i; };
-// [contains] can only be used at class scope.
+#! [contains] can only be used at class scope.
union static private { int i; };
-// [contains] can only be used at class scope.
+#! [contains] can only be used at class scope.
union private { int i; };
-// [contains] Unions should only contain declarations
+#! [contains] Unions should only contain declarations
union
{
one; two;
-// [contains] In union, Objects must be declared as reference (use '@')
+#! [contains] In union, Objects must be declared as reference (use '@')
union
{
int i;
-// [contains] unknown_type
+#! [contains] unknown_type
union
{
unknown_type unknown_variable;
-// (contains] unrecognized escape sequence
+#! (contains] unrecognized escape sequence
'\o';
-// [contains] unknown type
+#! [contains] unknown type
new kugsqd;
-// [contains] unknown type
- // hit the error with an unknown type
+#! [contains] unknown type
+ #! hit the error with an unknown type
unknown_type variable;
-// [contains] you are trying to use a upper label
+#! [contains] you are trying to use a upper label
end:
goto end;
-// [contains] has already been defined in the same scope
+#! [contains] has already been defined in the same scope
int i;
int i;
-// [contains] vararg.start not used before vararg.end. this is an error
+#! [contains] vararg.start not used before vararg.end. this is an error
fun void test(int i, ...) {
vararg.end;
-// vararg.start;
+#! vararg.start;
}
test(1, 2.3, null);
-// [contains] vararg.start already used. this is an error
+#! [contains] vararg.start already used. this is an error
fun void test(...) { vararg.start; vararg.start;}
-// [contains] vararg.start not used before vararg.end. this is an error
+#! [contains] vararg.start not used before vararg.end. this is an error
fun void test(int i, ...) {
vararg.end;
-// vararg.start;
+#! vararg.start;
}
test(1, 2.3, null);
-// [contains] in vector value
+#! [contains] in vector value
@(0,0,0,null);
-// [contains] extraneous component of
+#! [contains] extraneous component of
@(0,0,0,0,0);
-// [contains] cannot access member
+#! [contains] cannot access member
class C {
int i;
}
-//[contains] cant't assign
+#![contains] cant't assign
class C {
fun static void test(int i) { <<< "int arg" >>>; }
typedef void PtrType(int i);
-// [contains] can't assign
+#! [contains] can't assign
class C {
fun void test(int i) { <<< "int arg" >>>; }
typedef static void PtrType(int i);
fun Vec4 test(int i) { <<< "test with arg ", i >>>; }
-//typedef Vec4 PT();
-//test @=>
+#!typedef Vec4 PT();
+#!test @=>
PtrTypeI p;
test @=> p;
-//test @=> PT ti;
+#!test @=> PT ti;
<<< test >>>;
-//<<< ti >>>;
+#!<<< ti >>>;
<<< p >>>;
-//ti();
+#!ti();
<<< "test" >>>;
p(2);
<<< "end" >>>;
-//class child {}
-//template<~A, B~>
-//class C{ A key; B value; }
-//<~int, int~>C c1;
-//<float, float>C c2;
-//<<< c1 >>>;
-//<<< c2 >>>;
-//<<< c2.value >>>;
+#!class child {}
+#!template<~A, B~>
+#!class C{ A key; B value; }
+#!<~int, int~>C c1;
+#!<float, float>C c2;
+#!<<< c1 >>>;
+#!<<< c2 >>>;
+#!<<< c2.value >>>;
<~int, int~>ClassTemplate ct;
<<< ct.key >>>;
-//<float, float>ClassTemplate ct2;
-//<<< ct2.key >>>;
-//<child, float>ClassTemplate ct3;
-//<<< ct3.key >>>;
+#!<float, float>ClassTemplate ct2;
+#!<<< ct2.key >>>;
+#!<child, float>ClassTemplate ct3;
+#!<<< ct3.key >>>;
-// untyped global enum
+#! untyped global enum
<<< ENUM0 >>>;
<<< ENUM1 >>>;
<<< ENUM2 >>>;
<<< ENUM8 >>>;
<<< ENUM9 >>>;
-// typed global enum
+#! typed global enum
<<< TYPED_ENUM0 >>>;
<<< TYPED_ENUM1 >>>;
<<< TYPED_ENUM2 >>>;
<<< TYPED_ENUM8 >>>;
<<< TYPED_ENUM9 >>>;
-// in class
-// untyped global enum
+#! in class
+#! untyped global enum
<<< Enum.ENUM0 >>>;
<<< Enum.ENUM1 >>>;
<<< Enum.ENUM2 >>>;
<<< Enum.ENUM8 >>>;
<<< Enum.ENUM9 >>>;
-// Enum.typed global enum
+#! Enum.typed global enum
<<< Enum.TYPED_ENUM0 >>>;
<<< Enum.TYPED_ENUM1 >>>;
<<< Enum.TYPED_ENUM2 >>>;
-//<<< StaticString.self >>>;
+#!<<< StaticString.self >>>;
<<< self >>>;
1/i;
<<< "id: ", (spork t(i-1)).id() >>>;
me.yield();
-//samp => now;
+#!samp => now;
}
10 => t;
-//me.yield();
+#!me.yield();
second => now;
me.yield();
<<< "end" >>>;
global C g_c;
<<< g_c, "->i => ", g_c.i >>>;
fun global void g_test() { <<< g_i >>>; <<< g_c >>>; <<< g_c.i >>>; <<< "test" >>>; }
-//fun global void g_test() { <<< "test" >>>; }
+#!fun global void g_test() { <<< "test" >>>; }
<<< g_test >>>;
<<< g_test() >>>;
<<< g_test >>>;
g_test();
-//g_test();
-//g_test();
+#!g_test();
+#!g_test();
class C {
typedef void ptr_t(int i,int j);
\a b { <<< this, " ", a, " ", b, " test" >>>; } @=> ptr_t ptr;
-// `a,b` { <<< "test" >>>; } @=>
-// ptr_t ptr;
-// ptr(1,2);
+#! `a,b` { <<< "test" >>>; } @=>
+#! ptr_t ptr;
+#! ptr(1,2);
fun void test(int i, int j) { <<< this, " ", i, " ", j >>>; }
-// fun void test(ptr_t t, int i) {
-//<<< t >>>;
-// t(2,i);
-// }
-// test(`a,b` { <<< this, " lambda argument" >>>; }, 2);
+#! fun void test(ptr_t t, int i) {
+#!<<< t >>>;
+#! t(2,i);
+#! }
+#! test(`a,b` { <<< this, " lambda argument" >>>; }, 2);
}
-//<<< C c >>>;
+#!<<< C c >>>;
C c;
<<< c >>>;
-//<<< c.test >>>;
-//<<< c.ptr >>>;
-//c.ptr(1,2);
-//<<< c.test >>>;
+#!<<< c.test >>>;
+#!<<< c.ptr >>>;
+#!c.ptr(1,2);
+#!<<< c.test >>>;
c.test @=> c.ptr;
-//c.ptr;
-//<<< c.ptr >>>;
-//c.test(1,2);
+#!c.ptr;
+#!<<< c.ptr >>>;
+#!c.test(1,2);
c.ptr(1, 2);
-//c.ptr(1, 2);
-//c.ptr(1, 2);
-//(1,2) => c.ptr;
-//c.test(`a,b` { <<< this, "lambda argument" >>>; }, 2);
-//c.test(c.ptr, 2);
-//<<< c.ptr >>>;
-//c.ptr;
+#!c.ptr(1, 2);
+#!c.ptr(1, 2);
+#!(1,2) => c.ptr;
+#!c.test(`a,b` { <<< this, "lambda argument" >>>; }, 2);
+#!c.test(c.ptr, 2);
+#!<<< c.ptr >>>;
+#!c.ptr;
typedef void ptr_t(int i);
\a { <<< this, " ", a >>>; } @=>
ptr_t ptr;
-//ptr(3);
+#!ptr(3);
fun void t1(int i) { <<< this, " t1 ", i >>>; }
fun void test(ptr_t ptr) {
<<< this >>>;
ptr(1);
}
t1 @=> ptr_t t1p;
-//test(t1$ptr_t);
+#!test(t1$ptr_t);
test(t1p);
-//test(ptr);
-//<<< t1 >>>;
-//<<< t1$ptr_t >>>;
+#!test(ptr);
+#!<<< t1 >>>;
+#!<<< t1$ptr_t >>>;
}
<<< C c >>>;
<<< c.test(c.ptr) >>>;
fun void _t() { <<< __func__ >>>; }
fun int t() {
-//<<< 1 >>>;
+#!<<< 1 >>>;
spork _t();
spork \a{ <<< __func__, " ", a >>>; }(1);
fun void test() {
-// <<< 1 >>>;
-//spork \{<<< 2 >>>;}();
+#! <<< 1 >>>;
+#!spork \{<<< 2 >>>;}();
}
test();
test();
}
spork launch(2);
-//second => now;
+#!second => now;
me.yield();
-//.1::samp => now;
+#!.1::samp => now;
launch(12);
fun void launch(int i) {
<<< " launch ", i >>>;
}
-//spork launch(2);
+#!spork launch(2);
me.yield();
class C { fun static C t() { C c; <<< c, " something" >>>;
return c; } }
-//C c;
+#!C c;
<<< C.t() >>>;
-//[contains] macro already defined
+#![contains] macro already defined
#define macro
#define macro
-//[contains] not enough arguments
+#![contains] not enough arguments
#define macro(a, b) a, b
<<< macro(1) >>>;
-//[contains] too many arguments
+#![contains] too many arguments
#define macro(a) a
<<< macro(1,2) >>>;
-//[contains] 'macro' defined"
-//[contains] 'macro' undefined (after undefining)"
+#![contains] 'macro' defined"
+#![contains] 'macro' undefined (after undefining)"
#define macro
#ifdef macro
<<< "'macro' defined" >>>;
-//[contains] end of text
+#![contains] end of text
#define macro
macro
-//[contains] end of test
+#![contains] end of test
#define macro(a,b)
macro(1,2);
-//[contains] 123
+#![contains] 123
#define macro(...) __VA_ARGS__
<<< macro(1,2,3) >>>;
-//[contains] test
+#![contains] test
#define macro "test"
<<< macro >>>;
-//[contains] test12
+#![contains] test12
#define macro(a,b) "test", a, b
<<< macro(1,2) >>>;
-//[contains] file not found
+#![contains] file not found
#include <non_existant_file>
-//[contains] tests/pp/header.gw
+#![contains] tests/pp/header.gw
#include <tests/pp/header.gw>
-//[contains] undefined macro
+#![contains] undefined macro
#undef macro
int i;
<<< i >>>;
-//! document the AST
+#!! document the AST
E e;
F f;
G g;
-//<<< f $ D >>>;
+#!<<< f $ D >>>;
<<< [ f, g ] >>>;
<<< maybe ? f : D >>>;
<<< c, " ", d, " ", e, " ", g >>>;
class C {
int i[];
int j[2];
-// Machine.shreds() @=> i;
-// null @=> i;
+#! Machine.shreds() @=> i;
+#! null @=> i;
}
C c;
}
}
-//<<< C >>>;
+#!<<< C >>>;
<~int, int~>C c;
<~float, int~>C d;
<~polar, int~>C e;
<~Vec3, int~>C f;
<~Object, int~>C g;
-//C c;
+#!C c;
<<< c.a >>>;
<<< d.a >>>;
<<< e.a >>>;
int i[];
Machine.shreds() @=> i;
-//null @=> i;
+#!null @=> i;
-// always return 0
+#! always return 0
<<< false >>>;
class C
{
operator => void(C c, int i){<<< c, " ", i >>>;}
-// this => this;
-//fun void test_op(C c){ this => c; }
+#! this => this;
+#!fun void test_op(C c){ this => c; }
this => int i;
}
C c;
-//c.test_op(c);
+#!c.test_op(c);
}
C c;
<<< c.i >>>;
-//<<< ++c.i >>>;
-//1 => c.i;
+#!<<< ++c.i >>>;
+#!1 => c.i;
2 +=> c.i;
-// define a simple variable: 'i'.
+#! define a simple variable: 'i'.
int i;
-// define a funs that returns 1 if 'i' is non zero, and 0 othervise.
+#! define a funs that returns 1 if 'i' is non zero, and 0 othervise.
fun int test() { return i ? 1 : 0; }
<<< test() >>>;
1 => i;
-// catch free gc
+#! catch free gc
Event e;
spork { e => now; };
spork { samp => now; 4::samp => now;};
fun void test() {
spork { <<< 2 >>>; };
}
-//spork { <<< 1 >>>; };
-//spork test();
+#!spork { <<< 1 >>>; };
+#!spork test();
test();
second => now;
<<< "test2" >>>;
};
}
-// spork test(2);
-// spork { <<< "test", this >>>; };
+#! spork test(2);
+#! spork { <<< "test", this >>>; };
}
C c;
<<< c >>>;
-//spork
+#!spork
c.test(1);
c.test(2);
samp => now;
-// just to check uncalled fun to not push the stack
+#! just to check uncalled fun to not push the stack
class C { fun void test(){} fun static void stest() {}}
C c;
-// a vec3 with only two expressions
+#! a vec3 with only two expressions
[ @(0.0- 0.0, 0.0) ];