[decomp] Split condition and body of until after building expressions (#768)

* improve until decomp

* fix tests
This commit is contained in:
water111
2021-08-18 19:36:52 -04:00
committed by GitHub
parent 4a896aaa71
commit 1f0c2e0e71
13 changed files with 608 additions and 699 deletions
+4 -8
View File
@@ -171,13 +171,11 @@
(let ((obj-type (-> obj type))
(end-type object)
)
(until (begin
(set! obj-type (-> obj-type parent))
(= obj-type end-type)
)
(until (= obj-type end-type)
(if (= obj-type parent-type)
(return #t)
)
(set! obj-type (-> obj-type parent))
)
)
#f
@@ -186,13 +184,11 @@
;; definition for function type-type?
(defun type-type? ((child-type type) (parent-type type))
(let ((end-type object))
(until (begin
(set! child-type (-> child-type parent))
(or (= child-type end-type) (zero? child-type))
)
(until (or (= child-type end-type) (zero? child-type))
(if (= child-type parent-type)
(return #t)
)
(set! child-type (-> child-type parent))
)
)
#f
+6 -9
View File
@@ -356,15 +356,12 @@
(let ((end-of-append (&-> (the-as (pointer uint8) append-str) 3)))
(let ((location-of-char (string-skip-to-char (-> append-str data) char)))
(when (= (-> location-of-char 0) char)
(until (begin
(set! end-of-append location-of-char)
(set!
location-of-char
(string-skip-to-char (&-> location-of-char 1) char)
)
(!= (-> location-of-char 0) char)
)
(empty)
(until (!= (-> location-of-char 0) char)
(set! end-of-append location-of-char)
(set!
location-of-char
(string-skip-to-char (&-> location-of-char 1) char)
)
)
)
)