Hacker News new | ask | show | jobs
by oh_teh_meows 2487 days ago
The Code component seems like a catch all. If it were to support actual AST, surely

<Code>const a = 3</Code>

Would have looked something like:

<Assign> <Lhs constant><Id>a</Id></Lhs> <Rhs><Literal>3</Literal></Rhs> </Assign>

1 comments

The Code component would do a poor job at nesting code in a body. The point of this project is to make it easy to generate code through an AST, hence the <Code /> "catch call".