Expose local phase levels to rules
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- tooling
Direzione di ricerca
Inizia esaminando l’attuale hook dell’observer dell’espansione di Resyntax e il flusso di analisi del sorgente, concentrandoti su come vengono rappresentate le visite e su come le regole ottengono le informazioni sulla fase. L’issue suggerisce di esporre alle regole un livello di fase locale; il completamento dovrebbe includere il refactoring riuscito dell’esempio begin-for-syntax, preservando il comportamento della fase 0.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This rule:
(define-refactoring-rule redundant-or
#:description "This `or` expression does nothing and can be replaced with its subexpression."
#:literals (or)
(or a1:id a2:id)
#:when (free-identifier=? #'a1 #'a2)
a1)
Fails to refactor this code:
(begin-for-syntax
(define x 42)
(or x x))
The reason for that is that free-identifier=? checks if two identifiers have the same binding at a specific phase level, and by default it uses (syntax-local-phase-level). This is reasonable for macros, which set (syntax-local-phase-level) to the level of the macro invocation. But refactoring rules aren't run during macro expansion, so (syntax-local-phase-level) always returns zero. This lets free-identifier=? in rules work fine on phase 0 code, but it fails on phase 1 code such as code inside begin-for-syntax.
Resyntax ought to expose the local phase level to rules. I'm not sure how to get that information out of the expander using the current expansion observer hook, but it's probably possible. One way to expose it to rules might be to add a (resyntax-local-phase-level) parameter and let rules use that to access the phase level. On the Resyntax source analysis side, there could be an expansion-visit struct / record type containing the syntax object that the expander visited and the phase level the visit occurred at.
- Lingua principale
- Racket
- Stelle
- 70
- Fork
- 11
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jackfirth/resyntax
-
Grimoire docs need examples Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
documentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
testing
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
-
testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
Tutte le issue di jackfirth/resyntax
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
vercel-labs/just-bash#464 ·
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/safe-publish#594 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug feat:crypto feat:utils
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100