I'm creating a code analyzer for react. For example, if we have Cart.js:
const Cart = ({
products,
discount,
shipment,
payment
}) => {
return <div>
{
products.map(product => <Product
{...product}
canModify
modifier={<Modifier />}
images={2}
onClick={p => setAsSelectedProduct(p)}
/>)
}
</div>
}
I want to get the <Product component that is used here, but in my static code analyzer tool, let's say in Python.
How can I do that? Is there a library that can help us get token tree?