X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Ftest.c;h=33f1aeba29afe63852163207b4e4baef9900f715;hb=d31e6130ac411ef95be71674b2666a1a79a83602;hp=a144f3616074e1f8891dbc30af0007420bad0ef9;hpb=51a1ab2543ec5c221d4a3a9ab89968ae7dd39981;p=dsw-obn.git diff --git a/src/test.c b/src/test.c index a144f36..33f1aeb 100644 --- a/src/test.c +++ b/src/test.c @@ -9,36 +9,23 @@ static char source_test[] = "MODULE Test;" "IMPORT Out;" "" - "TYPE" - " R = INTEGER;" + "VAR" + " i, len : INTEGER;" "" - "PROCEDURE Factorial(n : R) : R;" "BEGIN" - " IF n <= 1 THEN" - " RETURN 1;" - " ELSE" - " RETURN n * Factorial(n - 1);" - " END;" - " RETURN 0; (* Детектор ретурнов - дерьмо *)" - "END Factorial;" - "" - "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;" + " Out.Open;" + " Out.Int(MIN(BYTE), 0); Out.Ln;" + " Out.Int(MIN(SHORTINT), 0); Out.Ln;" + " Out.Int(MIN(INTEGER), 0); Out.Ln;" + " Out.Int(MIN(LONGINT), 0); Out.Ln;" + " Out.Int(MAX(BYTE), 0); Out.Ln;" + " Out.Int(MAX(SHORTINT), 0); Out.Ln;" + " Out.Int(MAX(INTEGER), 0); Out.Ln;" + " Out.Int(MAX(LONGINT), 0); Out.Ln;" + " Out.Int(SIZE(BYTE), 0); Out.Ln;" + " Out.Int(SIZE(SHORTINT), 0); Out.Ln;" + " Out.Int(SIZE(INTEGER), 0); Out.Ln;" + " Out.Int(SIZE(LONGINT), 0); Out.Ln;" "END Test." ;