~ chicken-core (chicken-5) ab2055df9d690bd09e8e5d9e8b772b4be446204c
commit ab2055df9d690bd09e8e5d9e8b772b4be446204c
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Apr 11 06:09:13 2011 -0400
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Mon Apr 11 06:09:13 2011 -0400
give read-error on empty #: keyword syntax, escape #: properly, when converted to symbol (still doesn't handle |#:| properly, due to #332)
diff --git a/library.scm b/library.scm
index 4e7a6f6b..1872f3cc 100644
--- a/library.scm
+++ b/library.scm
@@ -2683,7 +2683,9 @@ EOF
(##sys#intern-symbol tok) )
(define (build-keyword tok)
- (##sys#intern-symbol (##sys#string-append kwprefix tok)) )
+ (if (eq? 0 (##sys#size tok))
+ (##sys#read-error port "empty keyword")
+ (##sys#intern-symbol (##sys#string-append kwprefix tok)) ))
; now have the state to make a decision.
(set! reserved-characters
@@ -3097,7 +3099,8 @@ EOF
(eq? c #\.) )
(not (##sys#string->number str)) )
((and (eq? c #\#)
- (not (eq? #\% (##core#inline "C_subchar" str 1))))
+ (or (not (eq? #\% (##core#inline "C_subchar" str 1)))
+ (eq? #\: (##core#inline "C_subchar" str 1))))
#f)
((specialchar? c) #f)
(else #t) ) )
Trap