-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Support raw UTF8 String Literals #59390
Support raw UTF8 String Literals #59390
Conversation
@cston, @RikkiGibson, @dotnet/roslyn-compiler Please review. |
@cston, @dotnet/roslyn-compiler For the second review. |
N(SyntaxKind.EndOfDirectiveToken); | ||
} | ||
EOF(); | ||
} |
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.
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 tests for enhanced line directives with UTF8 string literals and UTF8 raw string literals:
If you insist, I can add the suggested test. However, I do not see much benefits in testing every single directive flavor. The goal is to test how we scan literals in context of directives, i.e. to confirm that we do not recognize the suffix. I believe the existing tests are sufficient to cover the scenario.
Please let me know if you still want me to add the tests.
@@ -32,3 +32,5 @@ static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.InterpolatedStringExpression( | |||
Microsoft.CodeAnalysis.CSharp.Conversion.IsUtf8StringLiteral.get -> bool |
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.
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.
Consider changing to
IsUTF8StringLiteral
for consistency with public API members below.
If there are no objections, I prefer doing this in a separate PR.
|
||
[Theory] | ||
[InlineData("u80")] | ||
[InlineData("U80")] |
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.
Should these be "u8"
and "U8"
rather than "u80"
and "U80"
? Same question for other Interpolation_0*()
tests below. #Resolved
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.
Should these be "u8" and "U8" rather than "u80" and "U80"?
Yes, good catch. I'll fix.
Note to self: IDE code that works with raw string literals must not presume that a syntactically valid raw string starts and ends with the exact same sequence of quotes. e.g. |
Relates to test plan #58848