From 70cb8e266aab7e09753104b9ac4512676e1b9a61 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Fri, 14 Dec 2012 22:26:05 +0000 Subject: [PATCH] Add testing environment --- lispstrack.lisp | 15 +++++++++++---- prelude.js | 7 +++++++ test.html | 7 +++++++ test.lisp | 3 +++ 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 prelude.js create mode 100644 test.html create mode 100644 test.lisp 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) -- 1.7.10.4