mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-17 14:51:20 -08:00
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:
parent
2b3c328777
commit
e2be06e494
1 changed files with 11 additions and 4 deletions
|
|
@ -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*/")
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue