DEADSOFTWARE

Добавлены многомерные массивы и статическая проверка индексов
[dsw-obn.git] / test.c
diff --git a/test.c b/test.c
index 0837de4ef28f6ba05ca3dbe8f4c191e95fd0caa5..d8f108377c2fa5299bc8460109e59289ea280c61 100644 (file)
--- a/test.c
+++ b/test.c
@@ -1,16 +1,15 @@
 #include "oberon.h"
+#include "generator.h"
 #include <assert.h>
 
 static const char source[] =
        "MODULE Test;"
+       "TYPE"
+       "       Matrix = ARRAY 3, 4 OF INTEGER;"
        "VAR"
-       "       k : INTEGER;"
-       "       i : INTEGER;"
-       "       b : BOOLEAN;"
-       "BEGIN"
-       "       k := -10 + 1;"
-       "       i := k;"
-       "       b := ~TRUE OR FALSE;"
+       "       m : Matrix;"
+       "BEGIN;"
+       "       m[2, 3] := 0;"
        "END Test."
 ;
 
@@ -22,6 +21,8 @@ main(int argc, char ** argv)
 {
        ctx = oberon_create_context();
        mod = oberon_compile_module(ctx, source);
+       //mod -> begin();
+       oberon_generator_dump(ctx, "dump.txt");
        oberon_destroy_context(ctx);
        return 0;
 }