Attempt to make LIARC lap files more readable.
authorChris Hanson <org/chris-hanson/cph>
Sat, 20 Oct 2018 03:23:42 +0000 (20:23 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sat, 20 Oct 2018 03:23:42 +0000 (20:23 -0700)
src/compiler/base/toplev.scm
src/compiler/machines/C/cutl.scm

index 505c806591dc57ca961c5cbe930c2c64786bd086..6636b5db611d87adbb5a16f1b9b5eb8890db78f1 100644 (file)
@@ -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)
index 8ad6bcc5033c94c722882ae2b9537cd4fe480321..ea449be6c2a26e3a113bf9dd5026f05d459ecb20 100644 (file)
@@ -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)