jackfirth / jackfirth/resyntax

Refactor `~and` with literal to colon notation

Open
#370 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new lint
Dominant language
Racket
Stars
70
Forks
11
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides no file or test path; start with its syntax-parse example and confirm prerequisite issue #369 works correctly. Locate the existing refactoring-rule conventions, then verify that the shown ~and-with-literal form is transformed to the equivalent colon notation without changing behavior.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.