private CSharpSyntaxNode ParseTypeOrPatternForIsOperatorCore()
        {
            var pattern = ParsePattern(GetPrecedence(SyntaxKind.IsPatternExpression), afterIs: true);

            return(pattern switch
            {
                ConstantPatternSyntax cp when ConvertExpressionToType(cp.Expression, out NameSyntax type) => type,
                TypePatternSyntax tp => tp.Type,
                DiscardPatternSyntax dp => _syntaxFactory.IdentifierName(ConvertToIdentifier(dp.UnderscoreToken)),
                var p => p,
            });
示例#2
0
 private Doc PrintTypePatternSyntax(TypePatternSyntax node)
 {
     return(this.Print(node.Type));
 }
示例#3
0
 public override void VisitTypePattern(TypePatternSyntax node)
 {
     Log(node, "Unsupported Syntax !");
 }
示例#4
0
 public static Doc Print(TypePatternSyntax node)
 {
     return(Node.Print(node.Type));
 }