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:
Doug Bunting 2014-11-20 14:43:16 -08:00
parent 0f724a51df
commit 26034fb5b2
42 changed files with 204 additions and 215 deletions

View File

@ -28,11 +28,11 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// <param name="output">A stateful HTML element used to generate an HTML tag.</param> /// <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> /// <returns>A <see cref="Task"/> that on completion updates the <paramref name="output"/>.</returns>
/// <remarks>By default this calls into <see cref="Process"/>.</remarks>. /// <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) public virtual async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{ {
Process(context, output); Process(context, output);
} }
#pragma warning restore 1998 #pragma warning restore 1998
} }
} }

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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 namespace Microsoft.AspNet.Razor.Generator
{ {

View File

@ -6,7 +6,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
public class CSharpBaseTypeVisitor : CodeVisitor<CSharpCodeWriter> public class CSharpBaseTypeVisitor : CodeVisitor<CSharpCodeWriter>
{ {
public CSharpBaseTypeVisitor(CSharpCodeWriter writer, CodeBuilderContext context) public CSharpBaseTypeVisitor(CSharpCodeWriter writer, CodeBuilderContext context)
: base(writer, context) { } : base(writer, context)
{ }
public string CurrentBaseType { get; set; } public string CurrentBaseType { get; set; }

View File

@ -8,7 +8,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
public class CSharpClassAttributeVisitor : CodeVisitor<CSharpCodeWriter> public class CSharpClassAttributeVisitor : CodeVisitor<CSharpCodeWriter>
{ {
public CSharpClassAttributeVisitor(CSharpCodeWriter writer, CodeBuilderContext context) public CSharpClassAttributeVisitor(CSharpCodeWriter writer, CodeBuilderContext context)
: base(writer, context) { } : base(writer, context)
{ }
protected override void Visit(SessionStateChunk chunk) protected override void Visit(SessionStateChunk chunk)
{ {

View File

@ -6,7 +6,6 @@ using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;
using Microsoft.AspNet.Razor.TagHelpers;
namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
{ {

View File

@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
{ {
Visit((StatementChunk)chunk); Visit((StatementChunk)chunk);
} }
else if(chunk is TagHelperChunk) else if (chunk is TagHelperChunk)
{ {
Visit((TagHelperChunk)chunk); Visit((TagHelperChunk)chunk);
} }
@ -65,7 +65,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
{ {
Visit((RemoveTagHelperChunk)chunk); Visit((RemoveTagHelperChunk)chunk);
} }
else if(chunk is SetLayoutChunk) else if (chunk is SetLayoutChunk)
{ {
Visit((SetLayoutChunk)chunk); Visit((SetLayoutChunk)chunk);
} }
@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
{ {
Visit((UsingChunk)chunk); Visit((UsingChunk)chunk);
} }
else if(chunk is HelperChunk) else if (chunk is HelperChunk)
{ {
Visit((HelperChunk)chunk); Visit((HelperChunk)chunk);
} }
@ -113,7 +113,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
{ {
Visit((ChunkBlock)chunk); Visit((ChunkBlock)chunk);
} }
else if(chunk is SessionStateChunk) else if (chunk is SessionStateChunk)
{ {
Visit((SessionStateChunk)chunk); Visit((SessionStateChunk)chunk);
} }

View File

@ -6,7 +6,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler
public class CodeVisitor<T> : ChunkVisitor<T> where T : CodeWriter public class CodeVisitor<T> : ChunkVisitor<T> where T : CodeWriter
{ {
public CodeVisitor(T writer, CodeBuilderContext context) public CodeVisitor(T writer, CodeBuilderContext context)
: base(writer, context) { } : base(writer, context)
{ }
protected override void Visit(LiteralChunk chunk) protected override void Visit(LiteralChunk chunk)
{ {

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Editor;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;

View File

@ -253,9 +253,9 @@ namespace Microsoft.AspNet.Razor.Parser
Language.TokenizeString, Language.TokenizeString,
DefaultKeywords, DefaultKeywords,
acceptTrailingDot: IsNested) acceptTrailingDot: IsNested)
{ {
AcceptedCharacters = AcceptedCharacters.NonWhiteSpace AcceptedCharacters = AcceptedCharacters.NonWhiteSpace
}; };
if (At(CSharpSymbolType.WhiteSpace) || At(CSharpSymbolType.NewLine)) if (At(CSharpSymbolType.WhiteSpace) || At(CSharpSymbolType.NewLine))
{ {
Context.OnError(CurrentLocation, RazorResources.ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS); Context.OnError(CurrentLocation, RazorResources.ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS);

View File

@ -102,24 +102,24 @@ namespace Microsoft.AspNet.Razor.Parser
{ {
switch (type) switch (type)
{ {
case KnownSymbolType.Identifier: case KnownSymbolType.Identifier:
return CSharpSymbolType.Identifier; return CSharpSymbolType.Identifier;
case KnownSymbolType.Keyword: case KnownSymbolType.Keyword:
return CSharpSymbolType.Keyword; return CSharpSymbolType.Keyword;
case KnownSymbolType.NewLine: case KnownSymbolType.NewLine:
return CSharpSymbolType.NewLine; return CSharpSymbolType.NewLine;
case KnownSymbolType.WhiteSpace: case KnownSymbolType.WhiteSpace:
return CSharpSymbolType.WhiteSpace; return CSharpSymbolType.WhiteSpace;
case KnownSymbolType.Transition: case KnownSymbolType.Transition:
return CSharpSymbolType.Transition; return CSharpSymbolType.Transition;
case KnownSymbolType.CommentStart: case KnownSymbolType.CommentStart:
return CSharpSymbolType.RazorCommentTransition; return CSharpSymbolType.RazorCommentTransition;
case KnownSymbolType.CommentStar: case KnownSymbolType.CommentStar:
return CSharpSymbolType.RazorCommentStar; return CSharpSymbolType.RazorCommentStar;
case KnownSymbolType.CommentBody: case KnownSymbolType.CommentBody:
return CSharpSymbolType.RazorComment; return CSharpSymbolType.RazorComment;
default: default:
return CSharpSymbolType.Unknown; return CSharpSymbolType.Unknown;
} }
} }
@ -127,30 +127,30 @@ namespace Microsoft.AspNet.Razor.Parser
{ {
switch (bracket) switch (bracket)
{ {
case CSharpSymbolType.LeftBrace: case CSharpSymbolType.LeftBrace:
return CSharpSymbolType.RightBrace; return CSharpSymbolType.RightBrace;
case CSharpSymbolType.LeftBracket: case CSharpSymbolType.LeftBracket:
return CSharpSymbolType.RightBracket; return CSharpSymbolType.RightBracket;
case CSharpSymbolType.LeftParenthesis: case CSharpSymbolType.LeftParenthesis:
return CSharpSymbolType.RightParenthesis; return CSharpSymbolType.RightParenthesis;
case CSharpSymbolType.LessThan: case CSharpSymbolType.LessThan:
return CSharpSymbolType.GreaterThan; return CSharpSymbolType.GreaterThan;
case CSharpSymbolType.RightBrace: case CSharpSymbolType.RightBrace:
return CSharpSymbolType.LeftBrace; return CSharpSymbolType.LeftBrace;
case CSharpSymbolType.RightBracket: case CSharpSymbolType.RightBracket:
return CSharpSymbolType.LeftBracket; return CSharpSymbolType.LeftBracket;
case CSharpSymbolType.RightParenthesis: case CSharpSymbolType.RightParenthesis:
return CSharpSymbolType.LeftParenthesis; return CSharpSymbolType.LeftParenthesis;
case CSharpSymbolType.GreaterThan: case CSharpSymbolType.GreaterThan:
return CSharpSymbolType.LessThan; return CSharpSymbolType.LessThan;
default: default:
#if NET45 #if NET45
// No Debug.Fail // No Debug.Fail
Debug.Fail("FlipBracket must be called with a bracket character"); Debug.Fail("FlipBracket must be called with a bracket character");
#else #else
Debug.Assert(false, "FlipBracket must be called with a bracket character"); Debug.Assert(false, "FlipBracket must be called with a bracket character");
#endif #endif
return CSharpSymbolType.Unknown; return CSharpSymbolType.Unknown;
} }
} }
@ -167,26 +167,26 @@ namespace Microsoft.AspNet.Razor.Parser
{ {
switch (type) switch (type)
{ {
case CSharpSymbolType.Identifier: case CSharpSymbolType.Identifier:
return RazorResources.CSharpSymbol_Identifier; return RazorResources.CSharpSymbol_Identifier;
case CSharpSymbolType.Keyword: case CSharpSymbolType.Keyword:
return RazorResources.CSharpSymbol_Keyword; return RazorResources.CSharpSymbol_Keyword;
case CSharpSymbolType.IntegerLiteral: case CSharpSymbolType.IntegerLiteral:
return RazorResources.CSharpSymbol_IntegerLiteral; return RazorResources.CSharpSymbol_IntegerLiteral;
case CSharpSymbolType.NewLine: case CSharpSymbolType.NewLine:
return RazorResources.CSharpSymbol_Newline; return RazorResources.CSharpSymbol_Newline;
case CSharpSymbolType.WhiteSpace: case CSharpSymbolType.WhiteSpace:
return RazorResources.CSharpSymbol_Whitespace; return RazorResources.CSharpSymbol_Whitespace;
case CSharpSymbolType.Comment: case CSharpSymbolType.Comment:
return RazorResources.CSharpSymbol_Comment; return RazorResources.CSharpSymbol_Comment;
case CSharpSymbolType.RealLiteral: case CSharpSymbolType.RealLiteral:
return RazorResources.CSharpSymbol_RealLiteral; return RazorResources.CSharpSymbol_RealLiteral;
case CSharpSymbolType.CharacterLiteral: case CSharpSymbolType.CharacterLiteral:
return RazorResources.CSharpSymbol_CharacterLiteral; return RazorResources.CSharpSymbol_CharacterLiteral;
case CSharpSymbolType.StringLiteral: case CSharpSymbolType.StringLiteral:
return RazorResources.CSharpSymbol_StringLiteral; return RazorResources.CSharpSymbol_StringLiteral;
default: default:
return RazorResources.Symbol_Unknown; return RazorResources.Symbol_Unknown;
} }
} }
return sample; return sample;

View File

@ -28,46 +28,46 @@ namespace Microsoft.AspNet.Razor.Parser
{ {
switch (type) switch (type)
{ {
case HtmlSymbolType.Text: case HtmlSymbolType.Text:
return RazorResources.HtmlSymbol_Text; return RazorResources.HtmlSymbol_Text;
case HtmlSymbolType.WhiteSpace: case HtmlSymbolType.WhiteSpace:
return RazorResources.HtmlSymbol_WhiteSpace; return RazorResources.HtmlSymbol_WhiteSpace;
case HtmlSymbolType.NewLine: case HtmlSymbolType.NewLine:
return RazorResources.HtmlSymbol_NewLine; return RazorResources.HtmlSymbol_NewLine;
case HtmlSymbolType.OpenAngle: case HtmlSymbolType.OpenAngle:
return "<"; return "<";
case HtmlSymbolType.Bang: case HtmlSymbolType.Bang:
return "!"; return "!";
case HtmlSymbolType.ForwardSlash: case HtmlSymbolType.ForwardSlash:
return "/"; return "/";
case HtmlSymbolType.QuestionMark: case HtmlSymbolType.QuestionMark:
return "?"; return "?";
case HtmlSymbolType.DoubleHyphen: case HtmlSymbolType.DoubleHyphen:
return "--"; return "--";
case HtmlSymbolType.LeftBracket: case HtmlSymbolType.LeftBracket:
return "["; return "[";
case HtmlSymbolType.CloseAngle: case HtmlSymbolType.CloseAngle:
return ">"; return ">";
case HtmlSymbolType.RightBracket: case HtmlSymbolType.RightBracket:
return "]"; return "]";
case HtmlSymbolType.Equals: case HtmlSymbolType.Equals:
return "="; return "=";
case HtmlSymbolType.DoubleQuote: case HtmlSymbolType.DoubleQuote:
return "\""; return "\"";
case HtmlSymbolType.SingleQuote: case HtmlSymbolType.SingleQuote:
return "'"; return "'";
case HtmlSymbolType.Transition: case HtmlSymbolType.Transition:
return "@"; return "@";
case HtmlSymbolType.Colon: case HtmlSymbolType.Colon:
return ":"; return ":";
case HtmlSymbolType.RazorComment: case HtmlSymbolType.RazorComment:
return RazorResources.HtmlSymbol_RazorComment; return RazorResources.HtmlSymbol_RazorComment;
case HtmlSymbolType.RazorCommentStar: case HtmlSymbolType.RazorCommentStar:
return "*"; return "*";
case HtmlSymbolType.RazorCommentTransition: case HtmlSymbolType.RazorCommentTransition:
return "@"; return "@";
default: default:
return RazorResources.Symbol_Unknown; return RazorResources.Symbol_Unknown;
} }
} }
@ -80,23 +80,23 @@ namespace Microsoft.AspNet.Razor.Parser
{ {
switch (bracket) switch (bracket)
{ {
case HtmlSymbolType.LeftBracket: case HtmlSymbolType.LeftBracket:
return HtmlSymbolType.RightBracket; return HtmlSymbolType.RightBracket;
case HtmlSymbolType.OpenAngle: case HtmlSymbolType.OpenAngle:
return HtmlSymbolType.CloseAngle; return HtmlSymbolType.CloseAngle;
case HtmlSymbolType.RightBracket: case HtmlSymbolType.RightBracket:
return HtmlSymbolType.LeftBracket; return HtmlSymbolType.LeftBracket;
case HtmlSymbolType.CloseAngle: case HtmlSymbolType.CloseAngle:
return HtmlSymbolType.OpenAngle; return HtmlSymbolType.OpenAngle;
default: default:
#if NET45 #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 #else
Debug.Assert(false, "FlipBracket must be called with a bracket character"); Debug.Assert(false, "FlipBracket must be called with a bracket character");
#endif #endif
return HtmlSymbolType.Unknown; return HtmlSymbolType.Unknown;
} }
} }
@ -109,24 +109,24 @@ namespace Microsoft.AspNet.Razor.Parser
{ {
switch (type) switch (type)
{ {
case KnownSymbolType.CommentStart: case KnownSymbolType.CommentStart:
return HtmlSymbolType.RazorCommentTransition; return HtmlSymbolType.RazorCommentTransition;
case KnownSymbolType.CommentStar: case KnownSymbolType.CommentStar:
return HtmlSymbolType.RazorCommentStar; return HtmlSymbolType.RazorCommentStar;
case KnownSymbolType.CommentBody: case KnownSymbolType.CommentBody:
return HtmlSymbolType.RazorComment; return HtmlSymbolType.RazorComment;
case KnownSymbolType.Identifier: case KnownSymbolType.Identifier:
return HtmlSymbolType.Text; return HtmlSymbolType.Text;
case KnownSymbolType.Keyword: case KnownSymbolType.Keyword:
return HtmlSymbolType.Text; return HtmlSymbolType.Text;
case KnownSymbolType.NewLine: case KnownSymbolType.NewLine:
return HtmlSymbolType.NewLine; return HtmlSymbolType.NewLine;
case KnownSymbolType.Transition: case KnownSymbolType.Transition:
return HtmlSymbolType.Transition; return HtmlSymbolType.Transition;
case KnownSymbolType.WhiteSpace: case KnownSymbolType.WhiteSpace:
return HtmlSymbolType.WhiteSpace; return HtmlSymbolType.WhiteSpace;
default: default:
return HtmlSymbolType.Unknown; return HtmlSymbolType.Unknown;
} }
} }

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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 namespace Microsoft.AspNet.Razor.Parser
{ {

View File

@ -116,7 +116,7 @@ namespace Microsoft.AspNet.Razor.Parser
public static bool IsCombining(char value) public static bool IsCombining(char value)
{ {
UnicodeCategory cat= CharUnicodeInfo.GetUnicodeCategory(value); UnicodeCategory cat = CharUnicodeInfo.GetUnicodeCategory(value);
return cat == UnicodeCategory.SpacingCombiningMark || cat == UnicodeCategory.NonSpacingMark; return cat == UnicodeCategory.SpacingCombiningMark || cat == UnicodeCategory.NonSpacingMark;

View File

@ -3,7 +3,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Text;
namespace Microsoft.AspNet.Razor.Parser namespace Microsoft.AspNet.Razor.Parser
{ {

View File

@ -1,9 +1,7 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.TagHelpers; using Microsoft.AspNet.Razor.TagHelpers;

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;

View File

@ -233,7 +233,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers.Internal
return null; return null;
} }
return textSymbol.Type == HtmlSymbolType.WhiteSpace ? null : textSymbol.Content; return textSymbol.Type == HtmlSymbolType.WhiteSpace ? null : textSymbol.Content;
} }
private static bool IsSelfClosing(Block beginTagBlock) private static bool IsSelfClosing(Block beginTagBlock)

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Editor;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;

View File

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.Internal.Web.Utils;
namespace Microsoft.AspNet.Razor namespace Microsoft.AspNet.Razor
{ {

View File

@ -9,7 +9,6 @@ using System.IO;
using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Editor;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;
using Microsoft.Internal.Web.Utils;
namespace Microsoft.AspNet.Razor namespace Microsoft.AspNet.Razor
{ {

View File

@ -4,14 +4,12 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO; using System.IO;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Generator.Compiler; using Microsoft.AspNet.Razor.Generator.Compiler;
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.Internal.Web.Utils;
namespace Microsoft.AspNet.Razor.TagHelpers namespace Microsoft.AspNet.Razor.TagHelpers
{ {

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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.Collections.Generic;
namespace Microsoft.AspNet.Razor.TagHelpers namespace Microsoft.AspNet.Razor.TagHelpers

View File

@ -27,6 +27,6 @@ namespace Microsoft.AspNet.Razor.TagHelpers
/// <summary> /// <summary>
/// The <see cref="TagHelperDirectiveType"/> of this directive. /// The <see cref="TagHelperDirectiveType"/> of this directive.
/// </summary> /// </summary>
public TagHelperDirectiveType DirectiveType { get; private set; } public TagHelperDirectiveType DirectiveType { get; private set; }
} }
} }

View File

@ -6,7 +6,6 @@ using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Text; using System.Text;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.Internal.Web.Utils;
namespace Microsoft.AspNet.Razor.Text namespace Microsoft.AspNet.Razor.Text
{ {

View File

@ -128,39 +128,39 @@ namespace Microsoft.AspNet.Razor.Tokenizer
TakeCurrent(); TakeCurrent();
switch (sym) switch (sym)
{ {
case '<': case '<':
return EndSymbol(HtmlSymbolType.OpenAngle); return EndSymbol(HtmlSymbolType.OpenAngle);
case '!': case '!':
return EndSymbol(HtmlSymbolType.Bang); return EndSymbol(HtmlSymbolType.Bang);
case '/': case '/':
return EndSymbol(HtmlSymbolType.ForwardSlash); return EndSymbol(HtmlSymbolType.ForwardSlash);
case '?': case '?':
return EndSymbol(HtmlSymbolType.QuestionMark); return EndSymbol(HtmlSymbolType.QuestionMark);
case '[': case '[':
return EndSymbol(HtmlSymbolType.LeftBracket); return EndSymbol(HtmlSymbolType.LeftBracket);
case '>': case '>':
return EndSymbol(HtmlSymbolType.CloseAngle); return EndSymbol(HtmlSymbolType.CloseAngle);
case ']': case ']':
return EndSymbol(HtmlSymbolType.RightBracket); return EndSymbol(HtmlSymbolType.RightBracket);
case '=': case '=':
return EndSymbol(HtmlSymbolType.Equals); return EndSymbol(HtmlSymbolType.Equals);
case '"': case '"':
return EndSymbol(HtmlSymbolType.DoubleQuote); return EndSymbol(HtmlSymbolType.DoubleQuote);
case '\'': case '\'':
return EndSymbol(HtmlSymbolType.SingleQuote); return EndSymbol(HtmlSymbolType.SingleQuote);
case '-': case '-':
Debug.Assert(CurrentCharacter == '-'); Debug.Assert(CurrentCharacter == '-');
TakeCurrent(); TakeCurrent();
return EndSymbol(HtmlSymbolType.DoubleHyphen); return EndSymbol(HtmlSymbolType.DoubleHyphen);
default: default:
#if NET45 #if NET45
// No Debug.Fail in CoreCLR // No Debug.Fail in CoreCLR
Debug.Fail("Unexpected symbol!"); Debug.Fail("Unexpected symbol!");
#else #else
Debug.Assert(false, "Unexpected symbol"); Debug.Assert(false, "Unexpected symbol");
#endif #endif
return EndSymbol(HtmlSymbolType.Unknown); return EndSymbol(HtmlSymbolType.Unknown);
} }
} }

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;
using Microsoft.AspNet.Razor.Tokenizer.Symbols; using Microsoft.AspNet.Razor.Tokenizer.Symbols;

View File

@ -6,7 +6,6 @@ using System.Threading;
using System.Web.WebPages.TestUtils; using System.Web.WebPages.TestUtils;
using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Editor;
using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Test.Framework;
using Microsoft.AspNet.Razor.Test.Utils; using Microsoft.AspNet.Razor.Test.Utils;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
namespace Microsoft.AspNet.Razor.Test.Framework namespace Microsoft.AspNet.Razor.Test.Framework

View File

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Parser.TagHelpers; using Microsoft.AspNet.Razor.Parser.TagHelpers;

View File

@ -128,31 +128,38 @@ namespace Microsoft.AspNet.Razor.Test.Framework
expectedErrors ?? new RazorError[0]); expectedErrors ?? new RazorError[0]);
} }
protected virtual void ParseDocumentTest(string document) { protected virtual void ParseDocumentTest(string document)
{
ParseDocumentTest(document, null, false); 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); 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); 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); 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); 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); 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); return ParseDocument(document, designTimeParser: false, errorSink: null);
} }
@ -172,11 +179,13 @@ namespace Microsoft.AspNet.Razor.Test.Framework
errorSink: errorSink); errorSink: errorSink);
} }
protected virtual ParserResults ParseBlock(string document) { protected virtual ParserResults ParseBlock(string document)
{
return ParseBlock(document, designTimeParser: false); 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); return RunParse(document, parser => parser.ParseBlock, designTimeParser);
} }

View File

@ -2,7 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic; using System.Collections.Generic;
#if ASPNETCORE50
using System.Reflection; using System.Reflection;
#endif
using Microsoft.AspNet.Razor.Generator.Compiler; using Microsoft.AspNet.Razor.Generator.Compiler;
using Microsoft.AspNet.Razor.TagHelpers; using Microsoft.AspNet.Razor.TagHelpers;
using Xunit; using Xunit;

View File

@ -1,12 +1,12 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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.Generator.Compiler;
using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Test.Framework;
using System.Linq;
using Xunit; using Xunit;
using Microsoft.AspNet.Razor.Parser;
namespace Microsoft.AspNet.Razor namespace Microsoft.AspNet.Razor
{ {

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Xunit; using Xunit;
namespace Microsoft.AspNet.Razor.Test.Generator namespace Microsoft.AspNet.Razor.Test.Generator

View File

@ -2,9 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using System.Collections.Generic;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;
using Xunit; using Xunit;
using System.Collections.Generic;
namespace Microsoft.AspNet.Razor.Generator.Compiler namespace Microsoft.AspNet.Razor.Generator.Compiler
{ {

View File

@ -6,7 +6,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.WebPages.TestUtils;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Generator.Compiler; using Microsoft.AspNet.Razor.Generator.Compiler;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
@ -124,10 +123,10 @@ namespace Microsoft.AspNet.Razor.Test.Generator
"Instrumentation.BeginContext", "Instrumentation.BeginContext",
"Instrumentation.EndContext", "Instrumentation.EndContext",
new GeneratedTagHelperContext()) new GeneratedTagHelperContext())
{ {
LayoutPropertyName = "Layout", LayoutPropertyName = "Layout",
ResolveUrlMethodName = "Href" ResolveUrlMethodName = "Href"
}; };
if (hostConfig != null) if (hostConfig != null)
{ {
host = hostConfig(host); host = hostConfig(host);
@ -138,7 +137,7 @@ namespace Microsoft.AspNet.Razor.Test.Generator
var engine = new RazorTemplateEngine(host); var engine = new RazorTemplateEngine(host);
if(templateEngineConfig != null) if (templateEngineConfig != null)
{ {
engine = templateEngineConfig(engine); engine = templateEngineConfig(engine);
} }

View File

@ -2,7 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
#if ASPNETCORE50
using System.Reflection; using System.Reflection;
#endif
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Generator.Compiler; using Microsoft.AspNet.Razor.Generator.Compiler;
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp; using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // 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;
using Microsoft.AspNet.Razor.Parser.SyntaxTree; using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Test.Framework;

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Editor;
using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Generator;

View File

@ -3,7 +3,6 @@
using System; using System;
using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Test.Framework;
using Xunit; using Xunit;

View File

@ -13,7 +13,6 @@ using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Text;
using Moq; using Moq;
using Moq.Protected;
using Xunit; using Xunit;
namespace Microsoft.AspNet.Razor.Test namespace Microsoft.AspNet.Razor.Test