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

Make it easier to modify metas for generic PartiqlAst.Expr #311

Open
alancai98 opened this issue Oct 14, 2020 · 0 comments
Open

Make it easier to modify metas for generic PartiqlAst.Expr #311

alancai98 opened this issue Oct 14, 2020 · 0 comments
Labels
enhancement New feature or request S Small sized task

Comments

@alancai98
Copy link
Member

When trying to transform PartiqlAst.Expr's metas, there currently isn't an easy way to change or add metas (for the generic PartiqlAst.Expr).

A current workaround is to create an inner class that overrides the PIG transformMetas function. i.e.

inner class MetaVisitorTransform(private val newMetas: MetaContainer) : PartiqlAst.VisitorTransform() {
    override fun transformMetas(metas: MetaContainer): MetaContainer = newMetas
}

An alternate workaround to add/edit metas can be to case on the specific PartiqlAst.Expr type and call its corresponding withMeta function.

It would be nice to have a .copy function that ExprNode currently has. Alternatively, there could be a withMeta function that PartiqlAst.Expr can call.

A more ideal solution would likely involve editing the PIG PartiqlAst type domain for PartiqlAst.Expr.

@alancai98 alancai98 added enhancement New feature or request S Small sized task labels Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request S Small sized task
Projects
None yet
Development

No branches or pull requests

1 participant