src/: Error message cleanup.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2018 18:58:28 +0000 (19:58 +0100)
  * Remove trailing `.'s from messages, to fit in with Unix conventions
    when they're output.  They'll look a little strange inside Lisp, but
    that's the right error to make.

  * Fix a `~a' to `~A' for consistency with everything else.

15 files changed:
src/c-types-impl.lisp
src/c-types-parse.lisp
src/c-types-proto.lisp
src/class-finalize-impl.lisp
src/codegen-impl.lisp
src/fragment-parse.lisp
src/method-aggregate.lisp
src/module-parse.lisp
src/optparse.lisp
src/parser/package.lisp
src/parser/parser-proto.lisp
src/parser/scanner-charbuf-impl.lisp
src/parser/scanner-proto.lisp
src/pset-impl.lisp
src/utilities.lisp

index 47266e6..6b7c904 100644 (file)
               `(progn
                  (export '(,type ,kind ,constructor))
                  (defclass ,type (tagged-c-type) ()
-                   (:documentation ,(format nil "C ~a types." what)))
+                   (:documentation ,(format nil "C ~A types." what)))
                  (defmethod c-tagged-type-kind ((type ,type))
                    ',keyword)
                  (defmethod kind-c-tagged-type ((kind (eql ',keyword)))
        (let ((this-name (argument-name this))
              (prev-name (argument-name prev)))
          (when (string= this-name prev-name)
-           (error "Duplicate keyword argument name `~A'." this-name)))))
+           (error "Duplicate keyword argument name `~A'" this-name)))))
     list))
 
 (export 'merge-keyword-lists)
                       (other-what (cdr other-item)))
                  (unless (c-type-equal-p type other-type)
                    (error "Type mismatch for keyword argument `~A': ~
-                           ~A~@[ (~A)~] doesn't match ~A~@[ (~A)~]."
+                           ~A~@[ (~A)~] doesn't match ~A~@[ (~A)~]"
                           name
                           type what
                           other-type other-what))))))))
index ce70ef7..3a5a536 100644 (file)
               (disallow-keyword-functions (type)
                 (when (typep type 'c-keyword-function-type)
                   (error "Functions with keyword arguments are only ~
-                          allowed at top-level.")))
+                          allowed at top-level")))
 
               (star ()
                 ;; Prefix: `*' qualifiers
index f8e7589..43824da 100644 (file)
                             ((char= ch #\-)
                              (write-char #\_ out))
                             (t
-                             (error "Bad character in C name ~S." name))))))
+                             (error "Bad character in C name ~S" name))))))
     (t name)))
 
 ;;;--------------------------------------------------------------------------
index be42f13..5abcc6e 100644 (file)
@@ -67,7 +67,7 @@
        (when (member candidate (sod-class-direct-superclasses class))
          (setf winner candidate))))
     (unless winner
-      (error "SOD INTERNAL ERROR: Failed to break tie in CLOS."))
+      (error "SOD INTERNAL ERROR: Failed to break tie in CLOS"))
     winner))
 
 (defun c3-tiebreaker (candidates cpls)
@@ -96,7 +96,7 @@
     (dolist (candidate candidates)
       (when (member candidate cpl)
        (return-from c3-tiebreaker candidate))))
-  (error "SOD INTERNAL ERROR: Failed to break tie in C3."))
+  (error "SOD INTERNAL ERROR: Failed to break tie in C3"))
 
 ;;; Linearization functions.
 
   (reduce (lambda (best this)
            (cond ((funcall order best this) best)
                  ((funcall order this best) this)
-                 (t (error "Unable to choose best ~A." what))))
+                 (t (error "Unable to choose best ~A" what))))
          items))
 
 (defmethod guess-metaclass ((class sod-class))
index 84bdd18..a74b304 100644 (file)
           (setf (codegen-vars codegen)
                 (cons (make-var-inst name type init) vars)))
          ((not (c-type-equal-p type (inst-type var)))
-          (error "(Internal) Redefining type for variable ~A." name)))
+          (error "(Internal) Redefining type for variable ~A" name)))
     name))
 
 (export 'codegen)
index 8e32b07..c958da3 100644 (file)
@@ -98,7 +98,7 @@
              ((or #\) #\] #\})
               (if (eql it delim)
                   (setf delim (pop stack))
-                  (cerror* "Unmatched `~C.'." it)))
+                  (cerror* "Unmatched `~C'" it)))
 
              ;; String and character literals.
              ((seq ((quote (or #\" #\'))
index cec6f14..eeea9df 100644 (file)
       ;; Check that we've been given a method combination and make sure it
       ;; actually exists.
       (unless comb
-       (error "The `combination' property is required."))
+       (error "The `combination' property is required"))
       (unless (some (lambda (method)
                      (let* ((specs (method-specializers method))
                             (message-spec (car specs))
                                 comb))))
                    (generic-function-methods
                     #'compute-aggregating-message-kernel))
-       (error "Unknown method combination `~(~A~)'." comb))
+       (error "Unknown method combination `~(~A~)'" comb))
       (setf combination comb)
 
       ;; Make sure the ordering is actually valid.
       (unless (member most-specific '(:first :last))
-       (error "The `most_specific' property must be `first' or `last'."))
+       (error "The `most_specific' property must be `first' or `last'"))
 
       ;; Set up the function which will compute the kernel.
       (let ((magic (cons nil nil))
                    (unless (c-type-equal-p (c-type-subtype ,type)
                                            ,want-type)
                      (error "Messages with `~(~A~)' combination ~
-                             must return `~A'."
+                             must return `~A'"
                             ,combvar ,want-type)))
                  (call-next-method))))
 
index da1c47f..d64e22e 100644 (file)
                        (when (consp name)
                          (cerror*-with-location
                           scanner
-                          "Method declarations must have function type.")
+                          "Method declarations must have function type")
                          (setf name (cdr name)))
                        (parse-slot-item sub-pset base-type type name))
                       ((consp name)
index 16b5b7b..6460c54 100644 (file)
@@ -83,7 +83,7 @@
                                      #+ecl (loop for i from 1
                                                  below (ext:argc)
                                                  collect (ext:argv i))))
-                              (error "Unsupported Lisp."))))))
+                              (error "Unsupported Lisp"))))))
 
          *program-name* (pathname-name (car *command-line*))))
 
