From: Chris Hanson Date: Sat, 20 Oct 2018 03:23:42 +0000 (-0700) Subject: Attempt to make LIARC lap files more readable. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~200 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=39c035fc710a45134199926272dfc8805fb9e02a;p=mit-scheme.git Attempt to make LIARC lap files more readable. --- diff --git a/src/compiler/base/toplev.scm b/src/compiler/base/toplev.scm index 505c80659..6636b5db6 100644 --- a/src/compiler/base/toplev.scm +++ b/src/compiler/base/toplev.scm @@ -1126,7 +1126,8 @@ USA. (cond ((and (pair? instruction) (eq? (car instruction) 'label)) (write (cadr instruction) port) - (write-char #\: port)) + (write-char #\: port) + (newline port)) ((and (pair? instruction) (eq? (car instruction) 'comment)) (write-char #\tab port) @@ -1138,11 +1139,15 @@ USA. (cadr frob) frob) port)) - (cdr instruction))) + (cdr instruction)) + (newline port)) + ((record? instruction) + ;; Handles c:line and c:group instructions. + (write instruction port)) (else (write-char #\tab port) - (write instruction port))) - (newline port)) + (write instruction port) + (newline port)))) (define (rtl/lap-file-header tag scode port) (write-char #\page port) diff --git a/src/compiler/machines/C/cutl.scm b/src/compiler/machines/C/cutl.scm index 8ad6bcc50..ea449be6c 100644 --- a/src/compiler/machines/C/cutl.scm +++ b/src/compiler/machines/C/cutl.scm @@ -82,6 +82,10 @@ USA. (indentation c:line-indentation) (text c:line-text)) +(define-printer-method c:line? + (lambda (line port) + (c:write-line line port))) + (define-guarantee c:line "C line") (define (c:line . items) @@ -146,6 +150,10 @@ USA. c:group? (lines c:group-lines)) +(define-print-method c:group? + (lambda (group port) + (c:write-group group port))) + (define-guarantee c:group "C group") (define (c:group . items)