jump-text)
#:globals (.globals body-info))))
+ ((do-while ,body ,test)
+ (let* ((text-length (length text))
+
+ (body-info ((ast->info info) body))
+ (body-text (list-tail (.text body-info) text-length))
+ (body-length (length (text->list body-text)))
+
+ (empty (clone info #:text '()))
+ (test-jump->info ((test->jump->info empty) test))
+ (test+jump-info (test-jump->info 0))
+ (test-length (length (text->list (.text test+jump-info))))
+
+ (jump-text (list (lambda (f g ta t d)
+ (i386:Xjump (- (+ body-length test-length))))))
+ (jump-length (length (text->list jump-text)))
+
+ (test-text (.text (test-jump->info jump-length))))
+ (clone info #:text
+ (append
+ (.text body-info)
+ test-text
+ jump-text)
+ #:globals (.globals body-info))))
+
((labeled-stmt (ident ,label) ,statement)
(let ((info (clone info #:text (append text (list label)))))
((ast->info info) statement)))
char *x = arena;
char *y = g_chars;
+ puts ("t: for (i=1; i<5; ++i)\n");
+ for (i=1; i<5; ++i);
+ if (i != 5) return i;
+
+ puts ("t: while (i<3) i++\n");
+ i = 1;
+ while (i<3) i++;
+ if (i != 3) return i;
+
+ puts ("t: do i-- while (i>0)\n");
+ do i--; while (i>0);
+ if (i != 0) return 1;
+
puts ("t: if (0)\n");
if (0) return 1;