From 057f106167f440fe6cab1e89110698d2335afe27 Mon Sep 17 00:00:00 2001
From: William G Hatch <william@hatch.uno>
Date: Fri, 23 Sep 2016 14:43:45 -0600
Subject: [PATCH] improve (fix) read EOF error case

---
 udelim/main.rkt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/udelim/main.rkt b/udelim/main.rkt
index 8477962..6a42614 100644
--- a/udelim/main.rkt
+++ b/udelim/main.rkt
@@ -34,9 +34,10 @@
        (define-values (n-line n-col n-pos) (port-next-location port))
        (define (loop ch cur-balance-level ch-so-far)
          (cond [(equal? eof ch)
-                (error 'string-reader
-                       "unexpected eof, expected ~n more ~a characters"
-                       cur-balance-level r-paren)]
+                (raise-read-error
+                 (format "unexpected eof, expected ~a more closing delimiter ~a~n"
+                         cur-balance-level r-paren)
+                 src line col pos #f)]
                [(equal? ch l-paren) (loop (read-char port)
                                             (add1 cur-balance-level)
                                             (cons ch ch-so-far))]
@@ -46,6 +47,7 @@
                [(> cur-balance-level 1) (loop (read-char port)
                                               (sub1 cur-balance-level)
                                               (cons ch ch-so-far))]
+               ;; this shouldn't be possible... but I'll leave it here anyway.
                [(< cur-balance-level 1)
                 ((make-raise-balance-error l-paren r-paren)
                  src line col pos)]