DEADSOFTWARE

Добавлена конструкция FOR
[dsw-obn.git] / src / test.c
index cacf00d30d71189e19360a4b2467ba052f037858..42fc4ff3030a00a18b2b673141cc0f7137f2a1fc 100644 (file)
@@ -4,52 +4,22 @@
 
 #include "../include/oberon.h"
 
-/*
 static char source_test[] =
        "(* Main module *)"
        "MODULE Test;"
        "IMPORT Out;"
-       "VAR"
-       "  msg : ARRAY 20 OF CHAR;"
-       "BEGIN"
-       "  msg := ''"
-       "END Test."
-;
-*/
-
-static char source_test[] =
-       "(* Main module *)"
-       "MODULE Test;"
-       "IMPORT Out;"
-       "CONST"
-       "  helloworld = 'Hello World!';"
-       "  null = 0X;"
-       "  space = 020X;"
-       "  bang = 021X;"
-       "  h = 048X;"
-       "  e = 045X;"
-       "  l = 04CX;"
-       "  o = 04FX;"
-       "  w = 057X;"
-       "  r = 052X;"
-       "  d = 044X;"
-       ""
-       "TYPE"
-       "  Ident = ARRAY 20 OF CHAR;"
-       "  PrintString = PROCEDURE (str : ARRAY OF CHAR);"
        ""
        "VAR"
-       "  msg   : Ident;"
-       "  print : PrintString;"
+       "  i, len : INTEGER;"
        ""
        "BEGIN"
-       "  msg := helloworld;"
-       "  print := Out.String;"
-       "  Out.Open;"
-       "  print(msg);"
-       "  Out.Ln;"
-       "  print(\"It's works!\");"
-       "  Out.Ln;"
+       "  Out.Open();"
+       "  len := 2 * 8;"
+       "  FOR i := 0 TO len BY 2 DO"
+       "    Out.String('Count '); Out.Int(i, 0); Out.Ln;"
+       "    len := len + 2;"
+       "  END;"
+       "  Out.String('end'); Out.Ln;"
        "END Test."
 ;