guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 08/99: conditional->branch


From: Christopher Allan Webber
Subject: [Guile-commits] 08/99: conditional->branch
Date: Sun, 10 Oct 2021 21:50:42 -0400 (EDT)

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

commit f8618a522fbaa732144548f4da556bbf8b2636e1
Author: Ian Price <ianprice90@googlemail.com>
AuthorDate: Sun Jun 7 17:00:48 2015 +0100

    conditional->branch
---
 module/language/javascript.scm               | 8 ++++----
 module/language/js-il/compile-javascript.scm | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/module/language/javascript.scm b/module/language/javascript.scm
index 18ce0f0..0a30db3 100644
--- a/module/language/javascript.scm
+++ b/module/language/javascript.scm
@@ -12,7 +12,7 @@
             make-new new
             make-id id
             make-refine refine
-            make-conditional conditional
+            make-branch branch
             make-var var
 
             print-statement))
@@ -55,7 +55,7 @@
 (define-js-type new expr)
 (define-js-type id name)
 (define-js-type refine id field)
-(define-js-type conditional test then else)
+(define-js-type branch test then else)
 (define-js-type var id exp)
 
 (define (unparse-js exp)
@@ -76,7 +76,7 @@
      `(id ,name))
     (($ refine id field)
      `(refine ,(unparse-js id) ,(unparse-js field)))
-    (($ conditional test then else)
+    (($ branch test then else)
      `(if ,(unparse-js test)
           (block ,@(map unparse-js then))
           (block ,@(map unparse-js else))))
@@ -134,7 +134,7 @@
      (print-exp exp port)
      (format port ";"))
 
-    (($ conditional test then else)
+    (($ branch test then else)
      (format port "if (")
      (print-exp test port)
      (format port ") {")
diff --git a/module/language/js-il/compile-javascript.scm 
b/module/language/js-il/compile-javascript.scm
index a0427cc..373d5a9 100644
--- a/module/language/js-il/compile-javascript.scm
+++ b/module/language/js-il/compile-javascript.scm
@@ -47,10 +47,10 @@
      (make-return (make-call (name->id k) (map compile-exp exps))))
 
     (($ il:branch test then else)
-     (make-conditional (make-call (make-refine *scheme* (make-const "is_true"))
-                                  (list (compile-exp test)))
-                       (list (compile-exp then))
-                       (list (compile-exp else))))
+     (make-branch (make-call (make-refine *scheme* (make-const "is_true"))
+                             (list (compile-exp test)))
+                  (list (compile-exp then))
+                  (list (compile-exp else))))
 
     (($ il:const c)
      (compile-const c))



reply via email to

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