csharpstandard
csharpstandard copied to clipboard
Pre-processing line directive
Type of issue
Spec incorrect
Description
Reference: Pre-processing line directive
Production fragment:
fragment PP_Compilation_Unit_Name_Character
// Any Input_Character except "
: ~('\u000D' | '\u000A' | '\u0085' | '\u2028' | '\u2029' | '#')
;
-
The above production fragment says that '#' is not allowed for PP_Compilation_Unit_Name_Character. But I can be able to use it (in C# 10) .
-
Also, the comment states that
"can't be used in PP_Compilation_Unit_Name_Character. But it is not mentioned in the grammar.
Production fragment:
fragment PP_Compilation_Unit_Name
: '"' PP_Compilation_Unit_Name_Character+ '"'
;
- The above production fragment says, at least one PP_Compilation_Unit_Name_Character. But I can be able to use an empty string (
"").
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure
Content source URL
https://github.com/dotnet/csharpstandard/blob/draft-v8/standard/lexical-structure.md