Tried to document with scribble/example, but it turns out the order is not reliable for ~global
This commit is contained in:
parent
9604795055
commit
cedb955313
|
@ -1,10 +1,16 @@
|
||||||
#lang scribble/manual
|
#lang scribble/manual
|
||||||
@require[@for-label[phc-toolkit/untyped
|
@require[scribble/example
|
||||||
|
@for-label[phc-toolkit/untyped
|
||||||
extensible-parser-specifications
|
extensible-parser-specifications
|
||||||
generic-syntax-expanders
|
generic-syntax-expanders
|
||||||
racket/base
|
racket/base
|
||||||
|
syntax/parse
|
||||||
(only-in racket/base [... …])]]
|
(only-in racket/base [... …])]]
|
||||||
|
|
||||||
|
@(define make-evaluator
|
||||||
|
(make-eval-factory '(syntax/parse
|
||||||
|
extensible-parser-specifications)))
|
||||||
|
|
||||||
@title{extensible-parser-specifications}
|
@title{extensible-parser-specifications}
|
||||||
@author{@author+email["Georges Dupéron" "georges.duperon@gmail.com"]}
|
@author{@author+email["Georges Dupéron" "georges.duperon@gmail.com"]}
|
||||||
|
|
||||||
|
@ -286,9 +292,10 @@ the notion of order irrelevant.
|
||||||
value within any @racket[valueᵢ] group is @racket[#f], then the
|
value within any @racket[valueᵢ] group is @racket[#f], then the
|
||||||
@racket[_attribute-name] is bound to @racket[#f].
|
@racket[_attribute-name] is bound to @racket[#f].
|
||||||
|
|
||||||
For example, the following code produces @racket[6]:
|
@examples[
|
||||||
|
#:eval (make-evaluator)
|
||||||
@racketblock[
|
#:once
|
||||||
|
#:label "For example, the following code produces 6:"
|
||||||
(syntax-parse #'(1 ya (2 3) 4 yb (5 6) yc 7)
|
(syntax-parse #'(1 ya (2 3) 4 yb (5 6) yc 7)
|
||||||
[(~no-order {~and x:id {~global-and [g (syntax-e #'x)]}}
|
[(~no-order {~and x:id {~global-and [g (syntax-e #'x)]}}
|
||||||
{~global-and [g (syntax-e #'y)] y:number}
|
{~global-and [g (syntax-e #'y)] y:number}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user