syntax/module-reader: make language name after meta-reader syntax-original?
Thanks to Robby for the test.
This commit is contained in:
parent
7438586cf0
commit
ecd2234d56
13
pkgs/racket-test/tests/syntax/meta-reader-original.rkt
Normal file
13
pkgs/racket-test/tests/syntax/meta-reader-original.rkt
Normal file
|
@ -0,0 +1,13 @@
|
|||
#lang racket/base
|
||||
(define p (open-input-string "#lang at-exp racket/base\n"))
|
||||
(port-count-lines! p)
|
||||
(define stx
|
||||
(parameterize ([read-accept-reader #t]
|
||||
[current-namespace (make-base-namespace)])
|
||||
(expand (read-syntax "x.rkt" p))))
|
||||
(define r/b
|
||||
(syntax-case stx ()
|
||||
[(_1 _2 r/b _3 ...) #'r/b]))
|
||||
(unless (syntax-original? r/b)
|
||||
(error "module name after `at-exp` is not `syntax-original?`"))
|
||||
|
|
@ -260,7 +260,11 @@
|
|||
(datum->syntax #f
|
||||
guarded-spec
|
||||
(vector src spec-line spec-col spec-pos
|
||||
(max 0 (- spec-end-pos spec-pos))))
|
||||
(max 0 (- spec-end-pos spec-pos)))
|
||||
;; get syntax with `syntax-original?` property:
|
||||
(call-with-default-reading-parameterization
|
||||
(lambda ()
|
||||
(read-syntax 'orig (open-input-bytes #"x")))))
|
||||
guarded-spec))
|
||||
(loop (cdr specs))))
|
||||
(bad spec #f))))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user