diff --git a/src/test.c b/src/test.c
index a144f3616074e1f8891dbc30af0007420bad0ef9..595df77a7af072cf374214cd89c64b44c853fcaf 100644 (file)
--- a/src/test.c
+++ b/src/test.c
"IMPORT Out;"
""
"TYPE"
"IMPORT Out;"
""
"TYPE"
- " R = INTEGER;"
+ " R = RECORD iii : INTEGER; END;"
""
""
- "PROCEDURE Factorial(n : R) : R;"
- "BEGIN"
- " IF n <= 1 THEN"
- " RETURN 1;"
- " ELSE"
- " RETURN n * Factorial(n - 1);"
- " END;"
- " RETURN 0; (* Детектор ретурнов - дерьмо *)"
- "END Factorial;"
+ "VAR"
+ " i : INTEGER;"
+ " a : ARRAY 3 OF INTEGER;"
+ " r : R;"
""
""
+ "PROCEDURE X(VAR x : INTEGER);"
+ " PROCEDURE Y;"
+ " BEGIN"
+ " Out.String('YYYyYYYyYY'); Out.Ln;"
+ " END Y;"
"BEGIN"
"BEGIN"
- " Out.Open();"
- " Out.Int(Factorial(0), 0); Out.Ln;"
- " Out.Int(Factorial(1), 0); Out.Ln;"
- " Out.Int(Factorial(2), 0); Out.Ln;"
- " Out.Int(Factorial(3), 0); Out.Ln;"
- " Out.Int(Factorial(4), 0); Out.Ln;"
- " Out.Int(Factorial(5), 0); Out.Ln;"
- " Out.Int(Factorial(6), 0); Out.Ln;"
- " Out.Int(Factorial(7), 0); Out.Ln;"
- " Out.Int(Factorial(8), 0); Out.Ln;"
- " Out.Int(Factorial(9), 0); Out.Ln;"
- " Out.Int(Factorial(10), 0); Out.Ln;"
- " Out.Int(Factorial(11), 0); Out.Ln;"
- " Out.Int(Factorial(12), 0); Out.Ln;"
- " Out.Int(Factorial(13), 0); Out.Ln;"
- " Out.Int(Factorial(14), 0); Out.Ln;"
+ " Y;"
+ " x := x * 666;"
+ "END X;"
+ ""
+ "BEGIN;"
+ " r.iii := 2;"
+ " X(r.iii);"
+ " Out.Int(r.iii, 0); Out.Ln;"
"END Test."
;
"END Test."
;