X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Ftest.c;h=3305807bbb3fa1c87b0cbd508aaec7e6787ebbfb;hb=c055d16f1d6ca38c5c2171dbafd1a25305fb909c;hp=9fad93d4461223fcc752d5a79e48261711e9709d;hpb=d11b76dfc015306841ed4befae800ba1ed7c765b;p=dsw-obn.git diff --git a/src/test.c b/src/test.c index 9fad93d..3305807 100644 --- a/src/test.c +++ b/src/test.c @@ -8,26 +8,39 @@ static char source_test[] = "(* Main module *)" "MODULE Test;" "IMPORT Out;" + "TYPE" + " Callback = PROCEDURE;" + " Callfront = PROCEDURE(x : LONGINT) : LONGINT;" + " RecDesc = RECORD" + " cb : Callback;" + " cf : Callfront;" + " END;" "" "VAR" - " byte : BYTE;" - " short : SHORTINT;" - " int : INTEGER;" - " long : LONGINT;" - " real : REAL;" - " longreal : LONGREAL;" + " r : RecDesc;" + " i : LONGINT;" + "" + "PROCEDURE Stuff;" + "BEGIN" + " Out.Int(0123456789, 0); Out.Ln;" + "END Stuff;" + "" + "PROCEDURE Ffuts (x : LONGINT) : LONGINT;" + "BEGIN" + " RETURN 9876543210 + x;" + "END Ffuts;" "" "BEGIN" " Out.Open;" - " byte := 127;" - " int := 666 DIV 2;" - " long := int;" - " real := (4 / 1) - (4 / 3) + (4 / 5) - (4 / 7) + (4 / 9) - (4 / 11) + (4 / 13) - (4 / 15) + (4 / 17);" - " longreal := (4 / 1) - (4 / 3) + (4 / 5) - (4 / 7) + (4 / 9) - (4 / 11) + (4 / 13) - (4 / 15) + (4 / 17);" - " Out.Int(666, 0); Out.Ln;" - " Out.Int(byte, 0); Out.Ln;" - " Out.Real(real, 0); Out.Ln;" - " Out.LongReal(longreal, 0); Out.Ln;" + " Out.Int(1, 0); Out.Ln;" + " r.cb := Stuff;" + " Out.Int(2, 0); Out.Ln;" + " r.cb();" + " Out.Int(3, 0); Out.Ln;" + " r.cf := Ffuts;" + " Out.Int(4, 0); Out.Ln;" + " i := r.cf(0123456789);" + " Out.Int(i, 0); Out.Ln;" "END Test." ;