<commit_before>;;;; Copyright (c) 2008 - 2013
;;;;
;;;;     <NAME> (<EMAIL>)
;;;;
;;;; all rights reserved. 
;;;;
;;;; Permission is hereby granted to use this software for any 
;;;; purpose, including using, modifying, and redistributing it.
;;;;
;;;; The software is provided "as-is" with no warranty.  The user of
;;;; this software assumes any responsibility of the consequences. 

;;;; This file is part of the conditionals module of the SICL project.
;;;; See the file SICL.text for a description of the project. 
;;;; See the file conditionals.text for a description of the module.

(in-package :sicl-conditionals)

(defmethod cleavir-i18n:report-condition ((condition malformed-body)
					  stream
					  (language cleavir-i18n:english))
  (format stream
          "Expected a proper list of forms,~@
           but the following was given instead:~@
           ~s"
	  (body condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-cond-clauses)
					  stream
					  (language cleavir-i18n:english))
  (format stream
          "Expected a proper list of cond clauses,~@
           but the following was given instead:~@
           ~s"
	  (clauses condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-cond-clause)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "Expected a cond clause of the form,~@
           (test-form form*),~@
           but the following was given instead:~@
           ~s"
	  (clause condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-case-clauses)
					  stream
					  (language cleavir-i18n:english))
  (format stream
          "Expected a proper list of case clauses,~@
           but the following was given instead:~@
           ~s"
	  (clauses condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-case-clause)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "Expected a case clause of the form,~@
           (keys form*),~@
           but the following was given instead:~@
           ~s"
	  (clause condition)))

(defmethod cleavir-i18n:report-condition ((condition otherwise-clause-not-last)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "The `otherwise' or `t' clause must be last in a case form,~@
           but but it was followed by:~@
           ~s"
	  (clauses condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-keys)
					  stream
					  (language cleavir-i18n:english))
  (princ "Expected a designator for a list of keys," stream)
  (terpri stream)
  (princ "but found: " stream)
  (print (keys condition) stream))

(defmethod cleavir-i18n:report-condition ((condition malformed-typecase-clauses)
					  stream
					  (language cleavir-i18n:english))
  (princ "Expected a proper list of typecase clauses," stream)
  (terpri stream)
  (princ "but found: " stream)
  (print (clauses condition) stream))

(defmethod cleavir-i18n:report-condition ((condition malformed-typecase-clause)
					  stream
					  (language cleavir-i18n:english))
  (princ "Expected a typecase clause of the form," stream)
  (terpri stream)
  (princ "(type form*)," stream)
  (terpri stream)
  (princ "but found: " stream)
  (print (clause condition) stream))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Conditions used at runtime

(defmethod cleavir-i18n:report-condition ((condition ecase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in ecase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

(defmethod cleavir-i18n:report-condition ((condition ccase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in ccase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

(defmethod cleavir-i18n:report-condition ((condition etypecase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in etypecase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

(defmethod cleavir-i18n:report-condition ((condition ctypecase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in ctypecase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

<commit_msg>Use FORMAT in condition reporter for MALFORMED-KEY.<commit_after>;;;; Copyright (c) 2008 - 2013
;;;;
;;;;     <NAME> (<EMAIL>)
;;;;
;;;; all rights reserved. 
;;;;
;;;; Permission is hereby granted to use this software for any 
;;;; purpose, including using, modifying, and redistributing it.
;;;;
;;;; The software is provided "as-is" with no warranty.  The user of
;;;; this software assumes any responsibility of the consequences. 

;;;; This file is part of the conditionals module of the SICL project.
;;;; See the file SICL.text for a description of the project. 
;;;; See the file conditionals.text for a description of the module.

(in-package :sicl-conditionals)

(defmethod cleavir-i18n:report-condition ((condition malformed-body)
					  stream
					  (language cleavir-i18n:english))
  (format stream
          "Expected a proper list of forms,~@
           but the following was given instead:~@
           ~s"
	  (body condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-cond-clauses)
					  stream
					  (language cleavir-i18n:english))
  (format stream
          "Expected a proper list of cond clauses,~@
           but the following was given instead:~@
           ~s"
	  (clauses condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-cond-clause)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "Expected a cond clause of the form,~@
           (test-form form*),~@
           but the following was given instead:~@
           ~s"
	  (clause condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-case-clauses)
					  stream
					  (language cleavir-i18n:english))
  (format stream
          "Expected a proper list of case clauses,~@
           but the following was given instead:~@
           ~s"
	  (clauses condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-case-clause)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "Expected a case clause of the form,~@
           (keys form*),~@
           but the following was given instead:~@
           ~s"
	  (clause condition)))

(defmethod cleavir-i18n:report-condition ((condition otherwise-clause-not-last)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "The `otherwise' or `t' clause must be last in a case form,~@
           but but it was followed by:~@
           ~s"
	  (clauses condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-keys)
					  stream
					  (language cleavir-i18n:english))
  (format stream
	  "Expected a designator for a list of keys,~@
           but the following was given instead:~@
           ~s"
	  (keys condition)))

(defmethod cleavir-i18n:report-condition ((condition malformed-typecase-clauses)
					  stream
					  (language cleavir-i18n:english))
  (princ "Expected a proper list of typecase clauses," stream)
  (terpri stream)
  (princ "but found: " stream)
  (print (clauses condition) stream))

(defmethod cleavir-i18n:report-condition ((condition malformed-typecase-clause)
					  stream
					  (language cleavir-i18n:english))
  (princ "Expected a typecase clause of the form," stream)
  (terpri stream)
  (princ "(type form*)," stream)
  (terpri stream)
  (princ "but found: " stream)
  (print (clause condition) stream))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Conditions used at runtime

(defmethod cleavir-i18n:report-condition ((condition ecase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in ecase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

(defmethod cleavir-i18n:report-condition ((condition ccase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in ccase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

(defmethod cleavir-i18n:report-condition ((condition etypecase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in etypecase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))

(defmethod cleavir-i18n:report-condition ((condition ctypecase-type-error)
					  stream
					  (language cleavir-i18n:english))
  (princ "No key matched in ctypecase expression." stream)
  (terpri stream)
  (princ "Offending datum: " stream)
  (print (type-error-datum condition) stream)
  (princ "Offending datum: " stream)
  (print (type-error-expected-type condition) stream))


{'fraction_non_alphanumeric': 0.1277479485361159, 'fraction_numerical': 0.012156823016918245, 'mean_word_length': 3.444844664565511, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5315889', 'n_tokens_mistral': 3503, 'n_tokens_neox': 2958, 'n_words': 923}