[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/02: Fix line and column for read errors
From: |
Andy Wingo |
Subject: |
[Guile-commits] 02/02: Fix line and column for read errors |
Date: |
Thu, 29 Apr 2021 15:48:21 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 7da831af18d1de63b5c98339241473271dc993d2
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Thu Apr 29 21:46:31 2021 +0200
Fix line and column for read errors
* module/ice-9/read.scm (%read): Add 1 to both line and column: the
former to make 1-based user lines instead of 0-based Guile lines, and
the latter because apparently that's how we always did it :) Fixes
---
module/ice-9/read.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/module/ice-9/read.scm b/module/ice-9/read.scm
index a8dbd92..ccf8e3c 100644
--- a/module/ice-9/read.scm
+++ b/module/ice-9/read.scm
@@ -126,7 +126,8 @@
(scm-error 'read-error #f
(format #f "~A:~S:~S: ~A"
(or filename "#<unknown port>")
- (port-line port) (port-column port)
+ (1+ (port-line port))
+ (1+ (port-column port))
msg)
args #f))