pull out syntax punctuations too

svn: r15099
This commit is contained in:
Eli Barzilay 2009-06-05 22:19:23 +00:00
parent 62325eb7cf
commit 2104900bb6
2 changed files with 10 additions and 5 deletions

View File

@ -417,12 +417,16 @@
(define (get-rprefixes) ; return punctuation prefixes in reverse (define (get-rprefixes) ; return punctuation prefixes in reverse
(let loop ([r '()]) (let loop ([r '()])
(let-values ([(line col pos) (port-next-location inp)]) (let-values ([(line col pos) (port-next-location inp)])
(cond [(*match1 #rx#"^(?:'|`|,@?)") (cond [(*match1 #rx#"^#?(?:'|`|,@?)")
=> (lambda (m) => (lambda (m)
(let ([sym (cond [(assoc m '([#"'" quote] (let ([sym (cond [(assoc m '([#"'" quote]
[#"`" quasiquote] [#"`" quasiquote]
[#"," unquote] [#"," unquote]
[#",@" unquote-splicing])) [#",@" unquote-splicing]
[#"#'" syntax]
[#"#`" quasisyntax]
[#"#," unsyntax]
[#"#,@" unsyntax-splicing]))
=> cadr] => cadr]
[else (internal-error 'get-rprefixes)])]) [else (internal-error 'get-rprefixes)])])
(loop (cons (datum->syntax #f sym (loop (cons (datum->syntax #f sym

View File

@ -255,6 +255,7 @@ wrapping the @italic{whole} expression.
@scribble-examples|==={ @scribble-examples|==={
@`',@foo{blah} @`',@foo{blah}
@#`#'#,@foo{blah}
}===| }===|
When writing Scheme code, this means that @litchar|{@`',@foo{blah}}| When writing Scheme code, this means that @litchar|{@`',@foo{blah}}|