diff --git a/src/test.c b/src/test.c
index cacf00d30d71189e19360a4b2467ba052f037858..dab2914ca12507682c8a29122dd5498aebb221b1 100644 (file)
--- a/src/test.c
+++ b/src/test.c
#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);"
+ " R1 = POINTER TO R1Desc;"
+ " R1Desc = RECORD a : INTEGER; END;"
+ " R2 = POINTER TO R2Desc;"
+ " R2Desc = RECORD (R1Desc) b : INTEGER; END;"
+ " Y1 = POINTER TO Y1Desc;"
+ " Y1Desc = RECORD END;"
""
"VAR"
- " msg : Ident;"
- " print : PrintString;"
+ " r1 : R1;"
+ " r2 : R2;"
+ " y1 : Y1;"
""
"BEGIN"
- " msg := helloworld;"
- " print := Out.String;"
+ " NEW(r1);"
+ " NEW(r2);"
+ " NEW(y1);"
+ " r1 := r2;"
" Out.Open;"
- " print(msg);"
- " Out.Ln;"
- " print(\"It's works!\");"
+ " WITH r1 : R2 DO"
+ " r1.b := 666;"
+ " Out.String('R2 branch');"
+ " | y1 : Y1 DO"
+ " Out.String('Y1 branch');"
+ " ELSE"
+ " Out.String('Something else');"
+ " END;"
" Out.Ln;"
"END Test."
;