index 623c297..e3e363d 100644 (file)
@@ -33,7 +33,7 @@
                     #+cmu #:extensions
                     #+ecl #.(if (find-package '#:gray) '#:gray '#:si)
                     #+clisp #:gray))
-             (error "Unsupported Lisp (can't find Gray streams).")))
+             (error "Unsupported Lisp (can't find Gray streams)")))
 
   ;; CMUCL's `extensions' package has lots of cruft.  Use our cruft instead.
   #+cmu (:shadowing-import-from #:sod-utilities #:symbolicate #:once-only))
index 7aafe45..ed439f9 100644 (file)
    The return value may later be used with `parser-restore-place'.  Be
    careful: all of this is happening at macro-expansion time.")
     (:method (context)
-      (error "Parser context ~S doesn't support rewinding." context)))
+      (error "Parser context ~S doesn't support rewinding" context)))
 
   (export 'parser-restore-place)
   (defgeneric parser-restore-place (context place)
 
 (defun commit-peeked-place ()
   "Called by `commit' not lexically within `peek'."
-  (error "`commit' is not within `peek'."))
+  (error "`commit' is not within `peek'"))
 
 (export 'commit)
 (defparse commit ()
index 86c4445..773a9a1 100644 (file)
                                                    :index index))))
         (last-link (charbuf-scanner-place-link place-b)))
     (flet ((bad ()
-            (error "Incorrect places ~S and ~S to `scanner-interval'."
+            (error "Incorrect places ~S and ~S to `scanner-interval'"
                    place-a place-b)))
       (do ((link (charbuf-scanner-place-link place-a)
                 (charbuf-chain-link-next link))
index c6236c5..a1ded51 100644 (file)
@@ -74,7 +74,7 @@
   (:documentation
    "Capture the SCANNER's current place and return it.")
   (:method (scanner)
-    (error "Scanner ~S doesn't support rewinding." scanner)))
+    (error "Scanner ~S doesn't support rewinding" scanner)))
 
 (export 'scanner-restore-place)
 (defgeneric scanner-restore-place (scanner place)
index ecad712..e340389 100644 (file)
@@ -72,7 +72,7 @@
   (or (and (boundp '*module-type-map*)
           (gethash value *module-type-map*))
       (find-simple-c-type value)
-      (error "Unknown type `~A'." value)))
+      (error "Unknown type `~A'" value)))
 
 ;;;--------------------------------------------------------------------------
 ;;; Property sets.
index 4b0eeba..49ac335 100644 (file)
   (:documentation
    "Reports an inconsistency in the arguments passed to `merge-lists'.")
   (:report (lambda (condition stream)
-            (format stream "Merge inconsistency: failed to decide among ~A."
+            (format stream "Merge inconsistency: failed to decide among ~A"
                     (merge-error-candidates condition)))))
 
 (export 'merge-lists)