Home
last modified time | relevance | path

Searched refs:ast (Results 1 – 25 of 104) sorted by relevance

12345

/php-ast/
H A Dutil.php3 use ast\flags;
14 foreach (ast\get_metadata() as $data) {
58 if ($ast instanceof ast\Node) {
59 $result = ast\get_kind_name($ast->kind);
62 $result .= " @ $ast->lineno";
68 … if ((ast\kind_uses_flags($ast->kind) && !is_combinable_flag($ast->kind)) || $ast->flags != 0) {
69 $result .= "\n flags: " . format_flags($ast->kind, $ast->flags);
78 } else if ($ast === null) {
80 } else if (is_string($ast)) {
81 return "\"$ast\"";
[all …]
H A DREADME.md1 php-ast
47 * `ast\Node` class
66 $ast = ast\parse_code('<?php ...', $version=100);
68 $ast = ast\parse_file('file.php', $version=100);
75 namespace ast;
198 namespace ast;
231 // Used by ast\AST_METHOD, ast\AST_PROP_DECL, ast\AST_PROP_GROUP,
232 // ast\AST_CLASS_CONST_DECL, ast\AST_CLASS_CONST_GROUP, and ast\AST_TRAIT_ALIAS (combinable)
241 // Used by ast\AST_CLOSURE, ast\AST_ARROW_FUNC (combinable)
244 // Used by ast\AST_FUNC_DECL, ast\AST_METHOD, ast\AST_CLOSURE, ast\AST_ARROW_FUNC (combinable)
[all …]
H A Dconfig.m41 dnl config.m4 for extension ast
3 PHP_ARG_ENABLE(ast, whether to enable ast support,
4 [ --enable-ast Enable ast support])
7 PHP_NEW_EXTENSION(ast, ast.c ast_data.c, $ext_shared)
H A Dconfig.w323 ARG_ENABLE("ast", "enable ast support", "no");
6 EXTENSION("ast", "ast.c ast_data.c");
H A Dast.c375 zend_ast *ast; in get_ast() local
379 return ast; in get_ast()
385 zend_ast *ast; in get_ast()
405 ast = CG(ast); in get_ast()
413 return ast; in get_ast()
440 if (!ast) { in ast_is_name()
547 if (ast && ast->kind == ZEND_AST_STMT_LIST) { in ast_should_normalize_list()
939 ast->attr = ast_assign_op_to_binary_op(ast->attr); in ast_to_zval()
979 ast->child[0]->attr = ast->attr; in ast_to_zval()
1230 if (!ast) { in PHP_FUNCTION()
[all …]
H A Dast.stub.php14 namespace ast; namespace
19 function parse_code(string $code, int $version, string $filename = 'string code'): \ast\Node {}
21 function parse_file(string $filename, int $version): \ast\Node {}
H A Dphp_ast.h24 ZEND_BEGIN_MODULE_GLOBALS(ast) in ZEND_BEGIN_MODULE_GLOBALS() argument
26 ZEND_END_MODULE_GLOBALS(ast)
28 ZEND_EXTERN_MODULE_GLOBALS(ast)
30 #define AST_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(ast, v)
/php-ast/tests/
H A Dget_kind_name.phpt2 Test ast\get_kind_name()
6 var_dump(ast\get_kind_name(ast\AST_VAR));
7 var_dump(ast\get_kind_name(ast\AST_NAME));
8 var_dump(ast\get_kind_name(ast\AST_CLOSURE_VAR));
11 var_dump(ast\get_kind_name(12345));
H A Dzpp_errors.phpt6 try { ast\parse_code(); }
8 try { ast\parse_file(); }
10 try { ast\get_kind_name(); }
12 try { ast\kind_uses_flags(); }
17 ast\parse_code() expects at least 1 %s, 0 given
18 ast\parse_file() expects at least 1 %s, 0 given
19 ast\get_kind_name() expects exactly 1 %s, 0 given
20 ast\kind_uses_flags() expects exactly 1 %s, 0 given
H A Dconstructor.phpt2 ast\Node has a __construct method
10 var_dump(new \ast\Node());
14 var_dump(new \ast\Node(null, null, null, null));
17 echo ast_dump(new \ast\Node(\ast\AST_NAME, 1, ['name' => 'FOO'], 2), AST_DUMP_LINENOS) . "\n";
22 object(ast\Node)#1 (4) {
32 object(ast\Node)#1 (4) {
H A Dparse_file.phpt2 ast\parse_file() on valid file
8 $ast = ast\parse_file(__DIR__ . '/valid_file.php', $version=70);
9 echo ast_dump($ast);
H A Dempty_file_parse.phpt2 ast\parse_file() with empty file
7 $file = ast\parse_file(__DIR__ . '/empty_file.php', $version=70);
8 var_dump($file instanceof ast\Node);
10 $file = ast\parse_code('', $version=70);
11 var_dump($file instanceof ast\Node);
H A Ddecl_normalization.phpt2 The class ast\Node\Decl no longer exists
29 $ast = ast\parse_code($code, $version=70);
30 var_dump(array_map('get_class', $ast->children));
31 echo ast_dump($ast) . "\n";
32 $ast = ast\parse_code($code, $version=50);
33 echo ast_dump($ast) . "\n";
39 string(8) "ast\Node"
41 string(8) "ast\Node"
43 string(8) "ast\Node"
45 string(8) "ast\Node"
[all …]
H A Dphp82_dynamic_property_attribute.phpt22 $node = new ast\Node();
25 $metadata = new ast\Metadata();
28 dump_attributes(ast\Node::class);
29 dump_attributes(ast\Metadata::class);
38 Deprecated: Creation of dynamic property ast\Metadata::$undeclaredDynamic is deprecated in %sphp82_…
46 Attributes of ast\Node:
48 Attributes of ast\Metadata:
H A Dparse_code_parse_error.phpt2 ast\parse_code() throwing a ParseError
9 ast\parse_code($code, 70);
14 ast\parse_code($code, 70, 'file.php');
23 #0 %s(%d): ast\parse_code('%s', %d)
27 #0 %s(%d): ast\parse_code('%s', %d, 'file.php')
H A Dparse_file_not_existing.phpt2 ast\parse_file() on file that does not exist
7 ast\parse_file(__DIR__ . '/non_existing_file.php', $version=70);
14 RuntimeException: ast\parse_file(%stests/non_existing_file.php): %sailed to open stream: No such fi…
16 #0 %s(%d): ast\parse_file('%s', %d)
H A Dget_supported_versions.phpt2 ast\get_supported_versions() function
6 var_dump(ast\get_supported_versions());
7 var_dump(ast\get_supported_versions(true));
H A Dast_dump_with_linenos.phpt5 if (!extension_loaded("ast")) print "skip";
24 $ast = ast\parse_code($code, $version=70);
25 echo ast_dump($ast, AST_DUMP_LINENOS);
H A Dnode_constructor_throw.phpt2 new ast\Node() throwing
4 <?php if (!extension_loaded("ast")) print "skip"; ?>
9 new ast\Node('invalid');
H A Dparse_file_parse_error.phpt2 ast\parse_file() on file with parse error
7 ast\parse_file(__DIR__ . '/invalid_file.php', $version=70);
16 #0 %s(%d): ast\parse_file('%s', %d)
H A Dast_dump_with_exclude_doc.phpt19 $ast = ast\parse_code($code, $version=80);
20 echo ast_dump($ast, AST_DUMP_EXCLUDE_DOC_COMMENT);
H A Dfunctions_dont_use.phpt14 echo ast_dump(ast\parse_code($code, $version=50)), "\n";
15 echo ast_dump(ast\parse_code($code, $version=60)), "\n";
20 Deprecated: ast\parse_code(): Version 50 is deprecated in %s.php on line 11
39 Deprecated: ast\parse_code(): Version 60 is deprecated in %s.php on line 12
H A Dconcat.phpt6 // This tests that php-ast consistently exposes the AST in PHP 7.0-7.4
7 // For https://github.com/nikic/php-ast/issues/123
16 echo ast_dump(ast\parse_code($code, $version=70)), "\n";
H A Dversion_errors.phpt7 ast\parse_code('<?php ...');
13 ast\parse_code('<?php ...', $version=10000);
H A Dphp81_readonly.phpt17 $node = ast\parse_code($code, $version=60);
19 $node = ast\parse_code($code, $version=85);
22 Deprecated: ast\parse_code(): Version 60 is deprecated in %sphp81_readonly.php on line 12

Completed in 38 milliseconds

12345