From: David Vazquez Date: Fri, 14 Dec 2012 22:26:05 +0000 (+0000) Subject: Add testing environment X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=70cb8e266aab7e09753104b9ac4512676e1b9a61;p=jscl.git Add testing environment --- diff --git a/lispstrack.lisp b/lispstrack.lisp index 4baeb39..8af6781 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -96,9 +96,16 @@ body can access to the local environment through the variable env" (defun ls-compile-block (sexps env) (concat (join (mapcar (lambda (x) - (ls-compile x env)) + (concat (ls-compile x env) ";")) (butlast sexps)) - "; -") - "; + "") + " return " (ls-compile (car (last sexps)) env) ";")) + + +(defun compile-test () + (with-open-file (in "test.lisp") + (with-open-file (out "test.js" :direction :output :if-exists :supersede) + (loop + for x = (read in nil) while x + do (write-string (ls-compile x) out))))) diff --git a/prelude.js b/prelude.js new file mode 100644 index 0000000..4496eca --- /dev/null +++ b/prelude.js @@ -0,0 +1,7 @@ +// + +function Symbol(name){ + this.name = name; +} + +console.log('Running test.js...'); diff --git a/test.html b/test.html new file mode 100644 index 0000000..18bd35b --- /dev/null +++ b/test.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/test.lisp b/test.lisp new file mode 100644 index 0000000..87240de --- /dev/null +++ b/test.lisp @@ -0,0 +1,3 @@ + +(lambda (x y) + x)