X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Ftest.c;h=cacf00d30d71189e19360a4b2467ba052f037858;hb=86c0ca1aafd465a3e0d4a9d6b1af661eba483ae1;hp=03ac7fc3ab12979d8fcaadac8c5ccd244769f4bc;hpb=36c1947b3e98abab25f16a0f1c2679125651fe95;p=dsw-obn.git diff --git a/src/test.c b/src/test.c index 03ac7fc..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;" @@ -22,34 +36,23 @@ static char source_test[] = "" "TYPE" " Ident = ARRAY 20 OF CHAR;" + " PrintString = PROCEDURE (str : ARRAY OF CHAR);" "" "VAR" - " hello : Ident;" - " cc : CHAR;" + " msg : Ident;" + " print : PrintString;" "" "BEGIN" - " 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;" + " msg := helloworld;" + " print := Out.String;" " Out.Open;" - " Out.String(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*;"