diff --git a/src/test.c b/src/test.c
index 2c5fb0462c6cb482a0d66fbd593af3fa4f85f5d8..3305807bbb3fa1c87b0cbd508aaec7e6787ebbfb 100644 (file)
--- a/src/test.c
+++ b/src/test.c
"(* 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;"
- " long := int;"
- " real := int;"
- " longreal := int;"
- " Out.Int(666, 0); Out.Ln;"
- " Out.Int(byte, 0); Out.Ln;"
- " Out.LongReal(real, 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."
;