Apply VS' FormatDocument and RemoveAndSort to all *.cs files
- #EngineeringDay Did not change any files under test/Microsoft.AspNet.Razor.Test/TestFiles - avoiding need to redo hashes
This commit is contained in:
parent
0f724a51df
commit
26034fb5b2
|
|
@ -28,11 +28,11 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
|
|||
/// <param name="output">A stateful HTML element used to generate an HTML tag.</param>
|
||||
/// <returns>A <see cref="Task"/> that on completion updates the <paramref name="output"/>.</returns>
|
||||
/// <remarks>By default this calls into <see cref="Process"/>.</remarks>.
|
||||
#pragma warning disable 1998
|
||||
#pragma warning disable 1998
|
||||
public virtual async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
|
||||
{
|
||||
Process(context, output);
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Generator
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
public class CSharpBaseTypeVisitor : CodeVisitor<CSharpCodeWriter>
|
||||
{
|
||||
public CSharpBaseTypeVisitor(CSharpCodeWriter writer, CodeBuilderContext context)
|
||||
: base(writer, context) { }
|
||||
: base(writer, context)
|
||||
{ }
|
||||
|
||||
public string CurrentBaseType { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
public class CSharpClassAttributeVisitor : CodeVisitor<CSharpCodeWriter>
|
||||
{
|
||||
public CSharpClassAttributeVisitor(CSharpCodeWriter writer, CodeBuilderContext context)
|
||||
: base(writer, context) { }
|
||||
: base(writer, context)
|
||||
{ }
|
||||
|
||||
protected override void Visit(SessionStateChunk chunk)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using System.Globalization;
|
|||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
|
|||
{
|
||||
Visit((StatementChunk)chunk);
|
||||
}
|
||||
else if(chunk is TagHelperChunk)
|
||||
else if (chunk is TagHelperChunk)
|
||||
{
|
||||
Visit((TagHelperChunk)chunk);
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
|
|||
{
|
||||
Visit((RemoveTagHelperChunk)chunk);
|
||||
}
|
||||
else if(chunk is SetLayoutChunk)
|
||||
else if (chunk is SetLayoutChunk)
|
||||
{
|
||||
Visit((SetLayoutChunk)chunk);
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
|
|||
{
|
||||
Visit((UsingChunk)chunk);
|
||||
}
|
||||
else if(chunk is HelperChunk)
|
||||
else if (chunk is HelperChunk)
|
||||
{
|
||||
Visit((HelperChunk)chunk);
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
|
|||
{
|
||||
Visit((ChunkBlock)chunk);
|
||||
}
|
||||
else if(chunk is SessionStateChunk)
|
||||
else if (chunk is SessionStateChunk)
|
||||
{
|
||||
Visit((SessionStateChunk)chunk);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
|
|||
public class CodeVisitor<T> : ChunkVisitor<T> where T : CodeWriter
|
||||
{
|
||||
public CodeVisitor(T writer, CodeBuilderContext context)
|
||||
: base(writer, context) { }
|
||||
: base(writer, context)
|
||||
{ }
|
||||
|
||||
protected override void Visit(LiteralChunk chunk)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
|
|
|||
|
|
@ -253,9 +253,9 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
Language.TokenizeString,
|
||||
DefaultKeywords,
|
||||
acceptTrailingDot: IsNested)
|
||||
{
|
||||
AcceptedCharacters = AcceptedCharacters.NonWhiteSpace
|
||||
};
|
||||
{
|
||||
AcceptedCharacters = AcceptedCharacters.NonWhiteSpace
|
||||
};
|
||||
if (At(CSharpSymbolType.WhiteSpace) || At(CSharpSymbolType.NewLine))
|
||||
{
|
||||
Context.OnError(CurrentLocation, RazorResources.ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS);
|
||||
|
|
|
|||
|
|
@ -102,24 +102,24 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
{
|
||||
switch (type)
|
||||
{
|
||||
case KnownSymbolType.Identifier:
|
||||
return CSharpSymbolType.Identifier;
|
||||
case KnownSymbolType.Keyword:
|
||||
return CSharpSymbolType.Keyword;
|
||||
case KnownSymbolType.NewLine:
|
||||
return CSharpSymbolType.NewLine;
|
||||
case KnownSymbolType.WhiteSpace:
|
||||
return CSharpSymbolType.WhiteSpace;
|
||||
case KnownSymbolType.Transition:
|
||||
return CSharpSymbolType.Transition;
|
||||
case KnownSymbolType.CommentStart:
|
||||
return CSharpSymbolType.RazorCommentTransition;
|
||||
case KnownSymbolType.CommentStar:
|
||||
return CSharpSymbolType.RazorCommentStar;
|
||||
case KnownSymbolType.CommentBody:
|
||||
return CSharpSymbolType.RazorComment;
|
||||
default:
|
||||
return CSharpSymbolType.Unknown;
|
||||
case KnownSymbolType.Identifier:
|
||||
return CSharpSymbolType.Identifier;
|
||||
case KnownSymbolType.Keyword:
|
||||
return CSharpSymbolType.Keyword;
|
||||
case KnownSymbolType.NewLine:
|
||||
return CSharpSymbolType.NewLine;
|
||||
case KnownSymbolType.WhiteSpace:
|
||||
return CSharpSymbolType.WhiteSpace;
|
||||
case KnownSymbolType.Transition:
|
||||
return CSharpSymbolType.Transition;
|
||||
case KnownSymbolType.CommentStart:
|
||||
return CSharpSymbolType.RazorCommentTransition;
|
||||
case KnownSymbolType.CommentStar:
|
||||
return CSharpSymbolType.RazorCommentStar;
|
||||
case KnownSymbolType.CommentBody:
|
||||
return CSharpSymbolType.RazorComment;
|
||||
default:
|
||||
return CSharpSymbolType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -127,30 +127,30 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
{
|
||||
switch (bracket)
|
||||
{
|
||||
case CSharpSymbolType.LeftBrace:
|
||||
return CSharpSymbolType.RightBrace;
|
||||
case CSharpSymbolType.LeftBracket:
|
||||
return CSharpSymbolType.RightBracket;
|
||||
case CSharpSymbolType.LeftParenthesis:
|
||||
return CSharpSymbolType.RightParenthesis;
|
||||
case CSharpSymbolType.LessThan:
|
||||
return CSharpSymbolType.GreaterThan;
|
||||
case CSharpSymbolType.RightBrace:
|
||||
return CSharpSymbolType.LeftBrace;
|
||||
case CSharpSymbolType.RightBracket:
|
||||
return CSharpSymbolType.LeftBracket;
|
||||
case CSharpSymbolType.RightParenthesis:
|
||||
return CSharpSymbolType.LeftParenthesis;
|
||||
case CSharpSymbolType.GreaterThan:
|
||||
return CSharpSymbolType.LessThan;
|
||||
default:
|
||||
case CSharpSymbolType.LeftBrace:
|
||||
return CSharpSymbolType.RightBrace;
|
||||
case CSharpSymbolType.LeftBracket:
|
||||
return CSharpSymbolType.RightBracket;
|
||||
case CSharpSymbolType.LeftParenthesis:
|
||||
return CSharpSymbolType.RightParenthesis;
|
||||
case CSharpSymbolType.LessThan:
|
||||
return CSharpSymbolType.GreaterThan;
|
||||
case CSharpSymbolType.RightBrace:
|
||||
return CSharpSymbolType.LeftBrace;
|
||||
case CSharpSymbolType.RightBracket:
|
||||
return CSharpSymbolType.LeftBracket;
|
||||
case CSharpSymbolType.RightParenthesis:
|
||||
return CSharpSymbolType.LeftParenthesis;
|
||||
case CSharpSymbolType.GreaterThan:
|
||||
return CSharpSymbolType.LessThan;
|
||||
default:
|
||||
#if NET45
|
||||
// No Debug.Fail
|
||||
Debug.Fail("FlipBracket must be called with a bracket character");
|
||||
// No Debug.Fail
|
||||
Debug.Fail("FlipBracket must be called with a bracket character");
|
||||
#else
|
||||
Debug.Assert(false, "FlipBracket must be called with a bracket character");
|
||||
#endif
|
||||
return CSharpSymbolType.Unknown;
|
||||
return CSharpSymbolType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,26 +167,26 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
{
|
||||
switch (type)
|
||||
{
|
||||
case CSharpSymbolType.Identifier:
|
||||
return RazorResources.CSharpSymbol_Identifier;
|
||||
case CSharpSymbolType.Keyword:
|
||||
return RazorResources.CSharpSymbol_Keyword;
|
||||
case CSharpSymbolType.IntegerLiteral:
|
||||
return RazorResources.CSharpSymbol_IntegerLiteral;
|
||||
case CSharpSymbolType.NewLine:
|
||||
return RazorResources.CSharpSymbol_Newline;
|
||||
case CSharpSymbolType.WhiteSpace:
|
||||
return RazorResources.CSharpSymbol_Whitespace;
|
||||
case CSharpSymbolType.Comment:
|
||||
return RazorResources.CSharpSymbol_Comment;
|
||||
case CSharpSymbolType.RealLiteral:
|
||||
return RazorResources.CSharpSymbol_RealLiteral;
|
||||
case CSharpSymbolType.CharacterLiteral:
|
||||
return RazorResources.CSharpSymbol_CharacterLiteral;
|
||||
case CSharpSymbolType.StringLiteral:
|
||||
return RazorResources.CSharpSymbol_StringLiteral;
|
||||
default:
|
||||
return RazorResources.Symbol_Unknown;
|
||||
case CSharpSymbolType.Identifier:
|
||||
return RazorResources.CSharpSymbol_Identifier;
|
||||
case CSharpSymbolType.Keyword:
|
||||
return RazorResources.CSharpSymbol_Keyword;
|
||||
case CSharpSymbolType.IntegerLiteral:
|
||||
return RazorResources.CSharpSymbol_IntegerLiteral;
|
||||
case CSharpSymbolType.NewLine:
|
||||
return RazorResources.CSharpSymbol_Newline;
|
||||
case CSharpSymbolType.WhiteSpace:
|
||||
return RazorResources.CSharpSymbol_Whitespace;
|
||||
case CSharpSymbolType.Comment:
|
||||
return RazorResources.CSharpSymbol_Comment;
|
||||
case CSharpSymbolType.RealLiteral:
|
||||
return RazorResources.CSharpSymbol_RealLiteral;
|
||||
case CSharpSymbolType.CharacterLiteral:
|
||||
return RazorResources.CSharpSymbol_CharacterLiteral;
|
||||
case CSharpSymbolType.StringLiteral:
|
||||
return RazorResources.CSharpSymbol_StringLiteral;
|
||||
default:
|
||||
return RazorResources.Symbol_Unknown;
|
||||
}
|
||||
}
|
||||
return sample;
|
||||
|
|
|
|||
|
|
@ -28,46 +28,46 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
{
|
||||
switch (type)
|
||||
{
|
||||
case HtmlSymbolType.Text:
|
||||
return RazorResources.HtmlSymbol_Text;
|
||||
case HtmlSymbolType.WhiteSpace:
|
||||
return RazorResources.HtmlSymbol_WhiteSpace;
|
||||
case HtmlSymbolType.NewLine:
|
||||
return RazorResources.HtmlSymbol_NewLine;
|
||||
case HtmlSymbolType.OpenAngle:
|
||||
return "<";
|
||||
case HtmlSymbolType.Bang:
|
||||
return "!";
|
||||
case HtmlSymbolType.ForwardSlash:
|
||||
return "/";
|
||||
case HtmlSymbolType.QuestionMark:
|
||||
return "?";
|
||||
case HtmlSymbolType.DoubleHyphen:
|
||||
return "--";
|
||||
case HtmlSymbolType.LeftBracket:
|
||||
return "[";
|
||||
case HtmlSymbolType.CloseAngle:
|
||||
return ">";
|
||||
case HtmlSymbolType.RightBracket:
|
||||
return "]";
|
||||
case HtmlSymbolType.Equals:
|
||||
return "=";
|
||||
case HtmlSymbolType.DoubleQuote:
|
||||
return "\"";
|
||||
case HtmlSymbolType.SingleQuote:
|
||||
return "'";
|
||||
case HtmlSymbolType.Transition:
|
||||
return "@";
|
||||
case HtmlSymbolType.Colon:
|
||||
return ":";
|
||||
case HtmlSymbolType.RazorComment:
|
||||
return RazorResources.HtmlSymbol_RazorComment;
|
||||
case HtmlSymbolType.RazorCommentStar:
|
||||
return "*";
|
||||
case HtmlSymbolType.RazorCommentTransition:
|
||||
return "@";
|
||||
default:
|
||||
return RazorResources.Symbol_Unknown;
|
||||
case HtmlSymbolType.Text:
|
||||
return RazorResources.HtmlSymbol_Text;
|
||||
case HtmlSymbolType.WhiteSpace:
|
||||
return RazorResources.HtmlSymbol_WhiteSpace;
|
||||
case HtmlSymbolType.NewLine:
|
||||
return RazorResources.HtmlSymbol_NewLine;
|
||||
case HtmlSymbolType.OpenAngle:
|
||||
return "<";
|
||||
case HtmlSymbolType.Bang:
|
||||
return "!";
|
||||
case HtmlSymbolType.ForwardSlash:
|
||||
return "/";
|
||||
case HtmlSymbolType.QuestionMark:
|
||||
return "?";
|
||||
case HtmlSymbolType.DoubleHyphen:
|
||||
return "--";
|
||||
case HtmlSymbolType.LeftBracket:
|
||||
return "[";
|
||||
case HtmlSymbolType.CloseAngle:
|
||||
return ">";
|
||||
case HtmlSymbolType.RightBracket:
|
||||
return "]";
|
||||
case HtmlSymbolType.Equals:
|
||||
return "=";
|
||||
case HtmlSymbolType.DoubleQuote:
|
||||
return "\"";
|
||||
case HtmlSymbolType.SingleQuote:
|
||||
return "'";
|
||||
case HtmlSymbolType.Transition:
|
||||
return "@";
|
||||
case HtmlSymbolType.Colon:
|
||||
return ":";
|
||||
case HtmlSymbolType.RazorComment:
|
||||
return RazorResources.HtmlSymbol_RazorComment;
|
||||
case HtmlSymbolType.RazorCommentStar:
|
||||
return "*";
|
||||
case HtmlSymbolType.RazorCommentTransition:
|
||||
return "@";
|
||||
default:
|
||||
return RazorResources.Symbol_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -80,23 +80,23 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
{
|
||||
switch (bracket)
|
||||
{
|
||||
case HtmlSymbolType.LeftBracket:
|
||||
return HtmlSymbolType.RightBracket;
|
||||
case HtmlSymbolType.OpenAngle:
|
||||
return HtmlSymbolType.CloseAngle;
|
||||
case HtmlSymbolType.RightBracket:
|
||||
return HtmlSymbolType.LeftBracket;
|
||||
case HtmlSymbolType.CloseAngle:
|
||||
return HtmlSymbolType.OpenAngle;
|
||||
default:
|
||||
case HtmlSymbolType.LeftBracket:
|
||||
return HtmlSymbolType.RightBracket;
|
||||
case HtmlSymbolType.OpenAngle:
|
||||
return HtmlSymbolType.CloseAngle;
|
||||
case HtmlSymbolType.RightBracket:
|
||||
return HtmlSymbolType.LeftBracket;
|
||||
case HtmlSymbolType.CloseAngle:
|
||||
return HtmlSymbolType.OpenAngle;
|
||||
default:
|
||||
#if NET45
|
||||
// No Debug.Fail in CoreCLR
|
||||
// No Debug.Fail in CoreCLR
|
||||
|
||||
Debug.Fail("FlipBracket must be called with a bracket character");
|
||||
Debug.Fail("FlipBracket must be called with a bracket character");
|
||||
#else
|
||||
Debug.Assert(false, "FlipBracket must be called with a bracket character");
|
||||
#endif
|
||||
return HtmlSymbolType.Unknown;
|
||||
return HtmlSymbolType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,24 +109,24 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
{
|
||||
switch (type)
|
||||
{
|
||||
case KnownSymbolType.CommentStart:
|
||||
return HtmlSymbolType.RazorCommentTransition;
|
||||
case KnownSymbolType.CommentStar:
|
||||
return HtmlSymbolType.RazorCommentStar;
|
||||
case KnownSymbolType.CommentBody:
|
||||
return HtmlSymbolType.RazorComment;
|
||||
case KnownSymbolType.Identifier:
|
||||
return HtmlSymbolType.Text;
|
||||
case KnownSymbolType.Keyword:
|
||||
return HtmlSymbolType.Text;
|
||||
case KnownSymbolType.NewLine:
|
||||
return HtmlSymbolType.NewLine;
|
||||
case KnownSymbolType.Transition:
|
||||
return HtmlSymbolType.Transition;
|
||||
case KnownSymbolType.WhiteSpace:
|
||||
return HtmlSymbolType.WhiteSpace;
|
||||
default:
|
||||
return HtmlSymbolType.Unknown;
|
||||
case KnownSymbolType.CommentStart:
|
||||
return HtmlSymbolType.RazorCommentTransition;
|
||||
case KnownSymbolType.CommentStar:
|
||||
return HtmlSymbolType.RazorCommentStar;
|
||||
case KnownSymbolType.CommentBody:
|
||||
return HtmlSymbolType.RazorComment;
|
||||
case KnownSymbolType.Identifier:
|
||||
return HtmlSymbolType.Text;
|
||||
case KnownSymbolType.Keyword:
|
||||
return HtmlSymbolType.Text;
|
||||
case KnownSymbolType.NewLine:
|
||||
return HtmlSymbolType.NewLine;
|
||||
case KnownSymbolType.Transition:
|
||||
return HtmlSymbolType.Transition;
|
||||
case KnownSymbolType.WhiteSpace:
|
||||
return HtmlSymbolType.WhiteSpace;
|
||||
default:
|
||||
return HtmlSymbolType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Parser
|
||||
{
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ namespace Microsoft.AspNet.Razor.Parser
|
|||
|
||||
public static bool IsCombining(char value)
|
||||
{
|
||||
UnicodeCategory cat= CharUnicodeInfo.GetUnicodeCategory(value);
|
||||
UnicodeCategory cat = CharUnicodeInfo.GetUnicodeCategory(value);
|
||||
|
||||
return cat == UnicodeCategory.SpacingCombiningMark || cat == UnicodeCategory.NonSpacingMark;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Parser
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers.Internal
|
|||
return null;
|
||||
}
|
||||
|
||||
return textSymbol.Type == HtmlSymbolType.WhiteSpace ? null : textSymbol.Content;
|
||||
return textSymbol.Type == HtmlSymbolType.WhiteSpace ? null : textSymbol.Content;
|
||||
}
|
||||
|
||||
private static bool IsSelfClosing(Block beginTagBlock)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.Internal.Web.Utils;
|
||||
|
||||
namespace Microsoft.AspNet.Razor
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ using System.IO;
|
|||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.Internal.Web.Utils;
|
||||
|
||||
namespace Microsoft.AspNet.Razor
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Internal.Web.Utils;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.TagHelpers
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.TagHelpers
|
||||
|
|
|
|||
|
|
@ -27,6 +27,6 @@ namespace Microsoft.AspNet.Razor.TagHelpers
|
|||
/// <summary>
|
||||
/// The <see cref="TagHelperDirectiveType"/> of this directive.
|
||||
/// </summary>
|
||||
public TagHelperDirectiveType DirectiveType { get; private set; }
|
||||
public TagHelperDirectiveType DirectiveType { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.Internal.Web.Utils;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Text
|
||||
{
|
||||
|
|
|
|||
|
|
@ -128,39 +128,39 @@ namespace Microsoft.AspNet.Razor.Tokenizer
|
|||
TakeCurrent();
|
||||
switch (sym)
|
||||
{
|
||||
case '<':
|
||||
return EndSymbol(HtmlSymbolType.OpenAngle);
|
||||
case '!':
|
||||
return EndSymbol(HtmlSymbolType.Bang);
|
||||
case '/':
|
||||
return EndSymbol(HtmlSymbolType.ForwardSlash);
|
||||
case '?':
|
||||
return EndSymbol(HtmlSymbolType.QuestionMark);
|
||||
case '[':
|
||||
return EndSymbol(HtmlSymbolType.LeftBracket);
|
||||
case '>':
|
||||
return EndSymbol(HtmlSymbolType.CloseAngle);
|
||||
case ']':
|
||||
return EndSymbol(HtmlSymbolType.RightBracket);
|
||||
case '=':
|
||||
return EndSymbol(HtmlSymbolType.Equals);
|
||||
case '"':
|
||||
return EndSymbol(HtmlSymbolType.DoubleQuote);
|
||||
case '\'':
|
||||
return EndSymbol(HtmlSymbolType.SingleQuote);
|
||||
case '-':
|
||||
Debug.Assert(CurrentCharacter == '-');
|
||||
TakeCurrent();
|
||||
return EndSymbol(HtmlSymbolType.DoubleHyphen);
|
||||
default:
|
||||
case '<':
|
||||
return EndSymbol(HtmlSymbolType.OpenAngle);
|
||||
case '!':
|
||||
return EndSymbol(HtmlSymbolType.Bang);
|
||||
case '/':
|
||||
return EndSymbol(HtmlSymbolType.ForwardSlash);
|
||||
case '?':
|
||||
return EndSymbol(HtmlSymbolType.QuestionMark);
|
||||
case '[':
|
||||
return EndSymbol(HtmlSymbolType.LeftBracket);
|
||||
case '>':
|
||||
return EndSymbol(HtmlSymbolType.CloseAngle);
|
||||
case ']':
|
||||
return EndSymbol(HtmlSymbolType.RightBracket);
|
||||
case '=':
|
||||
return EndSymbol(HtmlSymbolType.Equals);
|
||||
case '"':
|
||||
return EndSymbol(HtmlSymbolType.DoubleQuote);
|
||||
case '\'':
|
||||
return EndSymbol(HtmlSymbolType.SingleQuote);
|
||||
case '-':
|
||||
Debug.Assert(CurrentCharacter == '-');
|
||||
TakeCurrent();
|
||||
return EndSymbol(HtmlSymbolType.DoubleHyphen);
|
||||
default:
|
||||
#if NET45
|
||||
// No Debug.Fail in CoreCLR
|
||||
// No Debug.Fail in CoreCLR
|
||||
|
||||
Debug.Fail("Unexpected symbol!");
|
||||
Debug.Fail("Unexpected symbol!");
|
||||
#else
|
||||
Debug.Assert(false, "Unexpected symbol");
|
||||
#endif
|
||||
return EndSymbol(HtmlSymbolType.Unknown);
|
||||
return EndSymbol(HtmlSymbolType.Unknown);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using System.Threading;
|
|||
using System.Web.WebPages.TestUtils;
|
||||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Test.Framework;
|
||||
using Microsoft.AspNet.Razor.Test.Utils;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Test.Framework
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Parser.TagHelpers;
|
||||
|
|
|
|||
|
|
@ -128,31 +128,38 @@ namespace Microsoft.AspNet.Razor.Test.Framework
|
|||
expectedErrors ?? new RazorError[0]);
|
||||
}
|
||||
|
||||
protected virtual void ParseDocumentTest(string document) {
|
||||
protected virtual void ParseDocumentTest(string document)
|
||||
{
|
||||
ParseDocumentTest(document, null, false);
|
||||
}
|
||||
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot) {
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot)
|
||||
{
|
||||
ParseDocumentTest(document, expectedRoot, false, null);
|
||||
}
|
||||
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot, params RazorError[] expectedErrors) {
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot, params RazorError[] expectedErrors)
|
||||
{
|
||||
ParseDocumentTest(document, expectedRoot, false, expectedErrors);
|
||||
}
|
||||
|
||||
protected virtual void ParseDocumentTest(string document, bool designTimeParser) {
|
||||
protected virtual void ParseDocumentTest(string document, bool designTimeParser)
|
||||
{
|
||||
ParseDocumentTest(document, null, designTimeParser);
|
||||
}
|
||||
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot, bool designTimeParser) {
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot, bool designTimeParser)
|
||||
{
|
||||
ParseDocumentTest(document, expectedRoot, designTimeParser, null);
|
||||
}
|
||||
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot, bool designTimeParser, params RazorError[] expectedErrors) {
|
||||
protected virtual void ParseDocumentTest(string document, Block expectedRoot, bool designTimeParser, params RazorError[] expectedErrors)
|
||||
{
|
||||
RunParseTest(document, parser => parser.ParseDocument, expectedRoot, expectedErrors, designTimeParser, parserSelector: c => c.MarkupParser);
|
||||
}
|
||||
|
||||
protected virtual ParserResults ParseDocument(string document) {
|
||||
protected virtual ParserResults ParseDocument(string document)
|
||||
{
|
||||
return ParseDocument(document, designTimeParser: false, errorSink: null);
|
||||
}
|
||||
|
||||
|
|
@ -172,11 +179,13 @@ namespace Microsoft.AspNet.Razor.Test.Framework
|
|||
errorSink: errorSink);
|
||||
}
|
||||
|
||||
protected virtual ParserResults ParseBlock(string document) {
|
||||
protected virtual ParserResults ParseBlock(string document)
|
||||
{
|
||||
return ParseBlock(document, designTimeParser: false);
|
||||
}
|
||||
|
||||
protected virtual ParserResults ParseBlock(string document, bool designTimeParser) {
|
||||
protected virtual ParserResults ParseBlock(string document, bool designTimeParser)
|
||||
{
|
||||
return RunParse(document, parser => parser.ParseBlock, designTimeParser);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
#if ASPNETCORE50
|
||||
using System.Reflection;
|
||||
#endif
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
using Xunit;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Test.Framework;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
|
||||
namespace Microsoft.AspNet.Razor
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Test.Generator
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Xunit;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Generator.Compiler
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.WebPages.TestUtils;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
|
@ -124,10 +123,10 @@ namespace Microsoft.AspNet.Razor.Test.Generator
|
|||
"Instrumentation.BeginContext",
|
||||
"Instrumentation.EndContext",
|
||||
new GeneratedTagHelperContext())
|
||||
{
|
||||
LayoutPropertyName = "Layout",
|
||||
ResolveUrlMethodName = "Href"
|
||||
};
|
||||
{
|
||||
LayoutPropertyName = "Layout",
|
||||
ResolveUrlMethodName = "Href"
|
||||
};
|
||||
if (hostConfig != null)
|
||||
{
|
||||
host = hostConfig(host);
|
||||
|
|
@ -138,7 +137,7 @@ namespace Microsoft.AspNet.Razor.Test.Generator
|
|||
|
||||
var engine = new RazorTemplateEngine(host);
|
||||
|
||||
if(templateEngineConfig != null)
|
||||
if (templateEngineConfig != null)
|
||||
{
|
||||
engine = templateEngineConfig(engine);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
#if ASPNETCORE50
|
||||
using System.Reflection;
|
||||
#endif
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Test.Framework;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Test.Framework;
|
||||
using Xunit;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
|||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Moq;
|
||||
using Moq.Protected;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Razor.Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue