shithub: femtolisp

Download patch

ref: c14c252714aeff844abc0c9410cd5a081aa70320
parent: 6a09db5047ac94dd363055452b1371b276c3928f
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Tue Nov 12 10:59:10 EST 2024

read_list: print _where_ it's not closed

--- a/read.c
+++ b/read.c
@@ -595,13 +595,16 @@
 {
 	value_t c, *pc;
 	uint32_t t;
+	uint64_t lineno0, colno0;
 
+	lineno0 = RS->lineno;
+	colno0 = RS->colno - 1;
 	PUSH(FL(Nil));
 	pc = &FL(stack)[FL(sp)-1];  // to keep track of current cons cell
 	t = peek(ctx);
 	while(t != closer){
 		if(ios_eof(RS))
-			parse_error("unexpected end of input");
+			parse_error("unexpected end of input: %"PRIu64":%"PRIu64" not closed", lineno0, colno0);
 		c = mk_cons(); car_(c) = cdr_(c) = FL(Nil);
 		if(iscons(*pc))
 			cdr_(*pc) = c;