Skip to content

Commit 1da86eb

Browse files
committed
Improved error message
When INTERN_ or SYMBOL_EXPORT_SC_ macros are used if you use the wrong package name the error message has been improved
1 parent ea43798 commit 1da86eb

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/scraper/interpret-tags.lisp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,11 @@ Compare the symbol against previous definitions of symbols - if there is a misma
947947
(defmethod interpret-tag ((tag tags:symbol-tag) state)
948948
(let* ((c++-name (or (tags:c++-name% tag) (tags:lisp-name% tag)))
949949
(namespace (or (tags:namespace% tag)
950-
(tags:namespace%
951-
(gethash (tags:package% tag)
952-
(state-package-to-assoc state)))))
950+
(tags:namespace%
951+
(let ((nst (gethash (tags:package% tag) (state-package-to-assoc state))))
952+
(unless nst
953+
(error "Couldn't find state-package-to-assoc for tag: ~s - did you use a wrong package name like KwPkg?????" tag))
954+
nst))))
953955
(package (or (tags:package% tag)
954956
(tags:package%
955957
(gethash (tags:namespace% tag)

src/scraper/sif-file.lisp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ Read a list of tags from the sif file."
6161
(with-open-file (stream sif-pathname :direction :input :external-format :utf-8)
6262
(loop for tag = (read stream nil stream)
6363
until (eq tag stream)
64+
unless tag
65+
do (error "Encountered a NIL tag in ~s" sif-pathname)
6466
collect tag))))

src/scraper/tags.lisp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@
180180
(c++-name% :initform nil :initarg :c++-name% :reader tags:c++-name%)
181181
(lisp-name% :initarg :lisp-name% :reader tags:lisp-name%)))
182182

183+
(defmethod print-object ((tag tags:symbol-tag) stream)
184+
(print-unreadable-object (tag stream :type t)
185+
(format stream ":namespace% ~s :package% ~s :c++-name% ~s :lisp-name% ~s :file ~s :line ~s"
186+
(tags:namespace% tag)
187+
(tags:package% tag)
188+
(tags:c++-name% tag)
189+
(tags:lisp-name% tag)
190+
(tags:file% tag)
191+
(tags:line% tag))))
192+
183193
(defclass tags:symbol-external-tag (symbol-tag) ())
184194
(defclass tags:symbol-shadow-external-tag (symbol-external-tag) ())
185195
(defclass tags:detailed-symbol-external-tag (symbol-external-tag) ())

0 commit comments

Comments
 (0)