X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Ftest.c;h=549e5eaa69e890f6c70b2c053474152028f2f571;hb=cbfeec1f4192adbd7adb494ef79447366f051c20;hp=a144f3616074e1f8891dbc30af0007420bad0ef9;hpb=51a1ab2543ec5c221d4a3a9ab89968ae7dd39981;p=dsw-obn.git diff --git a/src/test.c b/src/test.c index a144f36..549e5ea 100644 --- a/src/test.c +++ b/src/test.c @@ -9,36 +9,17 @@ static char source_test[] = "MODULE Test;" "IMPORT Out;" "" - "TYPE" - " R = INTEGER;" - "" - "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;" "" "BEGIN" + " i := 0;" " 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;" + " WHILE i < 4 DO" + " Out.String('Count '); Out.Int(i, 0); Out.Ln;" + " i := i + 1;" + " END;" + " Out.String('end'); Out.Ln;" "END Test." ;