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

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Sep 28 07:07:26 PDT 2005


Author: yamaken
Date: 2005-09-28 07:07:23 -0700 (Wed, 28 Sep 2005)
New Revision: 1660

Modified:
   branches/r5rs/sigscheme/operations-siod.c
   branches/r5rs/sigscheme/read.c
   branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/sigscheme.h
  - (enum ScmDebugCategory): Add SCM_DBG_READ
* sigscheme/read.c
  - (SigScm_Read): Add debug printing for each parsed sexp
* sigscheme/operations-siod.c
  - (SCM_DBG_SIOD_V5): Replace SCM_DBG_PARSER with SCM_DBG_READ to
    make compatible with SIOD


Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2005-09-28 13:51:30 UTC (rev 1659)
+++ branches/r5rs/sigscheme/operations-siod.c	2005-09-28 14:07:23 UTC (rev 1660)
@@ -62,7 +62,7 @@
 #define SCM_DBG_SIOD_V2 SCM_DBG_SIOD_V1
 #define SCM_DBG_SIOD_V3 (SCM_DBG_SIOD_V2 | SCM_DBG_FILE)
 #define SCM_DBG_SIOD_V4 (SCM_DBG_SIOD_V3 | SCM_DBG_GC)
-#define SCM_DBG_SIOD_V5 (SCM_DBG_SIOD_V4 | SCM_DBG_PARSER)
+#define SCM_DBG_SIOD_V5 (SCM_DBG_SIOD_V4 | SCM_DBG_READ)
 
 /*=======================================
   Variable Declarations

Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-09-28 13:51:30 UTC (rev 1659)
+++ branches/r5rs/sigscheme/read.c	2005-09-28 14:07:23 UTC (rev 1660)
@@ -120,10 +120,20 @@
 ===========================================================================*/
 ScmObj SigScm_Read(ScmObj port)
 {
+    ScmObj sexp = SCM_FALSE;
+
     if (!PORTP(port))
         SigScm_ErrorObj("SigScm_Read : port required but got ", port);
 
-    return read_sexpression(port);
+    sexp = read_sexpression(port);
+#if SCM_DEBUG
+    if ((SigScm_DebugCategories() & SCM_DBG_READ) && !EOFP(sexp)) {
+        SigScm_WriteToPort(scm_current_error_port, sexp);
+        SigScm_ErrorNewline();
+    }
+#endif
+
+    return sexp;
 }
 
 ScmObj SigScm_Read_Char(ScmObj port)

Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2005-09-28 13:51:30 UTC (rev 1659)
+++ branches/r5rs/sigscheme/sigscheme.h	2005-09-28 14:07:23 UTC (rev 1660)
@@ -139,15 +139,16 @@
     SCM_DBG_BACKTRACE    = 1 << 1,
     SCM_DBG_GC           = 1 << 2,
     SCM_DBG_FILE         = 1 << 3,   /* file loading */
-    SCM_DBG_PARSER       = 1 << 4,   /* print each parsed expression + misc */
-    SCM_DBG_MACRO        = 1 << 5,
-    SCM_DBG_ARGS         = 1 << 6,   /* number of arguments, type and so on */
-    SCM_DBG_EVAL         = 1 << 7,   /* evaluation-related things */
-    SCM_DBG_CONTINUATION = 1 << 8,
-    SCM_DBG_EXCEPTION    = 1 << 9,
-    SCM_DBG_EXPERIMENTAL = 1 << 10,  /* developed but experimental features */
-    SCM_DBG_DEVEL        = 1 << 11,  /* under development */
-    SCM_DBG_COMPAT       = 1 << 12,  /* warns compatibility-sensitive code */
+    SCM_DBG_PARSER       = 1 << 4,
+    SCM_DBG_READ         = 1 << 5,   /* print each parsed expression + misc */
+    SCM_DBG_MACRO        = 1 << 6,
+    SCM_DBG_ARGS         = 1 << 7,   /* number of arguments, type and so on */
+    SCM_DBG_EVAL         = 1 << 8,   /* evaluation-related things */
+    SCM_DBG_CONTINUATION = 1 << 9,
+    SCM_DBG_EXCEPTION    = 1 << 10,
+    SCM_DBG_EXPERIMENTAL = 1 << 11,  /* developed but experimental features */
+    SCM_DBG_DEVEL        = 1 << 12,  /* under development */
+    SCM_DBG_COMPAT       = 1 << 13,  /* warns compatibility-sensitive code */
     SCM_DBG_OTHER        = 1 << 30   /* all other messages */
 };
 



More information about the uim-commit mailing list