From d33149d20b3a3b37d6379083920a62d2b0ec5cec Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Mon, 28 Mar 2022 18:01:04 -0700 Subject: [PATCH] Use `syntax-parse` in `support.rkt` --- support.rkt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/support.rkt b/support.rkt index 440006e..49178cd 100755 --- a/support.rkt +++ b/support.rkt @@ -1,9 +1,9 @@ #lang racket/base -(require yaragg/parser-tools/lex +(require (for-syntax racket/base + syntax/parse) + yaragg/parser-tools/lex racket/string - racket/struct - (prefix-in : yaragg/parser-tools/lex-sre) - (for-syntax racket/base)) + (prefix-in : yaragg/parser-tools/lex-sre)) (provide (all-from-out yaragg/parser-tools/lex) (all-from-out yaragg/parser-tools/lex-sre) [struct-out token-struct] @@ -107,23 +107,23 @@ (provide from/to) (define-lex-trans from/to - (λ(stx) - (syntax-case stx () + (λ (stx) + (syntax-parse stx [(_ OPEN CLOSE) #'(:seq (from/stop-before OPEN CLOSE) CLOSE)]))) (provide from/stop-before) (define-lex-trans from/stop-before - (λ(stx) - (syntax-case stx () + (λ (stx) + (syntax-parse stx [(_ OPEN CLOSE) ;; (:seq any-string CLOSE any-string) pattern makes it non-greedy #'(:seq OPEN (complement (:seq any-string CLOSE any-string)))]))) (provide uc+lc) (define-lex-trans uc+lc - (λ(stx) - (syntax-case stx () + (λ (stx) + (syntax-parse stx [(_ . STRS) (with-syntax ([(UCSTR ...) (map (compose1 string-upcase syntax->datum) (syntax->list #'STRS))] [(LCSTR ...) (map (compose1 string-downcase syntax->datum) (syntax->list #'STRS))])