Changing from stxclass to syntax/parse.

svn: r15979
This commit is contained in:
Stevie Strickland 2009-09-11 19:47:27 +00:00
parent c7255c9daf
commit 538cc8862f
3 changed files with 16 additions and 6 deletions

View File

@ -1,7 +1,8 @@
#lang scheme/base
(require stxclass
(require syntax/parse
"unit-compiletime.ss"
"unit-keywords.ss"
(for-template "unit-keywords.ss"))
(provide import-clause/contract export-clause/contract dep-clause
@ -10,9 +11,9 @@
(define-syntax-class sig-id
#:attributes ()
(pattern x
#:declare x (static-of 'signature
(λ (x)
(signature? (set!-trans-extract x))))))
#:declare x (static (λ (x)
(signature? (set!-trans-extract x)))
'signature)))
(define-syntax-class sig-spec #:literals (prefix rename only except)
#:attributes ((name 0))
@ -28,6 +29,7 @@
#:with name #'s.name))
(define-syntax-class tagged-sig-spec #:literals (tag)
#:auto-nested-attributes
#:transparent
(pattern s:sig-spec
#:with i #f)
@ -40,30 +42,37 @@
(pattern (tag i:identifier s:sig-id)))
(define-syntax-class unit/c-clause
#:auto-nested-attributes
#:transparent
(pattern (s:tagged-sig-id [x:identifier c:expr] ...))
(pattern s:tagged-sig-id ;; allow a non-wrapped sig, which is the same as (sig)
#:with (x ...) null
#:with (c ...) null))
(define-syntax-class import-clause/c #:literals (import)
#:auto-nested-attributes
#:transparent
(pattern (import i:unit/c-clause ...)))
(define-syntax-class export-clause/c #:literals (export)
#:auto-nested-attributes
#:transparent
(pattern (export e:unit/c-clause ...)))
(define-syntax-class unit/contract-clause
#:auto-nested-attributes
#:transparent
(pattern (s:tagged-sig-spec [x:identifier c:expr] ...))
(pattern s:tagged-sig-spec ;; allow a non-wrapped sig, which is the same as (sig)
#:with (x ...) null
#:with (c ...) null))
(define-syntax-class import-clause/contract #:literals (import)
#:auto-nested-attributes
#:transparent
(pattern (import i:unit/contract-clause ...)))
(define-syntax-class export-clause/contract #:literals (export)
#:auto-nested-attributes
#:transparent
(pattern (export e:unit/contract-clause ...)))
(define-syntax-class dep-clause #:literals (init-depend)
#:auto-nested-attributes
#:transparent
(pattern (init-depend s:tagged-sig-id ...)))

View File

@ -1,12 +1,13 @@
#lang scheme/base
(require (for-syntax scheme/base
stxclass
syntax/boundmap
syntax/name
syntax/parse
"unit-compiletime.ss"
"unit-contract-syntax.ss"
"unit-syntax.ss")
(for-meta 2 scheme/base)
scheme/contract
"unit-utils.ss"
"unit-runtime.ss")

View File

@ -1,10 +1,10 @@
(module unit mzscheme
(require-for-syntax mzlib/list
stxclass
syntax/boundmap
syntax/context
syntax/kerncase
syntax/name
syntax/parse
syntax/struct
syntax/stx
"private/unit-contract-syntax.ss"