Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is some work towards #353.
It's not complete. I think it does the hard bits:
But we do not currently have any way to set different namespaces, and there are therefore no extra tests yet.
So it feels like it's about half the job (if we exclude the later need to resolve
use
statements).I'm raising this PR now because it's already pretty complicated, and there are (at least) the following areas where I think rework may be required and I would like your comments.
QualifiedIdent
s instead ofIdent
s all over theApi
was what you had in mind. But per the 75f435e commit comment, it would be great to understand that I've qualified the names for roughly the right set of things. (I do expect to find some anomalies when we come to add tests).parse.rs
recognizes primitives and built-ins, which should therefore not have the current namespace prepended. This is an interim step until we supportuse
, but I'd be interested in your views about whether it's about right meanwhile (I do think the list of built-ins should probably be abstracted somewhere, at least.)Symbol
and its relationship toQualifiedIdent
. I think it's OK to have a distinct type (QualifiedIdent
= C++ name with namespace;Symbol
= mangled version of same) but I feel as though I should now be able to rip out a ton ofSymbol
code and I can't.QualifiedIdent
code should go into aqualified_ident.rs
file.As ever, feel free to tinker with these things directly or give me your wisdom so I can do follow-up work!