Skip to content

Commit 1ca15bd

Browse files
committed
Rename some child names
1 parent 51f2183 commit 1ca15bd

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Version changelog
294294
* `AST_GREATER`, `AST_GREATER_EQUAL`, `AST_OR`, `AST_AND` nodes are now represented using
295295
`AST_BINARY_OP` with flags `BINARY_IS_GREATER`, `BINARY_IS_GREATER_OR_EQUAL`, `BINARY_BOOL_OR`
296296
and `BINARY_BOOL_AND`.
297-
* `AST_SILENCE`, `AST_UNARY_MINUS` and `AST_UNARY_PLUS` nodes are noew represented using
297+
* `AST_SILENCE`, `AST_UNARY_MINUS` and `AST_UNARY_PLUS` nodes are now represented using
298298
`AST_UNARY_OP` with flags `UNARY_SILENCE`, `UNARY_MINUS` and `UNARY_PLUS`
299299
* `AST_ASSIGN_OP` now uses `BINARY_*` flags instead of separate `ASSIGN_*` flags.
300300
* `AST_STATIC` and `AST_CATCH` now use an `AST_VAR` node for the static/catch variable. Previously

ast_data.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,15 +631,15 @@ zend_string *ast_kind_child_name(zend_ast_kind kind, uint32_t child) {
631631
case ZEND_AST_CONDITIONAL:
632632
switch (child) {
633633
case 0: return AST_STR(cond);
634-
case 1: return AST_STR(trueExpr);
635-
case 2: return AST_STR(falseExpr);
634+
case 1: return AST_STR(true);
635+
case 2: return AST_STR(false);
636636
}
637637
return NULL;
638638
case ZEND_AST_TRY:
639639
switch (child) {
640-
case 0: return AST_STR(tryStmts);
640+
case 0: return AST_STR(try);
641641
case 1: return AST_STR(catches);
642-
case 2: return AST_STR(finallyStmts);
642+
case 2: return AST_STR(finally);
643643
}
644644
return NULL;
645645
case ZEND_AST_CATCH:

ast_str_defs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
X(insteadof) \
3939
X(alias) \
4040
X(prefix) \
41-
X(trueExpr) \
42-
X(falseExpr) \
43-
X(tryStmts) \
41+
X(true) \
42+
X(false) \
43+
X(try) \
4444
X(catches) \
45-
X(finallyStmts) \
45+
X(finally) \
4646
X(type) \
4747
X(init) \
4848
X(loop) \

generate_ast_data.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
'ZEND_AST_VAR' => ['name'],
6464
'ZEND_AST_CONST' => ['name'],
6565
'ZEND_AST_UNPACK' => ['expr'],
66-
'ZEND_AST_UNARY_PLUS' => ['expr'],
67-
'ZEND_AST_UNARY_MINUS' => ['expr'],
66+
'ZEND_AST_UNARY_PLUS' => ['expr'], // version < 20
67+
'ZEND_AST_UNARY_MINUS' => ['expr'], // version < 20
6868
'ZEND_AST_CAST' => ['expr'],
6969
'ZEND_AST_EMPTY' => ['expr'],
7070
'ZEND_AST_ISSET' => ['var'],
@@ -103,10 +103,10 @@
103103
'ZEND_AST_ASSIGN_REF' => ['var', 'expr'],
104104
'ZEND_AST_ASSIGN_OP' => ['var', 'expr'],
105105
'ZEND_AST_BINARY_OP' => ['left', 'right'],
106-
'ZEND_AST_GREATER' => ['left', 'right'],
107-
'ZEND_AST_GREATER_EQUAL' => ['left', 'right'],
108-
'ZEND_AST_AND' => ['left', 'right'],
109-
'ZEND_AST_OR' => ['left', 'right'],
106+
'ZEND_AST_GREATER' => ['left', 'right'], // version < 20
107+
'ZEND_AST_GREATER_EQUAL' => ['left', 'right'], // version < 20
108+
'ZEND_AST_AND' => ['left', 'right'], // version < 20
109+
'ZEND_AST_OR' => ['left', 'right'], // version < 20
110110
'ZEND_AST_ARRAY_ELEM' => ['value', 'key'],
111111
'ZEND_AST_NEW' => ['class', 'args'],
112112
'ZEND_AST_INSTANCEOF' => ['expr', 'class'],
@@ -133,9 +133,9 @@
133133
/* 3 child nodes */
134134
'ZEND_AST_METHOD_CALL' => ['expr', 'method', 'args'],
135135
'ZEND_AST_STATIC_CALL' => ['class', 'method', 'args'],
136-
'ZEND_AST_CONDITIONAL' => ['cond', 'trueExpr', 'falseExpr'],
136+
'ZEND_AST_CONDITIONAL' => ['cond', 'true', 'false'],
137137

138-
'ZEND_AST_TRY' => ['tryStmts', 'catches', 'finallyStmts'],
138+
'ZEND_AST_TRY' => ['try', 'catches', 'finally'],
139139
'ZEND_AST_CATCH' => ['class', 'var', 'stmts'],
140140
'ZEND_AST_PARAM' => ['type', 'name', 'default'],
141141

0 commit comments

Comments
 (0)