From a1985b3cf0ca42f573b8599ec50a0f162a26c314 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] src/: Error message cleanup. * 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. --- src/c-types-impl.lisp | 6 +++--- src/c-types-parse.lisp | 2 +- src/c-types-proto.lisp | 2 +- src/class-finalize-impl.lisp | 6 +++--- src/codegen-impl.lisp | 2 +- src/fragment-parse.lisp | 2 +- src/method-aggregate.lisp | 8 ++++---- src/module-parse.lisp | 2 +- src/optparse.lisp | 2 +- src/parser/package.lisp | 2 +- src/parser/parser-proto.lisp | 4 ++-- src/parser/scanner-charbuf-impl.lisp | 2 +- src/parser/scanner-proto.lisp | 2 +- src/pset-impl.lisp | 2 +- src/utilities.lisp | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/c-types-impl.lisp b/src/c-types-impl.lisp index 47266e6..6b7c904 100644 --- a/src/c-types-impl.lisp +++ b/src/c-types-impl.lisp @@ -328,7 +328,7 @@ `(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))) @@ -585,7 +585,7 @@ (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) @@ -627,7 +627,7 @@ (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)))))))) diff --git a/src/c-types-parse.lisp b/src/c-types-parse.lisp index ce70ef7..3a5a536 100644 --- a/src/c-types-parse.lisp +++ b/src/c-types-parse.lisp @@ -402,7 +402,7 @@ (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 diff --git a/src/c-types-proto.lisp b/src/c-types-proto.lisp index f8e7589..43824da 100644 --- a/src/c-types-proto.lisp +++ b/src/c-types-proto.lisp @@ -242,7 +242,7 @@ ((char= ch #\-) (write-char #\_ out)) (t - (error "Bad character in C name ~S." name)))))) + (error "Bad character in C name ~S" name)))))) (t name))) ;;;-------------------------------------------------------------------------- diff --git a/src/class-finalize-impl.lisp b/src/class-finalize-impl.lisp index be42f13..5abcc6e 100644 --- a/src/class-finalize-impl.lisp +++ b/src/class-finalize-impl.lisp @@ -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. @@ -283,7 +283,7 @@ (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)) diff --git a/src/codegen-impl.lisp b/src/codegen-impl.lisp index 84bdd18..a74b304 100644 --- a/src/codegen-impl.lisp +++ b/src/codegen-impl.lisp @@ -112,7 +112,7 @@ (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) diff --git a/src/fragment-parse.lisp b/src/fragment-parse.lisp index 8e32b07..c958da3 100644 --- a/src/fragment-parse.lisp +++ b/src/fragment-parse.lisp @@ -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 #\" #\')) diff --git a/src/method-aggregate.lisp b/src/method-aggregate.lisp index cec6f14..eeea9df 100644 --- a/src/method-aggregate.lisp +++ b/src/method-aggregate.lisp @@ -133,7 +133,7 @@ ;; 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)) @@ -145,12 +145,12 @@ 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)) @@ -283,7 +283,7 @@ (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)))) diff --git a/src/module-parse.lisp b/src/module-parse.lisp index da1c47f..d64e22e 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -349,7 +349,7 @@ (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) diff --git a/src/optparse.lisp b/src/optparse.lisp index 16b5b7b..6460c54 100644 --- a/src/optparse.lisp +++ b/src/optparse.lisp @@ -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*)))) diff --git a/src/parser/package.lisp b/src/parser/package.lisp index 623c297..e3e363d 100644 --- a/src/parser/package.lisp +++ b/src/parser/package.lisp @@ -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)) diff --git a/src/parser/parser-proto.lisp b/src/parser/parser-proto.lisp index 7aafe45..ed439f9 100644 --- a/src/parser/parser-proto.lisp +++ b/src/parser/parser-proto.lisp @@ -606,7 +606,7 @@ 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) @@ -683,7 +683,7 @@ (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 () diff --git a/src/parser/scanner-charbuf-impl.lisp b/src/parser/scanner-charbuf-impl.lisp index 86c4445..773a9a1 100644 --- a/src/parser/scanner-charbuf-impl.lisp +++ b/src/parser/scanner-charbuf-impl.lisp @@ -389,7 +389,7 @@ :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)) diff --git a/src/parser/scanner-proto.lisp b/src/parser/scanner-proto.lisp index c6236c5..a1ded51 100644 --- a/src/parser/scanner-proto.lisp +++ b/src/parser/scanner-proto.lisp @@ -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) diff --git a/src/pset-impl.lisp b/src/pset-impl.lisp index ecad712..e340389 100644 --- a/src/pset-impl.lisp +++ b/src/pset-impl.lisp @@ -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. diff --git a/src/utilities.lisp b/src/utilities.lisp index 4b0eeba..49ac335 100644 --- a/src/utilities.lisp +++ b/src/utilities.lisp @@ -446,7 +446,7 @@ (: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) -- 2.11.0