resyntax
resyntax copied to clipboard
Refactor `~and` with literal to colon notation
I recently learned that in syntax-parse, literals can be used with colon notation just like syntax classes. There ought to be a refactoring rule for this since I'm sure it's come up in tons of macros I've written. Note that implementing this requires #369 to work properly.
#lang resyntax/test
--------------------
#lang racket
(require syntax/parse)
(syntax-parse #'void
#:literals (void)
[(~and void-id void)
#'void-id])
--------------------
--------------------
#lang racket
(require syntax/parse)
(syntax-parse #'void
#:literals (void)
[void-id:void
#'void-id])
--------------------