Skip to content

Commit 1010b0e

Browse files
committed
Provide compiler hook for altering the AST pre-compilation.
1 parent 1fdd558 commit 1010b0e

File tree

4 files changed

+361
-344
lines changed

4 files changed

+361
-344
lines changed

Zend/zend_ast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "zend_API.h"
2424
#include "zend_operators.h"
2525

26+
ZEND_API zend_ast_process_t zend_ast_process = NULL;
27+
2628
static inline void *zend_ast_alloc(size_t size) {
2729
return zend_arena_alloc(&CG(ast_arena), size);
2830
}

Zend/zend_ast.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ typedef struct _zend_ast_decl {
186186
zend_ast *child[3];
187187
} zend_ast_decl;
188188

189+
typedef void (*zend_ast_process_t)(zend_ast *ast);
190+
extern zend_ast_process_t zend_ast_process;
191+
189192
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
190193

191194
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);

0 commit comments

Comments
 (0)