guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 45/99: Add #:js-inline? and #:js-flatten? debugging opti


From: Christopher Allan Webber
Subject: [Guile-commits] 45/99: Add #:js-inline? and #:js-flatten? debugging options
Date: Sun, 10 Oct 2021 21:50:55 -0400 (EDT)

cwebber pushed a commit to branch compile-to-js-merge
in repository guile.

commit 723fc850f604addee991b01b075efcfe16b0bdab
Author: Ian Price <ianprice90@googlemail.com>
AuthorDate: Thu Jun 15 22:34:39 2017 +0100

    Add #:js-inline? and #:js-flatten? debugging options
    
    * module/language/js-il/compile-javascript.scm (compile-javascript):
      Check for #:js-inline? and #:js-flatten?, and turn off
      inline-single-calls and flatten-blocks respectively.
---
 module/language/js-il/compile-javascript.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/module/language/js-il/compile-javascript.scm 
b/module/language/js-il/compile-javascript.scm
index 67a3492..ed76441 100644
--- a/module/language/js-il/compile-javascript.scm
+++ b/module/language/js-il/compile-javascript.scm
@@ -15,9 +15,13 @@
   (eqv? obj (pointer->scm (make-pointer unbound-bits))))
 
 (define (compile-javascript exp env opts)
-  (set! exp (inline-single-calls exp))
+  (match (memq #:js-inline? opts)
+    ((#:js-inline? #f _ ...) #f)
+    (_ (set! exp (inline-single-calls exp))))
   (set! exp (compile-exp exp))
-  (set! exp (flatten-blocks exp))
+  (match (memq #:js-flatten? opts)
+    ((#:js-flatten? #f _ ...) #f)
+    (_ (set! exp (flatten-blocks exp))))
   (values exp env env))
 
 (define *scheme* (make-id "scheme"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]