X-Git-Url: https://deadsoftware.ru/gitweb?p=dsw-obn.git;a=blobdiff_plain;f=src%2Ftest.c;h=cacf00d30d71189e19360a4b2467ba052f037858;hp=d2950b968189c70a5f4b743c5131cd9682498959;hb=86c0ca1aafd465a3e0d4a9d6b1af661eba483ae1;hpb=ee7fd939ac99201466900fb3983aa90b980da5c3 diff --git a/src/test.c b/src/test.c index d2950b9..cacf00d 100644 --- a/src/test.c +++ b/src/test.c @@ -4,11 +4,25 @@ #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;" @@ -25,33 +39,20 @@ static char source_test[] = " PrintString = PROCEDURE (str : ARRAY OF CHAR);" "" "VAR" - " hello : Ident;" + " msg : Ident;" " print : PrintString;" "" "BEGIN" + " msg := helloworld;" " print := Out.String;" - " hello[0] := h;" - " hello[1] := e;" - " hello[2] := l;" - " hello[3] := l;" - " hello[4] := o;" - " hello[5] := space;" - " hello[6] := w;" - " hello[7] := o;" - " hello[8] := r;" - " hello[9] := l;" - " hello[10] := d;" - " hello[11] := bang;" - " hello[12] := null;" " Out.Open;" - " print(hello);" + " print(msg);" + " Out.Ln;" + " print(\"It's works!\");" " Out.Ln;" "END Test." ; -// PROCEDURE Char* (ch : CHAR); -// PROCEDURE String* (str : ARRAY OF CHAR); - static char source_out[] = "MODULE Out;" " PROCEDURE Open*;"