www

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

test-scopes-mixin-in-syntax-parser.rkt (530B)


      1 #lang racket
      2 (require phc-toolkit/untyped
      3          extensible-parser-specifications
      4          syntax/parse
      5          rackunit)
      6 
      7 (define-eh-alternative-mixin props-mixin
      8   (pattern
      9    (~optional (~seq #:foo bar))))
     10 
     11 (define test
     12   (syntax-parser
     13     [(~no-order {~mixin props-mixin})
     14      (attribute bar)]))
     15 
     16 (test-equal?
     17  "Without the bugfix, the pattern variable \"bar\" above had the wrong scopes,
     18 and couldn't be used with (attribute bar), and #'bar just gave #'bar instead of
     19 producing #'42"
     20  (syntax-e (test #'(#:foo 42)))
     21  42)