[armedbear-cvs] r12036 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Jul 11 12:08:49 UTC 2009


Author: ehuelsmann
Date: Sat Jul 11 08:08:20 2009
New Revision: 12036

Log:
Improve - but do not fully fix - line number counting.

Note: See the line numbers generated for clos.lisp to
  see the improvement and remaining issue.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Stream.java

Modified: trunk/abcl/src/org/armedbear/lisp/Stream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Stream.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Stream.java	Sat Jul 11 08:08:20 2009
@@ -1928,7 +1928,7 @@
     }
         
     ++offset;
-    if (eolStyle == EolStyle.CRLF && n == '\r') {
+    if (n == '\r' && eolStyle == EolStyle.CRLF) {
         n = _readChar();
         if (n != '\n') {
             _unreadChar(n);
@@ -1955,11 +1955,15 @@
   {
     if (reader == null)
         streamNotCharacterInputStream();
-    reader.unread(n);
+
     --offset;
-    pastEnd = false;
-    if (n == eolChar)
+    if (n == '\n') {
+        n = eolChar;
         --lineNumber;
+    }
+
+    reader.unread(n);
+    pastEnd = false;
   }
 
 




More information about the armedbear-cvs mailing list