www

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

test-provide.rkt (671B)


      1 #lang racket
      2 
      3 (require polysemy
      4          (for-syntax syntax/parse))
      5 
      6 (provide (poly-out [foo identifier-macro
      7                         my-macro-foo-token
      8                         my-macro2-foo-token])
      9          my-macro
     10          my-macro2)
     11 
     12 (define-poly foo)
     13 (define-poly foo identifier-macro (λ (stx) #'"originally foo"))
     14 
     15 (define-poly-literal foo my-macro-foo-token my-macro-foo-token)
     16 (define-syntax my-macro
     17   (syntax-parser
     18     [(_ a ... :my-macro-foo-token b ...)
     19      #''((a ...) (b ...))]))
     20 
     21 (define-poly foo my-macro2-foo-token #'42)
     22 (define-syntax my-macro2
     23   (syntax-parser
     24     [(_ a ... {~poly x my-macro2-foo-token} b ...)
     25      #''((a ...) x.value (b ...))]))