Include this extension in the PHP core and provide a hook API
还没有人认领这个 Issue。
评估
调研方向
审查提议的 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 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 一周以上 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 83/100
nikic/PHP-Parser#1187 ·
-
15.0
难度 2/5 1-3 小时 新手友好度 68/100
-
needs-triage
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Icinga/icinga-notifications-web#645 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
OpenMage/magento-lts#5865 ·
维护者通常 3 天内回复