summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-16 23:19:31 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-16 23:19:31 -0800
commit0c5016a7f39a6a70018949da90f3b9737bf945de (patch)
tree2adf23155ec3684d04296a100a218f456a2c7afc /lib.c
parent030ce483baef93392d54a4aec90bfa7b5906bc53 (diff)
downloadtxr-0c5016a7f39a6a70018949da90f3b9737bf945de.tar.gz
txr-0c5016a7f39a6a70018949da90f3b9737bf945de.tar.bz2
txr-0c5016a7f39a6a70018949da90f3b9737bf945de.zip
* lib.c (intern): fix the previous diagnostic bug once more with more
feeling. * parser.l (grammar): Recognize package prefixes in symbol tokens. Got rid of special rule for handling lone colon. * parser.y (sym_helper): Catch undefined package as a parsing error rather allowing intern function to throw exception.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index e95d72f8..0939bd9a 100644
--- a/lib.c
+++ b/lib.c
@@ -2561,9 +2561,10 @@ val intern(val str, val package)
if (nullp(package)) {
package = user_package;
} else if (stringp(package)) {
- package = find_package(str);
- if (!package)
- uw_throwf(error_s, lit("intern: ~s no such package"), str, nao);
+ val p = find_package(package);
+ if (!p)
+ uw_throwf(error_s, lit("intern: ~s no such package"), package, nao);
+ package = p;
}
type_check (package, PKG);