Include this extension in the PHP core and provide a hook API
まだ誰も着手していません。
評価
調査の方向性
提案されている register_parser_extension 関数と、process(Node $node) メソッドを持つ ParserExtensionInterface をレビューし、その後、issue に記載されている Source Code → Tokenizer → AST → Engine hooks → Compiler のフローを追跡します。実装前に PHP-core との統合と hook の動作を定義します。完了の条件は、API が確定し、userland 拡張が opcode 生成前に AST ノードを変換できることです。
索引モデルが issue の本文から書いたものです。
説明
I want to suggest to include this extension into the core to provide an API for miscellaneous userland extensions. Main idea is to give a userland code control over the produced source-code.
Chain is following: Source Code => Tokenizer => AST => Engine hooks+PHP userland hooks => Compiler => Opcodes => Execution
Why it can be a great thing: native source-code AST (static analyzers, code beautifiers), language extensions (AOP, DbC, SQL-like native syntax).
This requires to create an userland-function, probably, register_parser_extension(ParserExtensionInterface $extension) that will add an extension as parser hook.
Next additional thing is ParserExtensionInterface interface with process(Node $node) method that will receive ast\Node class and should return a modified node or tree.
Each registered extension will be called consequently, allowing to transform the source code. Last result will be used by compiler to generate final version of opcodes.
- 主要言語
- PHP
- スター
- 983
- フォーク
- 81
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nikic/php-ast のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getgrav/grav-plugin-sitemap#125 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nikic/PHP-Parser#1184 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
shukiv/jabali-panel#2474 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100