X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Ftest.c;h=cacf00d30d71189e19360a4b2467ba052f037858;hb=86c0ca1aafd465a3e0d4a9d6b1af661eba483ae1;hp=3305807bbb3fa1c87b0cbd508aaec7e6787ebbfb;hpb=c055d16f1d6ca38c5c2171dbafd1a25305fb909c;p=dsw-obn.git diff --git a/src/test.c b/src/test.c index 3305807..cacf00d 100644 --- a/src/test.c +++ b/src/test.c @@ -4,54 +4,66 @@ #include "../include/oberon.h" +/* static char source_test[] = "(* Main module *)" "MODULE Test;" "IMPORT Out;" - "TYPE" - " Callback = PROCEDURE;" - " Callfront = PROCEDURE(x : LONGINT) : LONGINT;" - " RecDesc = RECORD" - " cb : Callback;" - " cf : Callfront;" - " END;" - "" "VAR" - " r : RecDesc;" - " i : LONGINT;" - "" - "PROCEDURE Stuff;" + " msg : ARRAY 20 OF CHAR;" "BEGIN" - " Out.Int(0123456789, 0); Out.Ln;" - "END Stuff;" + " 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;" "" - "PROCEDURE Ffuts (x : LONGINT) : LONGINT;" - "BEGIN" - " RETURN 9876543210 + x;" - "END Ffuts;" + "TYPE" + " Ident = ARRAY 20 OF CHAR;" + " PrintString = PROCEDURE (str : ARRAY OF CHAR);" + "" + "VAR" + " msg : Ident;" + " print : PrintString;" "" "BEGIN" + " msg := helloworld;" + " print := Out.String;" " Out.Open;" - " Out.Int(1, 0); Out.Ln;" - " r.cb := Stuff;" - " Out.Int(2, 0); Out.Ln;" - " r.cb();" - " Out.Int(3, 0); Out.Ln;" - " r.cf := Ffuts;" - " Out.Int(4, 0); Out.Ln;" - " i := r.cf(0123456789);" - " Out.Int(i, 0); Out.Ln;" + " 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*;" " END Open;" "" + " PROCEDURE Char* (ch : CHAR);" + " END Char;" + "" + " PROCEDURE String* (str : ARRAY OF CHAR);" + " END String;" + "" " PROCEDURE Int*(i, n : LONGINT);" " END Int;" ""