home: hub: 9ficl

Download patch

ref: 65f3c11aeb7d4e1012c7aa75f696022006585625
parent: 367d5487c20e9929dc87e5a617667d32d3de7f90
author: jsadler <jsadler@ficl.sf.net>
date: Thu May 10 09:47:35 CDT 2001

license -> bsd; debugger enhancements; BASE bug fix; debugger works in ficlwin;
ficlwin ACCEPT

--- a/prefix.c
+++ b/prefix.c
@@ -4,7 +4,7 @@
 ** Parser extensions for Ficl
 ** Authors: Larry Hastings & John Sadler (john_sadler@alum.mit.edu)
 ** Created: April 2001
-** $Id: prefix.c,v 1.1 2001/04/27 04:41:33 jsadler Exp $
+** $Id: prefix.c,v 1.2 2001/05/10 14:47:35 jsadler Exp $
 *******************************************************************/
 /*
 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
@@ -12,6 +12,11 @@
 **
 ** Get the latest Ficl release at http://ficl.sourceforge.net
 **
+** I am interested in hearing from anyone who uses ficl. If you have
+** a problem, a success story, a defect, an enhancement request, or
+** if you would like to contribute to the ficl release, please
+** contact me by email at the address above.
+**
 ** L I C E N S E  and  D I S C L A I M E R
 ** 
 ** Redistribution and use in source and binary forms, with or without
@@ -34,13 +39,6 @@
 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 ** SUCH DAMAGE.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release, please send
-** contact me by email at the address above.
-**
-** $Id: prefix.c,v 1.1 2001/04/27 04:41:33 jsadler Exp $
 */
 
 #include <string.h>
@@ -184,6 +182,6 @@
 #endif
     dp->pCompile = pPrevCompile;
 
-    ficlAddPrecompiledParseStep(pSys, "prefix?", ficlParsePrefix);
+    ficlAddPrecompiledParseStep(pSys, "?prefix", ficlParsePrefix);
     return;
 }
--- a/testmain.c
+++ b/testmain.c
@@ -1,6 +1,6 @@
 /*
 ** stub main for testing FICL under Win32
-** $Id: testmain.c,v 1.8 2001/04/27 04:41:26 jsadler Exp $
+** $Id: testmain.c,v 1.9 2001/05/10 14:47:30 jsadler Exp $
 */
 /*
 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
@@ -8,6 +8,11 @@
 **
 ** Get the latest Ficl release at http://ficl.sourceforge.net
 **
+** I am interested in hearing from anyone who uses ficl. If you have
+** a problem, a success story, a defect, an enhancement request, or
+** if you would like to contribute to the ficl release, please
+** contact me by email at the address above.
+**
 ** L I C E N S E  and  D I S C L A I M E R
 ** 
 ** Redistribution and use in source and binary forms, with or without
@@ -30,13 +35,6 @@
 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 ** SUCH DAMAGE.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release, please send
-** contact me by email at the address above.
-**
-** $Id: testmain.c,v 1.8 2001/04/27 04:41:26 jsadler Exp $
 */
 
 #include <stdlib.h>
@@ -311,6 +309,12 @@
 
 #if !defined (_WINDOWS)
 #define nINBUF 256
+
+#if !defined (_WIN32)
+#define __try
+#define __except(i) if (0)
+#endif
+
 int main(int argc, char **argv)
 {
     int ret = 0;
@@ -328,13 +332,29 @@
     if (argc  > 1)
     {
         sprintf(in, ".( loading %s ) cr load %s\n cr", argv[1], argv[1]);
-        ret = ficlExec(pVM, in);
+        __try
+        {
+            ret = ficlExec(pVM, in);
+        }
+        __except(1)
+        {
+            vmTextOut(pVM, "exception -- cleaning up", 1);
+            vmReset(pVM);
+        }
     }
 
     while (ret != VM_USEREXIT)
     {
         fgets(in, nINBUF, stdin);
-        ret = ficlExec(pVM, in);
+        __try
+        {
+            ret = ficlExec(pVM, in);
+        }
+        __except(1)
+        {
+            vmTextOut(pVM, "exception -- cleaning up", 1);
+            vmReset(pVM);
+        }
     }
 
     ficlTermSystem();