mirror of
https://github.com/open-goal/jak-project
synced 2026-09-07 03:30:01 -04:00
[decomp] Split condition and body of until after building expressions (#768)
* improve until decomp * fix tests
This commit is contained in:
+4
-8
@@ -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
@@ -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)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user