syntax/parse template: update docs
This commit is contained in:
parent
532b322896
commit
e61d8aa1b2
|
@ -3,7 +3,8 @@
|
||||||
scribble/struct
|
scribble/struct
|
||||||
scribble/decode
|
scribble/decode
|
||||||
scribble/eval
|
scribble/eval
|
||||||
"parse-common.rkt")
|
"parse-common.rkt"
|
||||||
|
(for-label syntax/datum))
|
||||||
|
|
||||||
@(define the-eval (make-sp-eval))
|
@(define the-eval (make-sp-eval))
|
||||||
|
|
||||||
|
@ -302,6 +303,12 @@ with optional terms and splicing sequences of terms. Only the
|
||||||
additional forms are described here; see @racket[syntax] for
|
additional forms are described here; see @racket[syntax] for
|
||||||
descriptions of pattern variables, etc.
|
descriptions of pattern variables, etc.
|
||||||
|
|
||||||
|
As in @racket[syntax], a template can be ``escaped'' with ellipses,
|
||||||
|
like @racket[(... _escaped-tmpl)]. Within the escaped template,
|
||||||
|
ellipses (@racket[...]), the @racket[??] and @racket[?@] forms, and
|
||||||
|
metafunctions are treated as constants rather than interpreted as
|
||||||
|
template forms.
|
||||||
|
|
||||||
@specsubform[#:literals (??)
|
@specsubform[#:literals (??)
|
||||||
(?? tmpl alt-tmpl)]{
|
(?? tmpl alt-tmpl)]{
|
||||||
|
|
||||||
|
@ -446,4 +453,23 @@ the context above; instead, @racket[let-values] would report an
|
||||||
invalid binding list.
|
invalid binding list.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@deftogether[[
|
||||||
|
@defform[(template/loc loc-expr tmpl)]
|
||||||
|
@defform[(quasitemplate tmpl)]
|
||||||
|
@defform[(quasitemplate/loc loc-expr tmpl)]
|
||||||
|
]]{
|
||||||
|
|
||||||
|
Like @racket[syntax/loc], @racket[quasisyntax], and
|
||||||
|
@racket[quasisyntax/loc], respectively, but with the additional
|
||||||
|
features of @racket[template].
|
||||||
|
}
|
||||||
|
|
||||||
|
@defform[(datum-template tmpl)]{
|
||||||
|
|
||||||
|
Like @racket[datum] but with some of the additional features of
|
||||||
|
@racket[template]: @racket[?@] and @racket[??] are supported (although
|
||||||
|
@racket[??] is useless, since @racket[datum-case] cannot bind
|
||||||
|
``absent'' variables), but template metafunctions are not allowed.
|
||||||
|
}
|
||||||
|
|
||||||
@(close-eval the-eval)
|
@(close-eval the-eval)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user