When writing C comments, the compiler has to spell out all Unicode characters in a format that does not hurt the compiler.

This commit is contained in:
Juan Jose Garcia Ripoll 2011-07-27 22:49:36 +02:00
parent 2b3c328777
commit e2be06e494

View file

@ -82,10 +82,17 @@
(let* ((l (1- (length text))))
(declare (fixnum l))
(dotimes (n l)
(let ((c (schar text n)))
(princ c stream)
(when (and (char= c #\*) (char= (schar text (1+ n)) #\/))
(princ #\\ stream))))
(let* ((c (schar text n))
(code (char-code c)))
(cond
((or (eq c #\Newline) (eq c #\Tab))
(princ c stream))
((or (< code 32) (> code 127))
(format stream "\ux" code))
((and (char= c #\*) (char= (schar text (1+ n)) #\/))
(princ #\\ stream))
(t
(princ c stream)))))
(princ (schar text l) stream))
(format stream "~70T*/")
)