mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 14:57:36 +02:00
Merge pull request #302 from arthurmaciel/correct-semi-colon-bug
Previous try to correct semi-colon bug failed
This commit is contained in:
commit
070a9924d3
1 changed files with 10 additions and 5 deletions
|
@ -334,10 +334,16 @@
|
|||
(append (c:allocs cp1) (c:allocs cp2))))
|
||||
|
||||
(define (c:serialize cp prefix)
|
||||
(let* ((body (c:body cp))
|
||||
(blen (string-length body)))
|
||||
(string-append
|
||||
(c:allocs->str (c:allocs cp) prefix)
|
||||
prefix
|
||||
(c:body cp)))
|
||||
body
|
||||
(if (and (> blen 0)
|
||||
(not (eq? #\; (string-ref body (- blen 1))))) ; last char
|
||||
";"
|
||||
""))))
|
||||
|
||||
;; c-compile-program : exp -> string
|
||||
(define (c-compile-program exp src-file)
|
||||
|
@ -348,8 +354,7 @@
|
|||
;; (write `(DEBUG ,body))
|
||||
(string-append
|
||||
preamble
|
||||
(c:serialize body " ")
|
||||
" ;\n")))
|
||||
(c:serialize body " "))))
|
||||
|
||||
;; c-compile-exp : exp (string -> void) -> string
|
||||
;;
|
||||
|
|
Loading…
Add table
Reference in a new issue