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.
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.
Consider changing to
IsUTF8StringLiteralfor 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.
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.
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