[uim-commit] r1225 - branches/r5rs/sigscheme

kzk at freedesktop.org kzk at freedesktop.org
Thu Aug 18 10:00:57 PDT 2005


Author: kzk
Date: 2005-08-18 10:00:53 -0700 (Thu, 18 Aug 2005)
New Revision: 1225

Modified:
   branches/r5rs/sigscheme/datas.c
   branches/r5rs/sigscheme/debug.c
   branches/r5rs/sigscheme/read.c
Log:
* sigscheme/read.c
  - (read_word): don't became an error when EOF appears for handling
    Scm_eval_c_string("plugin-dir")
* sigscheme/debug.c
  - (print_port): more informational debugging msg for string port
* sigscheme/datas.c
  - (Scm_eval_c_string): protect stack


Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c	2005-08-18 16:53:18 UTC (rev 1224)
+++ branches/r5rs/sigscheme/datas.c	2005-08-18 17:00:53 UTC (rev 1225)
@@ -907,11 +907,18 @@
 
 ScmObj Scm_eval_c_string(const char *exp)
 {
+    ScmObj stack_start;
     ScmObj str_port = Scm_NewStringPort(exp);
     ScmObj ret = SCM_NIL;
 
+    /* start protecting stack */
+    SigScm_gc_protect_stack(&stack_start);
+
     ret = SigScm_Read(str_port);
     ret = ScmOp_eval(ret, SCM_NIL);
 
+    /* now no need to protect stack */
+    SigScm_gc_unprotect_stack(&stack_start);
+
     return ret;
 }

Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c	2005-08-18 16:53:18 UTC (rev 1224)
+++ branches/r5rs/sigscheme/debug.c	2005-08-18 17:00:53 UTC (rev 1225)
@@ -301,7 +301,7 @@
     if (SCM_PORTINFO_PORTTYPE(port) == PORT_FILE) {
 	fprintf(f, "file %s", SCM_PORTINFO_FILENAME(port));
     } else if (SCM_PORTINFO_PORTTYPE(port) == PORT_STRING) {
-	fprintf(f, "string");
+	fprintf(f, "string %s", SCM_PORTINFO_STR(port));
     }
 
     fprintf(f, ">");

Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-08-18 16:53:18 UTC (rev 1224)
+++ branches/r5rs/sigscheme/read.c	2005-08-18 17:00:53 UTC (rev 1225)
@@ -474,10 +474,11 @@
 #endif
 
         switch (c) {
-            case EOF:
-                SigScm_Error("EOF in the char sequence.\n");
-                break;
 
+	    case EOF: /*
+		       * don't became an error for handling c-eval.
+		       * Scm_eval_c_string("some-symbol");
+                       */
 	    case ' ':
             case '(':  case ')':  case ';':
             case '\n': case '\t': case '\"': case '\'':



More information about the uim-commit mailing list