Коммит
8fb4d327bc
|
@ -23,7 +23,8 @@
|
|||
<label>
|
||||
Parse as:
|
||||
<select id="nodeKind">
|
||||
<option value="CompilationUnit">File</option>
|
||||
<option value="CompilationUnit">Regular-File</option>
|
||||
<option value="Script">Script-File</option>
|
||||
<option value="MemberDeclaration">Member</option>
|
||||
<option value="Statement">Statement</option>
|
||||
<option value="Expression">Expression</option>
|
||||
|
|
|
@ -114,8 +114,12 @@ namespace RoslynQuoter
|
|||
{
|
||||
switch (nodeKind)
|
||||
{
|
||||
case NodeKind.Script:
|
||||
return SyntaxFactory.ParseCompilationUnit(sourceText,
|
||||
options: new CSharpParseOptions(LanguageVersion.Preview, kind: SourceCodeKind.Script));
|
||||
case NodeKind.CompilationUnit:
|
||||
return SyntaxFactory.ParseCompilationUnit(sourceText, options: new CSharpParseOptions(LanguageVersion.Preview));
|
||||
return SyntaxFactory.ParseCompilationUnit(sourceText,
|
||||
options: new CSharpParseOptions(LanguageVersion.Preview, kind: SourceCodeKind.Regular));
|
||||
case NodeKind.MemberDeclaration:
|
||||
return SyntaxFactory.ParseMemberDeclaration(sourceText);
|
||||
case NodeKind.Statement:
|
||||
|
@ -2023,6 +2027,7 @@ If the first parameter is of type SyntaxKind, please add an exception for this n
|
|||
public enum NodeKind
|
||||
{
|
||||
CompilationUnit,
|
||||
Script,
|
||||
MemberDeclaration,
|
||||
Statement,
|
||||
Expression
|
||||
|
|
Загрузка…
Ссылка в новой задаче