CLHS doesn't allow @ to appear in the closing directive of ~<~>.
Patch by Jan Moringen.
Fixes lp#1153148
(regression since 1.0.42.11-bis)
* bug fix: clear-output calls the correct gray stream routine,
sb-gray:stream-clear-output. (lp#1153257)
+ * bug fix: an error is signalled for an invalid format modifier: ~<~@>.
+ (lp#1153148)
changes in sbcl-1.1.5 relative to sbcl-1.1.4:
* minor incompatible change: SB-SPROF:WITH-PROFILING no longer loops
(multiple-value-bind (segments first-semi close remaining)
(parse-format-justification directives)
(values
- (if (format-directive-colonp close)
+ (if (format-directive-colonp close) ; logical block vs. justification
(multiple-value-bind (prefix per-line-p insides suffix)
(parse-format-logical-block segments colonp first-semi
close params string end)
:complaint "~D illegal directive~:P found inside justification block"
:args (list count)
:references (list '(:ansi-cl :section (22 3 5 2)))))
+ ;; ANSI does not explicitly say that an error should be
+ ;; signalled, but the @ modifier is not explicitly allowed
+ ;; for ~> either.
+ (when (format-directive-atsignp close)
+ (error 'format-error
+ :complaint "@ modifier not allowed in close ~
+ directive of justification ~
+ block (i.e. ~~<...~~@>."
+ :offset (1- (format-directive-end close))
+ :references (list '(:ansi-cl :section (22 3 6 2)))))
(expand-format-justification segments colonp atsignp
first-semi params)))
remaining)))
(multiple-value-bind (segments first-semi close remaining)
(parse-format-justification directives)
(setf args
- (if (format-directive-colonp close)
+ (if (format-directive-colonp close) ; logical block vs. justification
(multiple-value-bind (prefix per-line-p insides suffix)
(parse-format-logical-block segments colonp first-semi
close params string end)
:complaint "~D illegal directive~:P found inside justification block"
:args (list count)
:references (list '(:ansi-cl :section (22 3 5 2)))))
+ ;; ANSI does not explicitly say that an error should
+ ;; be signalled, but the @ modifier is not explicitly
+ ;; allowed for ~> either.
+ (when (format-directive-atsignp close)
+ (error 'format-error
+ :complaint "@ modifier not allowed in close ~
+ directive of justification ~
+ block (i.e. ~~<...~~@>."
+ :offset (1- (format-directive-end close))
+ :references (list '(:ansi-cl :section (22 3 6 2)))))
(interpret-format-justification stream orig-args args
segments colonp atsignp
first-semi params))))
(defmethod make-load-form ((object structure-object) &optional env)
(declare (ignore env))
- (error "~@<don't know how to dump ~S (default ~S method called).~@>"
+ (error "~@<don't know how to dump ~S (default ~S method called).~>"
object 'make-load-form))
(defmethod make-load-form ((object standard-object) &optional env)
(declare (ignore env))
- (error "~@<don't know how to dump ~S (default ~S method called).~@>"
+ (error "~@<don't know how to dump ~S (default ~S method called).~>"
object 'make-load-form))
(defmethod make-load-form ((object condition) &optional env)
(declare (ignore env))
- (error "~@<don't know how to dump ~S (default ~S method called).~@>"
+ (error "~@<don't know how to dump ~S (default ~S method called).~>"
object 'make-load-form))
(defun make-load-form-saving-slots (object &key (slot-names nil slot-names-p) environment)
(assert (raises-error? (format nil "~<~<~A~:>~>" '(foo))))
(assert (string= (format nil "~<~<~A~>~>" 'foo) "FOO"))
+(with-test (:name (:format :justification-atsign-check))
+ (assert (raises-error? (format nil "~<~@>")))
+ (assert (raises-error? (eval '(format nil "~<~@>")))))
+
;;; Check that arrays that we print while *PRINT-READABLY* is true are
;;; in fact generating similar objects.
(assert (equal (array-dimensions