1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00

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.
This commit is contained in:
Ian Price 2017-06-15 22:34:39 +01:00
parent 602bfb559d
commit 723fc850f6

View file

@ -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"))