From 8723dc34b267f1641dcadec3eb716cedb562c625 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Fri, 3 Aug 2007 02:01:33 +0000 Subject: [PATCH] Fixed handling of uninterned symbols. --- src/builtin-packages.lisp | 5 ++++- src/parser.lisp | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/builtin-packages.lisp b/src/builtin-packages.lisp index 849ccd8..357c552 100644 --- a/src/builtin-packages.lisp +++ b/src/builtin-packages.lisp @@ -46,4 +46,7 @@ :nicknames '("PS-USER" "PAREN-USER")) (create-script-package comp-env - :name "PS_GS" :lisp-package :parenscript.ps-gensyms))) \ No newline at end of file + :name "PS_GS" :lisp-package :parenscript.ps-gensyms) + (create-script-package + comp-env + :name "UNINTERNED" :prefix ""))) \ No newline at end of file diff --git a/src/parser.lisp b/src/parser.lisp index 34b63f5..4a89ed5 100644 --- a/src/parser.lisp +++ b/src/parser.lisp @@ -105,7 +105,7 @@ don't have an associated ParenScript package.") Defaulting to :parenscript-user." :format-arguments (list symbol (symbol-package symbol)))) (find-script-package "PARENSCRIPT-USER" (make-basic-compilation-environment)))) - (gethash symbol (symbol-to-script-package *compilation-environment*)))) + (find-script-package "UNINTERNED" *compilation-environment*))) (defun find-script-package (name &optional (comp-env *compilation-environment*)) "Find the script package with the name NAME in the given compilation environment." @@ -663,10 +663,12 @@ also guarantees that the symbol has an associated script-package." (setf res (ps-js::value res))) (assert (symbolp res) () "~a is expected to be a symbol, but compiles to ~a (the ParenScript output for ~a alone is \"~a\"). This could be due to ~a being a special form." form res form (ps::ps* form) form) - (assert (symbol-script-package res) () - "The symbol ~A::~A has no associated script package." - (if (symbol-package res) (package-name (symbol-package res)) "ANONYMOUS-PACKAGE") - res) + (unless (symbol-script-package res) + (when *warn-ps-package* + (warn 'simple-style-warning + :format-control "The symbol ~A::~A has no associated script package." + :format-arguments (list (if (symbol-package res) (package-name (symbol-package res)) "ANONYMOUS-PACKAGE") + res)))) res)) (defun compile-to-statement (form) -- 2.20.1