Modifying AST and generating source code
まだ誰も着手していません。
評価
調査の方向性
Issue で説明されている Prism.parse(text) エントリポイントと Prism::Visitor の使用方法から始めてください。Prism が変更可能な AST トラバーサルまたはソースの再生成をドキュメント化しているか確認し、これらの API を対象とする既存の例やテストを特定してください。サポートされる変換と unparse の動作が定義され、ドキュメント化または実装されて初めて、スコープは完了です。
索引モデルが issue の本文から書いたものです。
説明
Forgive my ignorance but I'm trying to use Prism to modify Ruby source (add nodes) and then regenerate the source to be interpreted. I'm using Prism.parse(text) and then implementing a Prism::Visitor to potentially modify the nodes as they are visited. I assume this is possible but I haven't really seen any examples of it. Finally I would like to 'unparse' the AST back into source code.
The Python equivalent is indeed unparse which is where I'm taking many of the ideas. They also have a NodeTransformer which is allowed to modify the nodes in the visit pattern. I don't see equivalents in Prism but perhaps you're always allowed to modify the nodes ... this is Ruby afterall.
Thanks for any help pointing me in the right direction!
- 主要言語
- C
- スター
- 1k
- フォーク
- 194
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 15
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/prism のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
Revisit comments オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
java
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
java
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
java
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vsanthanam/JBird#429 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
es-ude/OnDeviceTraining#459 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bilelmoussaoui/gobject-linter#199 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bradcypert/plum#53 ·