glayzzle / glayzzle/php-parser
[feature] implement a visitor & filter helper
Open
AST
feature
good first issue
help wanted
- Dominant language
- JavaScript
- Stars
- 565
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
implement a visitor helper in order to handle AST transversal :
```js
const ast = parser.parse('...some code...');
// visiting child nodes :
ast.visit(function(node) {
// do something
});
// filtering a list of nodes
const nodes = ast.filter(function(node) {
return node.kind === 'something';
});
```
> NOTE : this is implemented on each node, can be used on program node as in the example, or on any other node
Contributor guide
Assessment
This issue has not been assessed yet.