-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add ImportLocation to SymbolToken #12
Conversation
4752d00
to
e52f9d8
Compare
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.
This is looking good. Here are two bits of logic I don't see in here:
- When the reader encounters a symbol ID that occurs within a shared symbol table but that shared symbol table is not resolved in the catalog, the reader should return a SymbolToken with
null
text and an ImportLocation that identifies the name and SID in the unresolved shared symbol table. - When the writer is provided with a SymbolToken with
null
text and with a valid ImportLocation, it should calculate the local symbol ID from the import symbol ID and write the local symbol ID.
This can be done in a separate CR if your prefer.
Sure. |
I've created #31 for this. |
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.
Approving, pending the one comment below.
@@ -704,8 +704,8 @@ public IEnumerable<SymbolToken> GetTypeAnnotations() | |||
throw new UnknownSymbolException(a.Sid); | |||
} | |||
|
|||
var text = symtab.FindKnownSymbol(a.Sid); | |||
yield return new SymbolToken(text, a.Sid); | |||
var text = symtab.FindKnownSymbol(a.ImportLocation.Sid); |
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.
One last thing, and then this is good to go:
Line 699 should be if (a.Text is null && a.ImportLocation != null)
since we're relying on ImportLocation now and not local SID.
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.
Did you mean if (a.Text is null && a.ImportLocation != default)
? Or is null
what we are checking for in this instance?
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.
We want to know if a.ImportLocation
is specified. If a.ImportLocation != default
is the correct way to do that, then yes that's what I mean.
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.
Done.
No description provided.