RustPython / RustPython/Parser
Question: How to walk/visit the AST?
まだ誰も着手していません。
- 主要言語
- Rust
- スター
- 117
- フォーク
- 38
- 平均マージ
- 4日 7時間
- マージ済み PR(30日)
- 1
説明
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?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
rustpython_parser::parse エントリポイントと body 内の AST 文から始めます。RustPython パッケージに既存の AST visitor または traversal API があるか確認し、それで関数定義やクラス定義内にネストされた import に到達できるか確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python, rust
- 領域
- compilers, tooling
- issue の種類
- ドキュメント
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100