Remove RazorIrNodeVisitorOfT (#1089)
This commit is contained in:
parent
4a71b1d57d
commit
319c535224
|
|
@ -20,10 +20,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
visitor.VisitAddPreallocatedTagHelperHtmlAttribute(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitAddPreallocatedTagHelperHtmlAttribute(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,15 +28,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitAddTagHelperHtmlAttribute(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitAddTagHelperHtmlAttribute(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitCSharpAttributeValue(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitCSharpAttributeValue(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,15 +23,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitCSharpExpression(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitCSharpExpression(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,15 +26,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitCSharpStatement(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitCSharpStatement(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
visitor.VisitChecksum(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitChecksum(this);
|
||||
}
|
||||
|
||||
public static ChecksumIRNode Create(RazorSourceDocument sourceDocument)
|
||||
{
|
||||
// See http://msdn.microsoft.com/en-us/library/system.codedom.codechecksumpragma.checksumalgorithmid.aspx
|
||||
|
|
|
|||
|
|
@ -31,15 +31,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitClass(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitClass(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,15 +27,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitCreateTagHelper(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitCreateTagHelper(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
visitor.VisitDeclarePreallocatedTagHelperAttribute(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitDeclarePreallocatedTagHelperAttribute(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
visitor.VisitDeclarePreallocatedTagHelperHtmlAttribute(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitDeclarePreallocatedTagHelperHtmlAttribute(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitDeclareTagHelperFields(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitDeclareTagHelperFields(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
visitor.VisitDirective(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitDirective(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -22,10 +22,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
visitor.VisitDirectiveToken(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitDirectiveToken(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -30,15 +30,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitDocument(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitDocument(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,15 +23,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitExecuteTagHelpers(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitExecuteTagHelpers(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,19 +22,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
typedVisitor.VisitExtension(node);
|
||||
}
|
||||
}
|
||||
|
||||
protected static TResult AcceptExtensionNode<TNode, TResult>(TNode node, RazorIRNodeVisitor<TResult> visitor)
|
||||
where TNode : ExtensionIRNode
|
||||
{
|
||||
var typedVisitor = visitor as IExtensionIRNodeVisitor<TNode, TResult>;
|
||||
if (typedVisitor == null)
|
||||
{
|
||||
return visitor.VisitExtension(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
return typedVisitor.VisitExtension(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,15 +29,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitHtmlAttribute(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitHtmlAttribute(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,15 +27,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitHtmlAttributeValue(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitHtmlAttributeValue(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitHtml(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitHtml(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,15 +28,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitInitializeTagHelperStructure(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitInitializeTagHelperStructure(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitNamespace(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitNamespace(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
public abstract SourceSpan? Source { get; set; }
|
||||
|
||||
public abstract void Accept(RazorIRNodeVisitor visitor);
|
||||
|
||||
public abstract TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor);
|
||||
public abstract void Accept(RazorIRNodeVisitor visitor);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,153 +0,0 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
||||
{
|
||||
public abstract class RazorIRNodeVisitor<TResult>
|
||||
{
|
||||
public virtual TResult Visit(RazorIRNode node)
|
||||
{
|
||||
return node.Accept(this);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDefault(RazorIRNode node)
|
||||
{
|
||||
return default(TResult);
|
||||
}
|
||||
|
||||
public virtual TResult VisitChecksum(ChecksumIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitToken(RazorIRToken node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDirectiveToken(DirectiveTokenIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDirective(DirectiveIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitExtension(ExtensionIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitCSharpStatement(CSharpStatementIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitCSharpExpression(CSharpExpressionIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitHtmlAttributeValue(HtmlAttributeValueIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitCSharpAttributeValue(CSharpAttributeValueIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitHtmlAttribute(HtmlAttributeIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitClass(ClassDeclarationIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitRazorMethodDeclaration(RazorMethodDeclarationIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDocument(DocumentIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitHtml(HtmlContentIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitNamespace(NamespaceDeclarationIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitUsingStatement(UsingStatementIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDeclareTagHelperFields(DeclareTagHelperFieldsIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitTagHelper(TagHelperIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitInitializeTagHelperStructure(InitializeTagHelperStructureIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitCreateTagHelper(CreateTagHelperIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitSetTagHelperProperty(SetTagHelperPropertyIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitAddTagHelperHtmlAttribute(AddTagHelperHtmlAttributeIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitExecuteTagHelpers(ExecuteTagHelpersIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDeclarePreallocatedTagHelperHtmlAttribute(DeclarePreallocatedTagHelperHtmlAttributeIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitAddPreallocatedTagHelperHtmlAttribute(AddPreallocatedTagHelperHtmlAttributeIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitDeclarePreallocatedTagHelperAttribute(DeclarePreallocatedTagHelperAttributeIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
|
||||
public virtual TResult VisitSetPreallocatedTagHelperProperty(SetPreallocatedTagHelperPropertyIRNode node)
|
||||
{
|
||||
return VisitDefault(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,16 +32,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
visitor.VisitToken(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitToken(this);
|
||||
}
|
||||
|
||||
public enum TokenKind
|
||||
{
|
||||
Unknown,
|
||||
|
|
|
|||
|
|
@ -31,15 +31,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitRazorMethodDeclaration(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitRazorMethodDeclaration(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
visitor.VisitSetPreallocatedTagHelperProperty(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitSetPreallocatedTagHelperProperty(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,15 +38,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitSetTagHelperProperty(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitSetTagHelperProperty(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,15 +23,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitTagHelper(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitTagHelper(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,16 +25,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
AcceptExtensionNode<TemplateIRNode>(this, visitor);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return AcceptExtensionNode<TemplateIRNode, TResult>(this, visitor);
|
||||
}
|
||||
|
||||
public override void WriteNode(RuntimeTarget target, CSharpRenderingContext context)
|
||||
{
|
||||
var extension = target.GetExtension<ITemplateTargetExtension>();
|
||||
|
|
|
|||
|
|
@ -25,15 +25,5 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
|
||||
visitor.VisitUsingStatement(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
if (visitor == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(visitor));
|
||||
}
|
||||
|
||||
return visitor.VisitUsingStatement(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,11 +91,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
{
|
||||
visitor.VisitDefault(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitDefault(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,11 +179,6 @@ __o = i++;
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void WriteNode(RuntimeTarget target, CSharpRenderingContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -231,11 +231,6 @@ Test(test_writer, i++);
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void WriteNode(RuntimeTarget target, CSharpRenderingContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -191,11 +191,6 @@ Test(i++);
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void WriteNode(RuntimeTarget target, CSharpRenderingContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -224,11 +224,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,36 +42,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
Assert.True(visitor.WasSpecificMethodCalled);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Accept_TResult_CallsStandardVisitExtension_ForStandardVisitor()
|
||||
{
|
||||
// Arrange
|
||||
var node = new TestExtensionIRNode();
|
||||
var visitor = new StandardVisitor<bool>();
|
||||
|
||||
// Act
|
||||
node.Accept(visitor);
|
||||
|
||||
// Assert
|
||||
Assert.True(visitor.WasStandardMethodCalled);
|
||||
Assert.False(visitor.WasSpecificMethodCalled);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Accept_TResult_CallsSpecialVisitExtension_ForSpecialVisitor()
|
||||
{
|
||||
// Arrange
|
||||
var node = new TestExtensionIRNode();
|
||||
var visitor = new SpecialVisitor<bool>();
|
||||
|
||||
// Act
|
||||
node.Accept(visitor);
|
||||
|
||||
// Assert
|
||||
Assert.False(visitor.WasStandardMethodCalled);
|
||||
Assert.True(visitor.WasSpecificMethodCalled);
|
||||
}
|
||||
|
||||
private class TestExtensionIRNode : ExtensionIRNode
|
||||
{
|
||||
public override IList<RazorIRNode> Children => throw new NotImplementedException();
|
||||
|
|
@ -85,12 +55,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
AcceptExtensionNode<TestExtensionIRNode>(this, visitor);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
// This is the standard visitor boilerplate for an extension node.
|
||||
return AcceptExtensionNode<TestExtensionIRNode, TResult>(this, visitor);
|
||||
}
|
||||
|
||||
public override void WriteNode(RuntimeTarget target, CSharpRenderingContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
@ -113,24 +77,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
}
|
||||
}
|
||||
|
||||
private class StandardVisitor<T> : RazorIRNodeVisitor<T>
|
||||
{
|
||||
public bool WasStandardMethodCalled { get; private set; }
|
||||
public bool WasSpecificMethodCalled { get; private set; }
|
||||
|
||||
public override T VisitExtension(ExtensionIRNode node)
|
||||
{
|
||||
WasStandardMethodCalled = true;
|
||||
return default(T);
|
||||
}
|
||||
|
||||
public T VisitExtension(TestExtensionIRNode node)
|
||||
{
|
||||
WasSpecificMethodCalled = true;
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
|
||||
private class SpecialVisitor : RazorIRNodeVisitor, IExtensionIRNodeVisitor<TestExtensionIRNode>
|
||||
{
|
||||
public bool WasStandardMethodCalled { get; private set; }
|
||||
|
|
@ -145,24 +91,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
WasSpecificMethodCalled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private class SpecialVisitor<T> : RazorIRNodeVisitor<T>, IExtensionIRNodeVisitor<TestExtensionIRNode, T>
|
||||
{
|
||||
public bool WasStandardMethodCalled { get; private set; }
|
||||
public bool WasSpecificMethodCalled { get; private set; }
|
||||
|
||||
public override T VisitExtension(ExtensionIRNode node)
|
||||
{
|
||||
WasStandardMethodCalled = true;
|
||||
return default(T);
|
||||
}
|
||||
|
||||
public T VisitExtension(TestExtensionIRNode node)
|
||||
{
|
||||
WasSpecificMethodCalled = true;
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,11 +84,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
private class BasicIRNode2 : RazorIRNode
|
||||
|
|
@ -103,11 +98,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
private class BasicIRNode3 : RazorIRNode
|
||||
|
|
@ -122,11 +112,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,11 +81,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate
|
|||
((DerivedIRNodeWalker)visitor).VisitBasic(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue