|
From: Paul P. <ppr...@us...> - 2004-08-06 05:13:25
|
Update of /cvsroot/forthy/forthy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23622 Modified Files: fcompile.c fsystem.c ftype.h Log Message: - added some error codes/strings Index: ftype.h =================================================================== RCS file: /cvsroot/forthy/forthy/ftype.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ftype.h 5 Aug 2004 04:18:37 -0000 1.7 --- ftype.h 6 Aug 2004 05:13:12 -0000 1.8 *************** *** 31,35 **** FS_INTERNAL, FS_BAD_PARAMETER, FS_BAD_REF, FS_NULL, FS_OUT_OF_TEXT, FS_COMPILE_ONLY, FS_NESTED_COMPILE, FS_INTERPRET_ONLY, ! FS_EXECUTION_ABORTED, FS_ERROR, FS_ERR_TOP} FERRORS; // Flags for words' behaviour --- 31,36 ---- FS_INTERNAL, FS_BAD_PARAMETER, FS_BAD_REF, FS_NULL, FS_OUT_OF_TEXT, FS_COMPILE_ONLY, FS_NESTED_COMPILE, FS_INTERPRET_ONLY, ! FS_EXECUTION_ABORTED, FS_CONTROL_FLOW_MISMATCH, FS_PROTECTED, ! FS_ERROR, FS_ERR_TOP} FERRORS; // Flags for words' behaviour Index: fsystem.c =================================================================== RCS file: /cvsroot/forthy/forthy/fsystem.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** fsystem.c 6 Aug 2004 02:52:04 -0000 1.16 --- fsystem.c 6 Aug 2004 05:13:12 -0000 1.17 *************** *** 154,157 **** --- 154,159 ---- "interpret only", "execution aborted", + "control-flow mismatch", + "protected", "error" }; *************** *** 427,431 **** // if(!(sym=dict_new(sys->table, name, flags))) if(!(sym=voc_new_word(sys, name, flags))) ! INT_THROW(sys, FS_ERROR); // Set exec to code_dovar --- 429,433 ---- // if(!(sym=dict_new(sys->table, name, flags))) if(!(sym=voc_new_word(sys, name, flags))) ! INT_THROW(sys, FS_OUT_OF_MEMORY); // Set exec to code_dovar *************** *** 1180,1184 **** // Can't delete words from shared dictionaries if(dict_attached(where)) ! VOID_THROW(sys, FS_ERROR); if(!dict_forget(sys->table, sym)) --- 1182,1186 ---- // Can't delete words from shared dictionaries if(dict_attached(where)) ! VOID_THROW(sys, FS_PROTECTED); if(!dict_forget(sys->table, sym)) Index: fcompile.c =================================================================== RCS file: /cvsroot/forthy/forthy/fcompile.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** fcompile.c 5 Aug 2004 04:18:37 -0000 1.7 --- fcompile.c 6 Aug 2004 05:13:12 -0000 1.8 *************** *** 364,368 **** if(tag==(int)colon_tag) ! VOID_THROW(sys, FS_ERROR); if(depth==3) --- 364,368 ---- if(tag==(int)colon_tag) ! VOID_THROW(sys, FS_CONTROL_FLOW_MISMATCH); if(depth==3) *************** *** 514,518 **** if(!resolve_colon(sys)) ! VOID_THROW(sys, FS_ERROR); // TODO: Compile error // Compile the EXIT opcode, close the word --- 514,518 ---- if(!resolve_colon(sys)) ! VOID_THROW(sys, FS_CONTROL_FLOW_MISMATCH); // TODO: Compile error // Compile the EXIT opcode, close the word *************** *** 585,589 **** if(!i) ! VOID_THROW(sys, FS_ERROR); // TODO: Control-flow error } --- 585,589 ---- if(!i) ! VOID_THROW(sys, FS_CONTROL_FLOW_MISMATCH); // TODO: Control-flow error } *************** *** 609,613 **** if(!resolve_tag(sys, (int)dest_tag)) ! VOID_THROW(sys, FS_ERROR); // Get dest offset --- 609,613 ---- if(!resolve_tag(sys, (int)dest_tag)) ! VOID_THROW(sys, FS_CONTROL_FLOW_MISMATCH); // Get dest offset *************** *** 640,644 **** if(!resolve_tag(sys, (int)dest_tag)) ! VOID_THROW(sys, FS_ERROR); // Get dest offset --- 640,644 ---- if(!resolve_tag(sys, (int)dest_tag)) ! VOID_THROW(sys, FS_CONTROL_FLOW_MISMATCH); // Get dest offset *************** *** 728,732 **** if(!resolve_tag(sys, (int)for_tag)) ! VOID_THROW(sys, FS_ERROR); // TODO: FOR/NEXT error // Get for-sys offset --- 728,732 ---- if(!resolve_tag(sys, (int)for_tag)) ! VOID_THROW(sys, FS_CONTROL_FLOW_MISMATCH); // TODO: FOR/NEXT error // Get for-sys offset |