Removed deprecated exports that are no longer implemented.
[clinton/parenscript.git] / src / compilation-interface.lisp
index bb05fa2..4817370 100644 (file)
@@ -2,26 +2,27 @@
 
 (defun compile-script (script-form &key (output-stream nil))
   "Compiles the Parenscript form SCRIPT-FORM into Javascript.
-Non-null PRETTY-PRINT values result in a pretty-printed output code.
 If OUTPUT-STREAM is NIL, then the result is a string; otherwise code
 is output to the OUTPUT-STREAM stream."
   (parenscript-print (compile-parenscript-form script-form :expecting :statement) output-stream))
 
 (defmacro ps (&body body)
-  "A macro that returns a Javascript string of the supplied Parenscript forms."
+  "Given Parenscript forms (an implicit progn), expands to code which
+compiles those forms to a JavaScript string."
   `(ps* '(progn ,@body)))
 
 (defun ps* (&rest body)
-  "Return the javascript string representing BODY.
+  "Compiles BODY to a JavaScript string.
 Body is evaluated."
   (compile-script `(progn ,@body)))
 
-(defun ps-inline* (form)
+(defvar *js-inline-string-delimiter* #\"
+  "Controls the string delimiter char used when compiling Parenscript in ps-inline.")
+
+(defun ps-inline* (form &optional (*js-string-delimiter* *js-inline-string-delimiter*))
   (concatenate 'string
                "javascript:"
-               (remove #\Newline
-                       (parenscript-print (compile-parenscript-form form :expecting :statement))
-                       :from-end t)))
+               (parenscript-print (compile-parenscript-form form :expecting :statement))))
 
-(defmacro ps-inline (&body body)
-  `(ps-inline* '(progn ,@body)))
+(defmacro ps-inline (form &optional (string-delimiter '*js-inline-string-delimiter*))
+  `(ps-inline* ',form ,string-delimiter))