Fixed bug 163714: read/write invariance problem with symbols

This commit is contained in:
Abdulaziz Ghuloum 2007-11-19 02:00:26 -05:00
parent 9ff795e02f
commit 8dffa9cf23
1 changed files with 8 additions and 8 deletions

View File

@ -72,6 +72,7 @@
[(delimiter? c)
(unread-char c p)
ls]
[(char=? c #\\) (tokenize-backslash ls p)]
[else
(unread-char c p)
(error 'tokenize "invalid identifier syntax"
@ -786,11 +787,11 @@
[else (tokenize-bar p (cons c ac))]))]
[($char= #\| c) ac]
[else (tokenize-bar p (cons c ac))]))))
(define (tokenize-backslash p)
(define (tokenize-backslash main-ac p)
(let ([c (read-char p)])
(cond
[(eof-object? c)
(error 'tokenize "invalid eof after \\")]
(error 'tokenize "invalid eof after symbol escape")]
[($char= #\x c)
(let ([c (read-char p)])
(cond
@ -806,11 +807,7 @@
(format "invalid eof after ~a"
(list->string (reverse ac))))]
[($char= #\; c)
(cons 'datum
(string->symbol
(list->string
(cons (integer->char v)
(reverse (tokenize-identifier '() p))))))]
(tokenize-identifier (cons (integer->char v) main-ac) p)]
[(hex c) =>
(lambda (v0)
(f (+ (* v 16) v0) (cons c ac)))]
@ -887,7 +884,10 @@
(let ([ls (reverse (tokenize-bar p '()))])
(cons 'datum (string->symbol (list->string ls))))]
[($char= #\\ c)
(tokenize-backslash p)]
(cons 'datum
(string->symbol
(list->string
(reverse (tokenize-backslash '() p)))))]
[else
(unread-char c p)
(error 'tokenize "invalid syntax" c)])))