Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ~and with literal to colon notation #370

Open
jackfirth opened this issue Oct 16, 2024 · 0 comments
Open

Refactor ~and with literal to colon notation #370

jackfirth opened this issue Oct 16, 2024 · 0 comments
Labels
new lint Issues suggesting new lints or pull requests implementing new lints

Comments

@jackfirth
Copy link
Owner

jackfirth commented Oct 16, 2024

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 jackfirth added the new lint Issues suggesting new lints or pull requests implementing new lints label Oct 16, 2024
@jackfirth jackfirth changed the title Refactor ~and with ~literal to colon notation Refactor ~and with literal to colon notation Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new lint Issues suggesting new lints or pull requests implementing new lints
Projects
None yet
Development

No branches or pull requests

1 participant