-
-
Save dys-bigwig/a55f81bb9a26d0766ff7069371f83e9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-for-syntax (char-ci char) | |
`(union ,(char-upcase char) | |
,(char-downcase char))) | |
(define-for-syntax (string-ci str) | |
`(concatenation ,@(map char-ci (string->list str)))) | |
(define-lex-trans :char-ci (λ (stx) | |
(match (syntax->datum stx) | |
[(list :char-ci char) (datum->syntax stx (char-ci char))]))) | |
(define-lex-trans :string-ci (λ (stx) | |
(match (syntax->datum stx) | |
[(list :string-ci str) (datum->syntax stx (string-ci str))]))) | |
(define-lex-trans :strings-ci (λ (stx) | |
(match (syntax->datum stx) | |
[(list :strings-ci ss ..1) (datum->syntax stx `(union ,@(map string-ci ss)))]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment