mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 19:56:34 +02:00
Previous try to correct semi-colon bug failed due to adding semi-colon to the end of a whole block and not each statement
This commit is contained in:
parent
402ae5dea0
commit
a8cf5d9312
1 changed files with 10 additions and 5 deletions
|
@ -334,10 +334,16 @@
|
||||||
(append (c:allocs cp1) (c:allocs cp2))))
|
(append (c:allocs cp1) (c:allocs cp2))))
|
||||||
|
|
||||||
(define (c:serialize cp prefix)
|
(define (c:serialize cp prefix)
|
||||||
|
(let* ((body (c:body cp))
|
||||||
|
(blen (string-length body)))
|
||||||
(string-append
|
(string-append
|
||||||
(c:allocs->str (c:allocs cp) prefix)
|
(c:allocs->str (c:allocs cp) prefix)
|
||||||
prefix
|
prefix
|
||||||
(c:body cp)))
|
body
|
||||||
|
(if (and (> blen 0)
|
||||||
|
(not (eq? #\; (string-ref body (- blen 1))))) ; last char
|
||||||
|
";"
|
||||||
|
""))))
|
||||||
|
|
||||||
;; c-compile-program : exp -> string
|
;; c-compile-program : exp -> string
|
||||||
(define (c-compile-program exp src-file)
|
(define (c-compile-program exp src-file)
|
||||||
|
@ -348,8 +354,7 @@
|
||||||
;; (write `(DEBUG ,body))
|
;; (write `(DEBUG ,body))
|
||||||
(string-append
|
(string-append
|
||||||
preamble
|
preamble
|
||||||
(c:serialize body " ")
|
(c:serialize body " "))))
|
||||||
" ;\n")))
|
|
||||||
|
|
||||||
;; c-compile-exp : exp (string -> void) -> string
|
;; c-compile-exp : exp (string -> void) -> string
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue