-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
retain postfix node for typed variable/routine AST; save field syms #23120
base: devel
Are you sure you want to change the base?
Conversation
It seems like no packages in the CI were affected by the AST changes in this PR, but I added it to the changelog anyway, at least for the type case which did require package updates. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry for the late reply. This is a step in the right direction but I dream of a more radical change: Introduce an |
That would be nice, I don't know how it would interact with types and procs though, they don't use nkIdentDefs. At the very least we can combine nkPragmaExpr and nkPostfix. We would also have to either gate it into an experimental switch or have it for internal use only and always produce the old AST to pass to macros and then turn it back after receiving it (presumably it's present in both untyped and typed AST). |
That's the solution I have in mind. As for "not used in parameters", maybe it should be |
Rebased and added test for #13828 |
2a7b95a
to
e94a8da
Compare
Rebased to fix merge conflicts but the diff for |
It was not moved to anywhere and the whole NIR thing got replaced by NIF which lives in its own repository. |
e94a8da
to
95df6bc
Compare
fixes #13828, refs #23101
Postfix nodes in
var
/let
/const
/routine nodes are now retained in typed AST, previously they would just become either annkSym
node or annkPragmaExpr
node containing thenkSym
node. This was done for type sections in #23101 which also handled doc generation of postfix nodes. The newly generated postfix nodes get transformed back into just the symbol nodes intransf
.On top of this, object fields now store their symbol node in the AST. The old output of:
was:
Now the
Ident "a"
becomesSym "a"
, storing the symbol of the field.