cwebber pushed a commit to branch compile-to-js-merge
in repository guile.
commit 723fc850f604addee991b01b075efcfe16b0bdab
Author: Ian Price <[email protected]>
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"))