C#语言当前版本的语法[已关闭]

问题描述 投票:0回答:1

当前版本的C#语言的语法在哪里?

我的意思是类似于此 SQL 语法的语法:https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html

例如,我想检查一下

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.0/pattern 中提到的 
complex_pattern 元素是什么-matching 页面及其与
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0 上定义的 
pattern
primary_pattern 语法元素的关系/pattern3 页面。在语法中哪里可以找到它?

c# syntax
1个回答
7
投票

具有(草案)规范的 C# 最新版本是 C# 6.0。 规范中散布着语法。

较新版本的 C# 还没有规范(您必须采用 C# 6.0 规范,并添加更高版本中存在的功能的建议,例如此处)。

Roslyn 存储库包含从最新版本的编译器生成的语法,当前在这里。在 Roslyn 存储库中搜索

path:**/*.g4
(如果它移动了)。

© www.soinside.com 2019 - 2024. All rights reserved.