Commit | Line | Data |
---|---|---|
9da682ca RD |
1 | (in-package :parenscript) |
2 | ||
71089439 AL |
3 | (define-condition simple-style-warning (simple-condition style-warning) |
4 | ()) | |
5 | ||
6 | (defun warn-deprecated (old-name &optional new-name) | |
7 | (warn 'simple-style-warning | |
8 | :format-control "~:@(~a~) is deprecated~:[.~;, use ~:@(~a~) instead~]" | |
9 | :format-arguments (list old-name new-name new-name))) | |
7590646c | 10 | |
9da682ca | 11 | ;;; DEPRECATED INTERFACE ;;; |
7590646c VS |
12 | |
13 | (defun js-equal (a b) | |
14 | (warn-deprecated 'js-equal 'script-equal) | |
15 | (script-equal a b)) | |
9da682ca RD |
16 | |
17 | (defun js-compile (form) | |
7590646c | 18 | (warn-deprecated 'js-compile 'compile-script) |
9da682ca RD |
19 | (compile-script form :output-spec :javascript)) |
20 | ||
21 | (defun js-compile-list (form) | |
7590646c | 22 | (warn-deprecated 'js-compile-list 'compile-script) |
9da682ca RD |
23 | (compile-script form :output-spec :javascript)) |
24 | ||
7590646c | 25 | (defmacro defjsmacro (&rest args) |
b5be3f57 | 26 | (warn-deprecated 'defjsmacro 'defpsmacro) |
7590646c VS |
27 | `(defscriptmacro ,@args)) |
28 | ||
5aa10005 | 29 | (defmacro js-file (&rest body) |
71089439 | 30 | (warn-deprecated 'js-file) |
5aa10005 RD |
31 | `(html |
32 | (:princ | |
33 | (js ,@body)))) | |
34 | ||
35 | (defmacro js-script (&rest body) | |
71089439 | 36 | (warn-deprecated 'js-script) |
5aa10005 RD |
37 | `((:script :type "text/javascript") |
38 | (:princ (format nil "~%// <![CDATA[~%")) | |
39 | (:princ (js ,@body)) | |
40 | (:princ (format nil "~%// ]]>~%")))) | |
41 | ||
42 | (defmacro js-inline (&rest body) | |
71089439 | 43 | (warn-deprecated 'js-inline) |
5aa10005 RD |
44 | `(js-inline* '(progn ,@body))) |
45 | ||
46 | (defmacro js-inline* (&rest body) | |
71089439 | 47 | (warn-deprecated 'js-inline*) |
5aa10005 RD |
48 | `(concatenate 'string "javascript:" |
49 | (string-join (js-to-statement-strings (compile-script-form (list 'progn ,@body)) 0) " "))) | |
7590646c VS |
50 | |
51 | (defmacro with-unique-js-names (&rest args) | |
52 | (warn-deprecated 'with-unique-js-names 'with-unique-ps-names) | |
53 | `(with-unique-ps-names ,@args)) | |
54 | ||
55 | (defmacro gen-js-name (&rest args) | |
56 | (warn-deprecated 'gen-js-name 'gen-ps-name) | |
57 | `(gen-ps-name ,@args)) | |
58 | ||
59 | (defmacro gen-js-name-string (&rest args) | |
60 | (warn-deprecated 'gen-js-name-string 'gen-script-name-string) | |
61 | `(gen-script-name-string ,@args)) |