Commit 58771a88 authored by Vladimir Sedach's avatar Vladimir Sedach
Browse files

Changed package designators to uninterned symbols (should protect against...

Changed package designators to uninterned symbols (should protect against reader changes and enable safe usage with case-sensitive lisps)
parent fe16b365
(in-package "PARENSCRIPT")
(in-package #:parenscript)
;;; Script of library functions you can include with your own code to
;;; provide standard Lisp functionality.
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(defparameter *js-target-version* 1.3)
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(defvar *ps-reserved-symbol-names*
(list "break" "case" "catch" "continue" "default" "delete" "do" "else"
......
(in-package :parenscript)
(in-package #:parenscript)
(define-condition simple-style-warning (simple-condition style-warning)
())
......
(in-package "COMMON-LISP")
(in-package #:cl)
;; These are convenience packages that export JS and browser DOM
;; symbols. If you :use the packages in a package FOO and then
......@@ -9,7 +9,7 @@
;; PS-WINDOW-WD-SYMBOLS (which includes DOM level 2 and the w3c Window
;; working draft), and possibly the PS-DOM-NONSTANDARD-SYMBOLS.
(defpackage "PS-JS-SYMBOLS"
(defpackage #:ps-js-symbols
(:export
#:to-fixed
#:encode-u-r-i-component
......@@ -24,8 +24,8 @@
#:call
))
(defpackage "PS-DOM1-SYMBOLS"
(:use "COMMON-LISP") ;; ensure we don't have naming collisions w/symbols defined in CL
(defpackage #:ps-dom1-symbols
(:use #:cl) ;; ensure we don't have naming collisions w/symbols defined in CL
(:export
;;; Core
;; DOMImplementation
......@@ -621,8 +621,8 @@
#:src
#:width))
(defpackage "PS-DOM2-SYMBOLS"
(:use "PS-DOM1-SYMBOLS" "COMMON-LISP")
(defpackage #:ps-dom2-symbols
(:use #:ps-dom1-symbols #:cl)
(:export
;;; Core
;; DOMImplementation
......@@ -990,9 +990,9 @@
)
)
(defpackage "PS-WINDOW-WD-SYMBOLS"
(defpackage #:ps-window-wd-symbols
;;; The window object (w3c working draft)
(:use "PS-DOM2-SYMBOLS" "COMMON-LISP")
(:use #:ps-dom2-symbols #:cl)
(:export
; attributes
#:window
......@@ -1029,7 +1029,7 @@
)
)
(defpackage "PS-DOM-NONSTANDARD-SYMBOLS"
(defpackage #:ps-dom-nonstandard-symbols
;;; Non-standard (incl. DOM level 0) but useful
(:export
#:inner-h-t-m-l
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
;; Utilities for accessing standard DOM functionality in a Lispier, PSier way.
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(defvar *ps-html-empty-tag-aware-p* t)
(defvar *ps-html-mode* :sgml "One of :sgml or :xml")
......
(in-package :parenscript)
(in-package #:parenscript)
(defun complex-js-expr? (expr)
(if (symbolp expr)
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(define-ps-symbol-macro f js:f)
(define-ps-symbol-macro false js:f)
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(defvar *obfuscated-packages* (make-hash-table))
......
(in-package "CL-USER")
(in-package #:cl)
(provide :parenscript)
(defpackage "PARENSCRIPT"
(:use "COMMON-LISP" "ANAPHORA")
(:nicknames "PS")
(defpackage #:parenscript
(:use #:cl #:anaphora)
(:nicknames #:ps)
(:export
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Compiler interface
......@@ -284,9 +284,8 @@
))
(defpackage "JS"
(:shadowing-import-from
"COMMON-LISP"
(defpackage #:js
(:shadowing-import-from #:cl
#:+
#:-
#:*
......
(in-package :parenscript)
(in-package #:parenscript)
;;;; This software was taken from the SBCL system, mostly verbatim.
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(defvar *ps-print-pretty* t)
(defvar *indent-num-spaces* 4)
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(defmacro with-local-macro-environment ((var env) &body body)
`(let* ((,var (make-macro-dictionary))
......
(in-package "PARENSCRIPT")
(in-package #:parenscript)
(let ((cache (make-hash-table :test 'equal)))
(defun encode-js-identifier (identifier)
......
(in-package "PARENSCRIPT-TEST")
(in-package #:parenscript-test)
(in-suite package-system-tests)
......@@ -6,9 +6,9 @@
(#:new)
"new();")
(defpackage "PS-TEST.MY-LIBRARY"
(:use "PARENSCRIPT"))
(setf (ps-package-prefix "PS-TEST.MY-LIBRARY") "my_library_")
(defpackage #:ps-test.my-library
(:use #:parenscript))
(setf (ps-package-prefix '#:ps-test.my-library) "my_library_")
(test-ps-js lib-function1
(defun ps-test.my-library::library-function (x y)
......@@ -30,8 +30,8 @@ foo.my_library_foo;")
(code-char (1+ (char-code x))))
(symbol-name symbol)))))))
(defpackage "PS-TEST.OBFUSCATE-ME")
(obfuscate-package "PS-TEST.OBFUSCATE-ME" #'symbol-obfuscator)
(defpackage #:ps-test.obfuscate-me)
(obfuscate-package '#:ps-test.obfuscate-me #'symbol-obfuscator)
(test-ps-js obfuscation1
(defun ps-test.obfuscate-me::libfun2 (a b ps-test.obfuscate-me::foo)
......@@ -40,9 +40,9 @@ foo.my_library_foo;")
return a + my_library_libraryFunction(b, gpp);
};")
(defpackage "PS-TEST.OBFUSCATE-AND-PREFIX")
(obfuscate-package "PS-TEST.OBFUSCATE-AND-PREFIX" #'symbol-obfuscator)
(setf (ps-package-prefix "PS-TEST.OBFUSCATE-AND-PREFIX") "__FOO___")
(defpackage #:ps-test.obfuscate-and-prefix)
(obfuscate-package '#:ps-test.obfuscate-and-prefix #'symbol-obfuscator)
(setf (ps-package-prefix '#:ps-test.obfuscate-and-prefix) "__FOO___")
(test-ps-js obfuscate-and-prefix
(defun ps-test.obfuscate-and-prefix::xfun (a ps-test.obfuscate-and-prefix::b ps-test.my-library::d)
......@@ -53,14 +53,14 @@ foo.my_library_foo;")
return a * mjcgvo3(__FOO___c, a) * my_library_libraryFunction(my_library_d, __FOO___c);
};")
(defpackage "PS-TEST.PSTSTPKG"
(:use "PARENSCRIPT"))
(defpackage #:ps-test.pststpkg
(:use #:parenscript))
(test namespace1 ()
(setf (ps-package-prefix "PS-TEST.PSTSTPKG") "prefix_")
(setf (ps-package-prefix '#:ps-test.pststpkg) "prefix_")
(is (string= "prefix_foo;" (normalize-js-code (ps* 'ps-test.pststpkg::foo)))))
(common-lisp:in-package "PS-TEST.PSTSTPKG")
(common-lisp:in-package #:ps-test.pststpkg)
(ps-test::test-ps-js namespace-and-special-forms
(let ((foo (create bar 1 not-a-keyword something)))
......
(in-package "PARENSCRIPT-TEST")
(in-package #:parenscript-test)
(in-suite ps-tests)
......
(in-package "PARENSCRIPT-TEST")
(in-package #:parenscript-test)
;;; These tests were originally generated from the reference manual
......
(in-package "PARENSCRIPT-TEST")
(in-package #:parenscript-test)
(defun normalize-whitespace (str)
(substitute #\Space #\Newline (substitute #\Space #\Tab str)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment