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

tkng at freedesktop.org tkng at freedesktop.org
Thu Jul 21 19:45:59 EST 2005


Author: tkng
Date: 2005-07-21 02:45:56 -0700 (Thu, 21 Jul 2005)
New Revision: 1001

Modified:
   branches/r5rs/sigscheme/read.c
Log:
* sigscheme/read.c:
 - (skip_comment_and_space): Added counting of line number.
 - (read_list): Print line start number if file ends inside the list.


Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-07-21 08:59:27 UTC (rev 1000)
+++ branches/r5rs/sigscheme/read.c	2005-07-21 09:45:56 UTC (rev 1001)
@@ -116,10 +116,16 @@
         } else if(c == ';') {
             while (1) {
 		SCM_PORT_GETC(port, c);
-                if (c == '\n') break;
+                if (c == '\n') {
+	           SCM_PORT_PORTINFO(port)->line++;
+		   break;
+		}
                 if (c == EOF ) return c;
             }
             continue;
+        } else if(c == '\n') {
+	  SCM_PORT_PORTINFO(port)->line++;
+	  continue;
         } else if(isspace(c)) {
             continue;
         }
@@ -214,6 +220,7 @@
     ScmObj list_head = SCM_NIL;
     ScmObj list_tail = SCM_NIL;
     ScmObj item = SCM_NIL;
+    int line = SCM_PORT_PORTINFO(port)->line;
 
     int c = 0;
     while (1) {
@@ -224,7 +231,7 @@
 #endif
 
         if (c == EOF) {
-            SigScm_Error("EOF inside list.\n");
+ 	    SigScm_Error("EOF inside list. (starting from line %d)\n", line + 1);
         } else if (c == closeParen) {
             return list_head;
         } else if (c == '.') {



More information about the uim-commit mailing list