diff options
Diffstat (limited to 'Zend/zend_language_parser.y')
-rw-r--r-- | Zend/zend_language_parser.y | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 908ac143c1..2c508a59fe 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -327,30 +327,35 @@ top_statement: { $$ = zend_ast_create(ZEND_AST_NAMESPACE, NULL, $4); } | T_USE mixed_group_use_declaration ';' { $$ = $2; } | T_USE use_type group_use_declaration ';' { $$ = $3; $$->attr = $2; } - | T_USE use_declarations ';' { $$ = $2; $$->attr = T_CLASS; } + | T_USE use_declarations ';' { $$ = $2; $$->attr = ZEND_SYMBOL_CLASS; } | T_USE use_type use_declarations ';' { $$ = $3; $$->attr = $2; } | T_CONST const_list ';' { $$ = $2; } ; use_type: - T_FUNCTION { $$ = T_FUNCTION; } - | T_CONST { $$ = T_CONST; } + T_FUNCTION { $$ = ZEND_SYMBOL_FUNCTION; } + | T_CONST { $$ = ZEND_SYMBOL_CONST; } ; group_use_declaration: - namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' + namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4); } - | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' + | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $2, $5); } ; mixed_group_use_declaration: - namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' + namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $1, $4);} - | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' + | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { $$ = zend_ast_create(ZEND_AST_GROUP_USE, $2, $5); } ; +possible_comma: + /* empty */ + | ',' +; + inline_use_declarations: inline_use_declarations ',' inline_use_declaration { $$ = zend_ast_list_add($1, $3); } @@ -373,7 +378,7 @@ use_declarations: ; inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->attr = T_CLASS; } + unprefixed_use_declaration { $$ = $1; $$->attr = ZEND_SYMBOL_CLASS; } | use_type unprefixed_use_declaration { $$ = $2; $$->attr = $1; } ; @@ -1030,7 +1035,7 @@ function_call: class_name: T_STATIC - { zval zv; ZVAL_INTERNED_STR(&zv, CG(known_strings)[ZEND_STR_STATIC]); + { zval zv; ZVAL_INTERNED_STR(&zv, ZSTR_KNOWN(ZEND_STR_STATIC)); $$ = zend_ast_create_zval_ex(&zv, ZEND_NAME_NOT_FQ); } | name { $$ = $1; } ; @@ -1370,4 +1375,6 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr) * c-basic-offset: 4 * indent-tabs-mode: t * End: + * vim600: sw=4 ts=4 fdm=marker + * vim<600: sw=4 ts=4 */ |