DEADSOFTWARE

Добавлены области видимости и вызовы процедур
[dsw-obn.git] / test.c
diff --git a/test.c b/test.c
index 2247eac4b7f42e6c463a01918e822d2adf45915e..da6a8041e833c307ff423b8411513067390e8c53 100644 (file)
--- a/test.c
+++ b/test.c
@@ -1,16 +1,23 @@
 #include "oberon.h"
 #include <assert.h>
 
-static oberon_type_t integer = { "INTEGER", OBERON_TYPE_INTEGER, sizeof(int) };
-static oberon_type_t boolean = { "BOOLEAN", OBERON_TYPE_BOOLEAN, sizeof(int) };
-
 static const char source[] =
        "MODULE Test;"
        "VAR"
+       "       k : INTEGER;"
        "       i : INTEGER;"
        "       b : BOOLEAN;"
+       ""
+       "PROCEDURE Tier;"
+       "BEGIN"
+       "       k := 314;"
+       "END Tier;"
+       ""
        "BEGIN"
-       "       i := 10;"
+       "       k := 1;"
+       "       i := k;"
+       "       b := TRUE;"
+       "       Tier;"
        "END Test."
 ;
 
@@ -21,8 +28,8 @@ int
 main(int argc, char ** argv)
 {
        ctx = oberon_create_context();
-       oberon_register_global_type(ctx, &integer);
-       oberon_register_global_type(ctx, &boolean);
        mod = oberon_compile_module(ctx, source);
+       //mod -> begin();
+       oberon_destroy_context(ctx);
        return 0;
 }