Skip to content

Export astbuilder #1222

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

Merged
merged 2 commits into from
Apr 20, 2020
Merged

Export astbuilder #1222

merged 2 commits into from
Apr 20, 2020

Conversation

jtenner
Copy link
Contributor

@jtenner jtenner commented Apr 13, 2020

As discussed on slack. This software would be useful in some of our projects and for orm codegen.

For instance, as-pect has had lots of trouble with debugging sources when transforms are included, so this would enable developers to output transformed source code to inspect certain kinds of problems with transforms.

cc @willemneal because he definitely wanted this too.

Fixes #1212 as a first step.

Something more should be done.

@willemneal
Copy link
Contributor

You definitely don't have to do this, but it would also be a good opportunity to abstract the visitor part of the ASTBuilder so that it extends a base visitor. This way external visitors don't have to recreate it and it'll ensure that it's up to date with the compiler since it'll be used in the testing of parser.

Here is the most abstract visitor I made: https://github.com/willemneal/visitor-as/blob/master/src/visitor.ts

I used that so that you can call visitor.visit(collection of nodes)

If you don't want to I could, I can take a crack at this tomorrow.

@jtenner
Copy link
Contributor Author

jtenner commented Apr 13, 2020

It was advised to me that we should wait for vtables, per the slack conversation. He said this was a good "first step".

@dcodeIO
Copy link
Member

dcodeIO commented Apr 13, 2020

Thinking about this, since we are not using the ASTBuilder in Wasm, it might as well be fine to abstract it now, as long as it compiles to Wasm and has no obvious issues anymore after vtables have landed.

@jtenner
Copy link
Contributor Author

jtenner commented Apr 13, 2020

I think I've run out of time for this today. Perhaps @willemneal could take the helm on this request then?

@dcodeIO dcodeIO merged commit 106a4b0 into AssemblyScript:master Apr 20, 2020
@dcodeIO
Copy link
Member

dcodeIO commented Apr 20, 2020

Merging so we have it exposed now. Feel free to think about abstracting it in a useful way :)

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

Successfully merging this pull request may close these issues.

Expose ASTBuilder
3 participants