-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Get symbol kind #7491
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
Get symbol kind #7491
Conversation
|
Something I would like to discuss here is the usefulness of the
|
Yeah, we should do without, I agree, good points! |
|
Should I implement |
|
Yes. |
|
There is one thing I would like to discuss here, too. The NimIdent The only function that doesn't work with a NimNode is I think the best road to deprecate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small comments. Looks good.
| proc symbol*(n: NimNode): NimSym {.magic: "NSymbol", noSideEffect.} | ||
| proc ident*(n: NimNode): NimIdent {.magic: "NIdent", noSideEffect.} | ||
|
|
||
| proc symbol*(n: NimNode): NimSym {.magic: "NSymbol", noSideEffect, deprecated.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a doc comment with the usual deprecation template.
| proc symName*(n: NimNode): string = | ||
| $n.symbol | ||
| proc getImpl*(symbol: NimNode): NimNode = | ||
| symbol.symbol.getImpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these definitions really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes they are, otherwise bootstrapping breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well at least when the bootstrapping compiler is updated, the when statement with the else branch can completely disappear.
|
Looks excellent, needs a changelog entry and more documentation overall. Also check if the existing documentation is outdated with this change. |
|
using |
|
It's really nice. I have nothing to complain. Not merging though since you had some questions in IRC. |
fixes #7366
when n is of type
NimNode, then you can do the following:let symKind = n.symbol.kind