-
Notifications
You must be signed in to change notification settings - Fork 32
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
Design of the AST builder #747
Comments
I agree fairly strongly with the first point, and I've been lightly considering having some term that expands to an (What the syntax would be is of course up for discussion, |
Summary of thoughts during the meeting today:
Approaches to improve the status quo, at varying levels of difficulty and breakage:
There are more combinations of the above ideas possible, and the syntax
|
I don't like how the AST builder works right now, so I would like to bring up a couple of issues I have with it. I'm bringing them up in this issue instead of directly fixing them as it would take quite some effort to do this (the AST builder is used almost everywhere in the compiler), so I would like to make sure this is something we want first. My first point could be a bit controversial.
My main complaints with the current AST builder are that:
info
field argument, but they set it toNoInfo ()
. This approach is acceptable when generating tests, but I don't think it is OK when generating code in a compiler pass. Even when the generated code has no direct connection to the input AST, I think it should have an info field stating where it originates (using thefilename
field). Otherwise, the code we generate will be very difficult to debug. Therefore, the default functions, such asvar_
, should take aninfo
field as the first argument.use MExprAst in ...
) and risk being shadowed by later definitions. I think they should be implemented assem
s in language fragments.The text was updated successfully, but these errors were encountered: