Skip to content

How to pass a Document to CST.visit #379

Closed Answered by eemeli
gee4vee asked this question in Q&A
Discussion options

You must be logged in to vote

That would be because compose() returns a generator of parsed AST nodes, and you're looking for a single CST document. You probably want to iterate on the parse() results until you find one.

I would recommend reviewing the relevant docs section: https://eemeli.org/yaml/#parsing-yaml. If some part of that is not clear, please do say so, and hopefully we can improve the documentation. It might also be a good idea to play around with the Node.js interactive shell to see what the data looks like at each stage?

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@eemeli
Comment options

@gee4vee
Comment options

@eemeli
Comment options

@gee4vee
Comment options

@gee4vee
Comment options

Answer selected by eemeli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants