This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error diagnostics in 1.6.97


Kawa 1.6.70 would throw an error "unexpected EOF in list starting here"
and give the line/column number where the list started.

Kawa 1.6.97 is technically more correct to throw "unexpected EOF in
list" with the line/column number where the error actually occurred,
i.e. the EOF.  However, this information is less useful to the end user,
who needs to figure out where the missing ) should go.  The patch below
is a compromise; both line/column pairs are in the error message.

Index: gnu/kawa/lispexpr/ReaderParens.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/kawa/lispexpr/ReaderParens.java,v
retrieving revision 1.4
diff -u -r1.4 ReaderParens.java
--- ReaderParens.java	2001/06/19 00:20:00	1.4
+++ ReaderParens.java	2002/01/22 18:59:05
@@ -81,7 +81,8 @@
 	    if (ch == close)
 	      break;
 	    if (ch < 0)
-	       lexer.eofError("unexpected EOF in list");
+	       lexer.eofError("unexpected EOF in list started at "
+			      + (startLine+1) + ":" + startColumn);
 	    ReadTableEntry entry;
 	    if (ch == '.')
 	      {
@@ -101,7 +102,8 @@
 			break;
 		      }
 		    if (ch < 0)
-		      lexer.eofError("unexpected EOF in list");
+		      lexer.eofError("unexpected EOF in list started at "
+				     + (startLine+1) + ":" + startColumn);
 		    if (sawDot)
 		      {
 			lexer.error("multiple '.' in list");



-- 
<brlewis@[(if (brl-related? message)    ; Bruce R. Lewis
              "users.sourceforge.net"   ; http://brl.sourceforge.net/
              "alum.mit.edu")]>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]