diff options
| author | Patrick Schönberger | 2021-08-12 08:52:59 +0200 |
|---|---|---|
| committer | Patrick Schönberger | 2021-08-12 08:52:59 +0200 |
| commit | 3b7b6d9a84bfc5f328c2ed78ca72a836a67468ae (patch) | |
| tree | d8f4efda2d6fc3f8f130e7d3038f82583e81c3dd /test/test2.toc | |
| parent | 9610ce88f0b753db81014a053bd3c6d79471c90c (diff) | |
| download | toc-3b7b6d9a84bfc5f328c2ed78ca72a836a67468ae.tar.gz toc-3b7b6d9a84bfc5f328c2ed78ca72a836a67468ae.zip | |
changed example
Diffstat (limited to 'test/test2.toc')
| -rw-r--r-- | test/test2.toc | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/test/test2.toc b/test/test2.toc deleted file mode 100644 index c65596a..0000000 --- a/test/test2.toc +++ /dev/null @@ -1,81 +0,0 @@ -func puts(str : char*) : void;
-
-namespace N1 {
- var v1 : int;
- func f1() : void {
- puts("Hello\n");
- }
- struct S1 {
- test : char *;
- }
- // hallo
- namespace N2 {
- var v1 : int; //buige
- struct S1 {
- i1 : int;
- i2 : int;
- i3 : int;
-
- m1(i: int) : int {
- this->i3 = this->i1 * this->i2;
-
- f1(v1);
- N1::f1(N1::v1);
- N2::f1(N2::v1);
- N1::N2::f1();
-
- return this->i1 + this->i2;
- }
- }
-
- func f1() : void {
- var s1 : N1::N2::S1;
- var s2 : S1;
-
- s1.m1(123);
- }
- }
-}
-
-struct S1<T> {
- t1: T;
- t2: T;
-
- m1() : T {
- return this->t1 + this->t2;
- }
-}
-
-struct S2 {
- s: char *;
- abc(): S2 { }
- xyz(): S2 { }
-}
-
-func generic1<A>(a1 : A, a2 : A) : A {
- return a1 + a2;
-}
-
-func main(argc : int, argv : char**) : int {
- var s1 : N1::N2::S1;
- var s2 : N1::N2::S1;
- var s3 : N1::S1;
- s1.i1 = 123;
- s1.i2 = 456;
- s1.m1(s2.m1(s3.m1(89)));
-
- N1::N2::f1();
-
- var s4 : S1<int>;
- s4.t1 = 123;
- s4.t2 = 456;
- s4.m1();
-
- generic1<int>(1, 2);
- generic1<double>(3.4, 5.6);
-
- var s: S2;
- s.abc().xyz();
-
- return 0;
-}
\ No newline at end of file |
