diff --git a/src/test.c b/src/test.c
index 9fad93d4461223fcc752d5a79e48261711e9709d..dab2914ca12507682c8a29122dd5498aebb221b1 100644 (file)
--- a/src/test.c
+++ b/src/test.c
"(* Main module *)"
"MODULE Test;"
"IMPORT Out;"
+ "TYPE"
+ " R1 = POINTER TO R1Desc;"
+ " R1Desc = RECORD a : INTEGER; END;"
+ " R2 = POINTER TO R2Desc;"
+ " R2Desc = RECORD (R1Desc) b : INTEGER; END;"
+ " Y1 = POINTER TO Y1Desc;"
+ " Y1Desc = RECORD END;"
""
"VAR"
- " byte : BYTE;"
- " short : SHORTINT;"
- " int : INTEGER;"
- " long : LONGINT;"
- " real : REAL;"
- " longreal : LONGREAL;"
+ " r1 : R1;"
+ " r2 : R2;"
+ " y1 : Y1;"
""
"BEGIN"
+ " NEW(r1);"
+ " NEW(r2);"
+ " NEW(y1);"
+ " r1 := r2;"
" 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;"
+ " WITH r1 : R2 DO"
+ " r1.b := 666;"
+ " Out.String('R2 branch');"
+ " | y1 : Y1 DO"
+ " Out.String('Y1 branch');"
+ " ELSE"
+ " Out.String('Something else');"
+ " END;"
+ " Out.Ln;"
"END Test."
;
-// PROCEDURE Char* (ch : CHAR);
-// PROCEDURE String* (str : ARRAY OF CHAR);
-
static char source_out[] =
"MODULE Out;"
" PROCEDURE Open*;"
" END Open;"
""
+ " PROCEDURE Char* (ch : CHAR);"
+ " END Char;"
+ ""
+ " PROCEDURE String* (str : ARRAY OF CHAR);"
+ " END String;"
+ ""
" PROCEDURE Int*(i, n : LONGINT);"
" END Int;"
""