Skip to content

Is there a way to update the trivia of the first token of an arbitrary (non-const) syntax node ? #898

Answered by MikePopoloski
suzizecat asked this question in Q&A
Discussion options

You must be logged in to vote

There is not currently, but it's doable to add a childToken() overload (and perhaps corresponding overloads for getFirst / getLast) that returns a mutable reference for non-const syntax nodes. In general I don't add methods until there's a use for them, so the fact that they're missing doesn't necessarily mean it was a design intention. I'm happy to accept a PR if you want to add it, or you can wait until I get around to it.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@suzizecat
Comment options

@MikePopoloski
Comment options

@suzizecat
Comment options

Answer selected by suzizecat
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