racket/collects/web-server/dispatch/bidi-match.ss
Eli Barzilay a70bf64fd9 Newlines at EOFs
svn: r15380
2009-07-04 02:28:31 +00:00

20 lines
585 B
Scheme

#lang scheme
(require scheme/stxparam)
(define-syntax-parameter bidi-match-going-in? #t)
(define-syntax (define-bidi-match-expander stx)
(syntax-case stx ()
[(_ bidi-id in-expander out-expander)
(syntax/loc stx
(define-match-expander bidi-id
(lambda (stx)
(syntax-case stx ()
[(_ id)
(if (syntax-parameter-value #'bidi-match-going-in?)
(syntax/loc stx (in-expander id))
(syntax/loc stx (out-expander id)))]))))]))
(provide bidi-match-going-in?
define-bidi-match-expander)