DEADSOFTWARE

Добавлен оператор IS
[dsw-obn.git] / src / test.c
index bcc8e86c8fe1c3a607d1d235ef29bd3d92c62820..024252a2def43abc44d82e38d95f1180f551caa2 100644 (file)
@@ -9,22 +9,23 @@ static char source_test[] =
        "MODULE Test;"
        "IMPORT Out;"
        ""
+       "TYPE"
+       "  RecA = POINTER TO RecADesc;"
+       "  RecADesc = RECORD END;"
+       ""
+       "  RecB = POINTER TO RecBDesc;"
+       "  RecBDesc = RECORD (RecADesc) END;"
+       ""
        "VAR"
-       "  i : INTEGER;"
+       "  a : RecA;"
+       "  b : RecB;"
        ""
        "BEGIN"
-       "  i := 4;"
-       "  Out.Open();"
-       "  IF i = 0 THEN"
-       "    Out.String('Branch 0'); Out.Ln;"
-       "  ELSIF i = 1 THEN"
-       "    Out.String('Branch 1'); Out.Ln;"
-       "  ELSIF i = 2 THEN"
-       "    Out.String('Branch 2'); Out.Ln;"
-       "  ELSE"
-       "    Out.String('Branch else'); Out.Ln;"
-       "  END;"
-       "  Out.String('end'); Out.Ln;"
+       "  NEW(a);"
+       "  NEW(b);"
+       "  Out.Open;"
+       "  a := b;"
+       "  IF a IS RecA THEN Out.String('Yes'); Out.Ln; END;"
        "END Test."
 ;