You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to get Parent and Child node while using walk method ? Like for example lets saye 3+4 ; So first pair would be ("Program","ExpressionStatement"). then ("ExpressionStatement","BinaryExpression") .It it possible to get something like that ? I tried but only got the nodes types
The text was updated successfully, but these errors were encountered:
Hey @emilos .Thank you for the fast reply. Actually I have tried this. It works fine. I cant get the node type of the child. But the problem is it return the whole node for the parent. tree.walk((node, parent) => { console.log(node.type, parent) })
When I try parent.type it gives me an error. Parent is just another node ? Right ? tree.walk((node, parent) => { console.log(node.type, parent.type) })
Is it possible to get Parent and Child node while using walk method ? Like for example lets saye 3+4 ; So first pair would be ("Program","ExpressionStatement"). then ("ExpressionStatement","BinaryExpression") .It it possible to get something like that ? I tried but only got the nodes types
The text was updated successfully, but these errors were encountered: