X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=lispstrack.lisp;h=7848b81bc0d7d5fdf1b13f05bf477f90c2953cc6;hb=ee2e4ec32c9961958bd3c1c8dda6a98e78ea61c8;hp=2d27c251881d929d40ddf2d55ae25d8383861473;hpb=639352dfb2152d21d6a3f1e8364935cbb2e9639a;p=jscl.git diff --git a/lispstrack.lisp b/lispstrack.lisp index 2d27c25..7848b81 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -330,7 +330,7 @@ *newline* (if rest-argument (let ((js!rest (lookup-variable-translation rest-argument new-env))) - (concat "var " js!rest ";" *newline* + (concat "var " js!rest "= false;" *newline* "for (var i = arguments.length-1; i>=" (integer-to-string (length required-arguments)) "; i--)" *newline* @@ -363,6 +363,9 @@ (let ((ch (char string index))) (when (or (char= ch #\") (char= ch #\\)) (setq output (concat output "\\"))) + (when (or (char= ch #\newline)) + (setq output (concat output "\\")) + (setq ch #\n)) (setq output (concat output (string ch)))) (incf index)) output)) @@ -648,9 +651,10 @@ (setq *toplevel-compilations* nil) (let ((code (ls-compile sexp))) (prog1 - (concat (join (mapcar (lambda (x) (concat x ";" *newline*)) + (concat "/* " (princ-to-string sexp) " */" + (join (mapcar (lambda (x) (concat x ";" *newline*)) *toplevel-compilations*) - "") + "") code) (setq *toplevel-compilations* nil))))