Like syntax-parse does here:
#lang racket
(require (for-syntax syntax/parse))
(define-syntax (m stx)
(syntax-parse stx
#:literals (els)
[(_ else)
#''TODO]))
(m els)
;; => syntax-parse: literal is unbound in phase 0 (phase 0 relative to the enclosing module) in: els
Unfortunately syntax-parse doesn't do this for ~literal patterns which is what we are using, so we may not be able to just re-use the behavior from syntax-parse. But we can go look at how Ryan implements it.
Like syntax-parse does here:
Unfortunately syntax-parse doesn't do this for ~literal patterns which is what we are using, so we may not be able to just re-use the behavior from syntax-parse. But we can go look at how Ryan implements it.