Question: How to walk/visit the AST?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia dal punto di ingresso rustpython_parser::parse e dalle istruzioni AST in body. Controlla nei pacchetti RustPython se esiste già un’API di visitor o traversal dell’AST e verifica se può raggiungere gli import annidati nelle definizioni di funzioni e classi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'm trying to extract all the imports from a python file. To do this I'm using the rustpython_parser::parse function to get an AST and then iterating over all the statements in the body to find Stmt::Import and Stmt::ImportFrom. This works for imports defined at the root of the file, however misses any imports defined inside e.g. function/class definitions etc. So I think what I really want to do is walk the AST and visit all the nodes. Is there some way to achieve this with one of the rustpython packages?
- Lingua principale
- Rust
- Stelle
- 117
- Fork
- 38
- Merge medio
- 4g 7h
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 RustPython/Parser
-
Maintenance status Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 25/100
RustPython/Parser#140 · 3 commenti ·
-
`unic` is unmaintained Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
RustPython/Parser#139 · 3 commenti ·
-
cargo audit paste Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
RustPython/Parser#137 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
RustPython/Parser#133 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
RustPython/Parser#130 ·
Tutte le issue di RustPython/Parser
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MystenLabs/sui#28056 · 1 commento ·
-
type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Luminous-Dynamics/mycelix#2577 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
registrystack/registry-stack#1239 ·
-
package-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
msys2/MINGW-packages#31806 ·