mescc: Nyacc comment escapes.

* module/mescc/compile.scm (ast->comment): Nyacc comment escapes.
This commit is contained in:
Jan Nieuwenhuizen 2018-10-06 20:32:49 +02:00
parent dc4b7f3a37
commit 6ab9a206bb
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -581,7 +581,12 @@
(define (ast->comment o)
(if mes? '()
(let ((source (with-output-to-string (lambda () (pretty-print-c99 o)))))
(let* ((source (with-output-to-string (lambda () (pretty-print-c99 o))))
;; Nyacc fixups
(source (string-substitute source "\\" "\\\\"))
(source (string-substitute source "'\\'" "'\\\\'"))
(source (string-substitute source "'\"'" "'\\\"'"))
(source (string-substitute source "'''" "'\\''")))
(make-comment (string-join (string-split source #\newline) " ")))))
(define (r*n info n)