Ticket #1715: emit-inline.patch

File emit-inline.patch, 1.3 KB (added by alicemaz, 3 months ago)
  • support.scm

    From ecb2c0b742d3f5c7a6b69d39885fff60e59ddd69 Mon Sep 17 00:00:00 2001
    From: alice maz <alice@alicemaz.com>
    Date: Sat, 15 Aug 2020 13:43:16 -0500
    Subject: [PATCH] Always write file when -emit-inline-file given
    
    ---
     support.scm | 22 ++++++++++------------
     1 file changed, 10 insertions(+), 12 deletions(-)
    
    diff --git a/support.scm b/support.scm
    index 5eff6e23..f610349d 100644
    a b  
    841841           (set! lst (cons sym lst))
    842842           (set! out (cons (list sym (node->sexpr (cdr val))) out)))))
    843843     db)
    844     (if (null? out)
    845         (delete-file* inline-file)
    846         (with-output-to-file inline-file
    847           (lambda ()
    848             (print "; GENERATED BY CHICKEN " (chicken-version) " FROM "
    849                    source-file "\n")
    850             (for-each
    851              (lambda (x)
    852                (pp x)
    853                (newline))
    854              (reverse out))
    855             (print "; END OF FILE"))))
     844    (with-output-to-file inline-file
     845      (lambda ()
     846        (print "; GENERATED BY CHICKEN " (chicken-version) " FROM "
     847               source-file "\n")
     848        (for-each
     849         (lambda (x)
     850           (pp x)
     851           (newline))
     852         (reverse out))
     853        (print "; END OF FILE")))
    856854    (when (and (pair? lst)
    857855               (debugging 'i "the following procedures can be globally inlined:"))
    858856      (for-each (cut print "  " <>) (sort-symbols lst)))))