Skip to content

How compatible is esast with the rest of the unist ecosystem? #73

Answered by wooorm
Persola asked this question in General
Discussion options

You must be logged in to vote

I assume this was done so that esast could be a superset of ESTree

Yup! (The rest of my comment aligns with what you found out too!)

And: how even would children work for things can have different “slots”? E.g., arguments and body of a function?

In almost all cases, markup has just one slot of children, assuming attributes don’t have to be nodes.
Programming languages defies this.
Some problems around this exist for JSX, used in MDX, so in markdown, which can have expressions (arbitrary nodes) as their attribute values. But that again is: programming languages.

Similar problems would also present itself for CSTs: in a CST, markup would have to represent whitespace, comments, random stuf…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Persola
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants