DEADSOFTWARE

Поправлен каст и использование указателей на записи
[dsw-obn.git] / src / test.c
index 2c5fb0462c6cb482a0d66fbd593af3fa4f85f5d8..125c5df07d2f017942479ff9a7ed5e979f86b4f2 100644 (file)
@@ -8,25 +8,23 @@ static char source_test[] =
        "(* Main module *)"
        "MODULE Test;"
        "IMPORT Out;"
+       "TYPE"
+       "  RecA = POINTER TO RecADesc;"
+       "  RecADesc = RECORD END;"
+       ""
+       "  RecB = POINTER TO RecBDesc;"
+       "  RecBDesc = RECORD (RecADesc) END;"
        ""
        "VAR"
-       "  byte     : BYTE;"
-       "  short    : SHORTINT;"
-       "  int      : INTEGER;"
-       "  long     : LONGINT;"
-       "  real     : REAL;"
-       "  longreal : LONGREAL;"
+       "  pra : RecA;"
+       "  prb : RecB;"
+       "  ra  : RecADesc;"
+       "  rb  : RecBDesc;"
        ""
        "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;"
+       "  pra := prb;"
+       "  prb := pra(RecB);"
+       "  ra := prb^;"
        "END Test."
 ;