Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ast::Node::accept() not const #56

Closed
benh opened this issue Oct 16, 2017 · 1 comment
Closed

ast::Node::accept() not const #56

benh opened this issue Oct 16, 2017 · 1 comment

Comments

@benh
Copy link

benh commented Oct 16, 2017

Any reason that ast::Node::accept() is not const?

It would be great to create a nested visitor while visiting and we can't call accept() on any nested nodes because we always have const pointers or references to them.

@swolchok
Copy link
Contributor

It would be great to create a nested visitor while visiting

yes, yes it would! :)

Making accept const seems reasonable from the perspective of GraphQL execution, given that we don't support any kind of AST editing right now anyway. If we end up with tools that process GraphQL queries written in C++ that want to edit the AST in-place for efficiency reasons, we can worry about adding non-const accept and some way to mutate AST nodes later.

I'll have to think about it a little more when it's not late at night, but nothing else comes to mind off the top of my head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants