resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

Refactor `~and` with literal to colon notation

Open jackfirth opened this issue 1 year ago • 0 comments

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])
--------------------

jackfirth avatar Oct 16 '24 19:10 jackfirth