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
1 changed files with 6 additions and 1 deletions

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)