Used backport-template-pr1514

This commit is contained in:
Georges Dupéron 2016-11-10 17:45:15 +01:00
parent 75703ac933
commit a103d48aaf
3 changed files with 15 additions and 10 deletions

View File

@ -9,7 +9,8 @@
"scribble-enhanced"
"typed-racket-lib"
"srfi-lite-lib"
"delay-pure"))
"delay-pure"
"backport-template-pr1514"))
(define build-deps '("scribble-lib"
"racket-doc"
"remember"

View File

@ -3,8 +3,9 @@
phc-toolkit/untyped
racket/stxparam
syntax/parse
syntax/parse/experimental/template
syntax/parse/experimental/private/substitute
backport-template-pr1514/experimental/template
;syntax/parse/experimental/template
;syntax/parse/experimental/private/substitute
syntax/id-table
racket/syntax
(for-syntax "patch-arrows.rkt"
@ -23,7 +24,7 @@
(provide (rename-out [new-syntax-parse syntax-parse]
[new-syntax-parser syntax-parser]
[new-syntax-case syntax-case])
define-unhygienic-template-metafunction
;define-unhygienic-template-metafunction
subtemplate
quasisubtemplate)
@ -319,6 +320,7 @@
(derived)))))
#|
(require syntax/parse/experimental/private/substitute)
;; Not very clean, but syntax/parse/experimental/template should export it :-(
(define (stolen-current-template-metafunction-introducer)
@ -348,4 +350,5 @@
[mark (make-syntax-delta-introducer (+normal #'self 'flip)
zero)]
[,#'stx (syntax-local-introduce (mark ,#'tmp-stx 'flip))])
(mark (syntax-local-introduce (let () . ,#'code))))])))]))
(mark (syntax-local-introduce (let () . ,#'code))))])))]))
|#

View File

@ -151,10 +151,10 @@ not expressed syntactically using the @racket[Foo] identifier.
@CHUNK[<define-fold>
(begin-for-syntax
(define-unhygienic-template-metafunction (replace-in-type stx)
(define-template-metafunction (replace-in-type stx)
(syntax-case stx ()
[(_ _whole-type [_type-to-replaceᵢ _Tᵢ] )
#`(#,(syntax-local-introduce
#`(#,(syntax-local-template-metafunction-introduce
(fold-type #'(_whole-type _type-to-replaceᵢ ))) _Tᵢ )])))]
@CHUNK[<define-fold>
@ -191,10 +191,10 @@ not expressed syntactically using the @racket[Foo] identifier.
@CHUNK[<define-fold>
(begin-for-syntax
(define-unhygienic-template-metafunction (replace-in-instance stx)
(define-template-metafunction (replace-in-instance stx)
(syntax-case stx ()
[(_ _whole-type [_type-to-replaceᵢ _predicateᵢ _updateᵢ] )
#`(#,(syntax-local-introduce
#`(#,(syntax-local-template-metafunction-introduce
(fold-f #'(_whole-type _type-to-replaceᵢ )))
{?@ _predicateᵢ _updateᵢ} )])))]
@ -378,7 +378,8 @@ where @racket[foldl-map] is defined as:
(subtract-in (combine-in racket/base
syntax/parse)
"subtemplate-override.rkt")
syntax/parse/experimental/template
;syntax/parse/experimental/template
backport-template-pr1514/experimental/template
phc-toolkit/untyped
racket/syntax
type-expander/expander