aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Court`es2006-02-15 08:46:55 +0000
committerLudovic Court`es2006-02-15 08:46:55 +0000
commitbb63cc24d8ea38bc645c38cb7c44edf33b220bee (patch)
treefbb0b5e813c391bf5f97af857142b96d9954dc95
parentc7f820101026526e4d0d72ba4999a1b0fa9ebbb8 (diff)
downloadskribilo-bb63cc24d8ea38bc645c38cb7c44edf33b220bee.tar.gz
skribilo-bb63cc24d8ea38bc645c38cb7c44edf33b220bee.tar.lz
skribilo-bb63cc24d8ea38bc645c38cb7c44edf33b220bee.zip
Skribe reader: consider square brackets as delimiters.
* src/guile/skribilo/reader/skribe.scm (%make-skribe-reader): Use the `r6rs-keyword-*' and `r6rs-number' token readers so that square brackets are rightfully considered as delimiters. git-archimport-id: lcourtes@laas.fr--2004-libre/skribilo--devel--1.2--patch-45
-rw-r--r--src/guile/skribilo/reader/skribe.scm21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/guile/skribilo/reader/skribe.scm b/src/guile/skribilo/reader/skribe.scm
index f24c2f7..f92f13b 100644
--- a/src/guile/skribilo/reader/skribe.scm
+++ b/src/guile/skribilo/reader/skribe.scm
@@ -65,25 +65,18 @@ the Skribe syntax."
(let ((colon-keywords ;; keywords à la `:key' fashion
(r:make-token-reader #\:
(r:token-reader-procedure
- (r:standard-token-reader 'keyword))))
- (square-bracket-free-symbol-misc-chars
- (let* ((tr (r:standard-token-reader 'guile-symbol-misc-chars))
- (tr-spec (r:token-reader-specification tr))
- (tr-proc (r:token-reader-procedure tr)))
- (r:make-token-reader (filter (lambda (chr)
- (not (or (eq? chr #\[)
- (eq? chr #\]))))
- tr-spec)
- tr-proc))))
+ (r:standard-token-reader 'keyword)))))
+ ;; Note: we use the `r6rs-symbol-*' and `r6rs-number' token readers since
+ ;; they consider square brackets as delimiters.
(r:make-reader (cons* (r:make-token-reader #\# &sharp-reader)
colon-keywords
- square-bracket-free-symbol-misc-chars
(map r:standard-token-reader
`(whitespace
- sexp string guile-number
- guile-symbol-lower-case
- guile-symbol-upper-case
+ sexp string r6rs-number
+ r6rs-symbol-lower-case
+ r6rs-symbol-upper-case
+ r6rs-symbol-misc-chars
quote-quasiquote-unquote
semicolon-comment
skribe-exp)))