From 39c035fc710a45134199926272dfc8805fb9e02a Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 19 Oct 2018 20:23:42 -0700 Subject: [PATCH] Attempt to make LIARC lap files more readable. --- src/compiler/base/toplev.scm | 13 +++++++++---- src/compiler/machines/C/cutl.scm | 8 ++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) 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) -- 2.25.1