www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

define.rkt (664B)


      1 #lang racket/base
      2 (require (for-syntax racket/base
      3                      stxparse-info/parse
      4                      "private/sc.rkt"))
      5 (provide define-simple-macro
      6          define-syntax-parser
      7          (for-syntax (all-from-out stxparse-info/parse)))
      8 
      9 (define-syntax (define-simple-macro stx)
     10   (syntax-parse stx
     11     [(define-simple-macro (macro:id . pattern) . body)
     12      #`(define-syntax macro
     13          (syntax-parser/template
     14           #,((make-syntax-introducer) stx)
     15           [((~var macro id) . pattern) . body]))]))
     16 
     17 (define-simple-macro (define-syntax-parser macro:id option-or-clause ...)
     18   (define-syntax macro
     19     (syntax-parser option-or-clause ...)))
     20