jackfirth / jackfirth/resyntax

Disappeared visit tracking

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

Nobody has claimed this yet.

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

Description

Resyntax relies on the expander to find what forms it should analyze. This means that macros which circumvent the expander, like for, match, and syntax-parse, can hide forms from Resyntax. This is why Resyntax can't currently refactor (in-range a (add1 b)) to (in-inclusive-range a b) when inside a for clause. Similar issues exist for refactoring match patterns and syntax-parse patterns.

A fix to this would be to extend Racket with a 'disappeared-visit property, similar to the 'disappeared-use property, that macros can attach to syntax objects produced during "manual expansion". Integration with syntax-local-apply-transformer would also be nice. The syntax property should contain the syntax object that the macro manually expanded. In the case of for, that would be the right-hand-side of clauses when they contain sequence transformers. Resyntax can then search for this property in expanded code to find expansion visits that weren't otherwise visible.

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

Start with the issue description and Resyntax's expander-based visit tracking. Investigate Racket's syntax properties, manual expansion in macros such as for, match, and syntax-parse, and syntax-local-apply-transformer; the work is done when Resyntax can find otherwise hidden expansion visits and refactor the described for-clause case.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.