diff --git a/src/Microsoft.AspNet.Razor/CSharpRazorCodeLanguage.cs b/src/Microsoft.AspNet.Razor/CSharpRazorCodeLanguage.cs
index 852c849a17..834fad0a84 100644
--- a/src/Microsoft.AspNet.Razor/CSharpRazorCodeLanguage.cs
+++ b/src/Microsoft.AspNet.Razor/CSharpRazorCodeLanguage.cs
@@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Razor
{
get { return CSharpLanguageName; }
}
-
+#if NET45
///
/// Returns the type of the CodeDOM provider for this language
///
@@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Razor
{
get { return typeof(CSharpCodeProvider); }
}
-
+#endif
///
/// Constructs a new instance of the code parser for this language
///
diff --git a/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs b/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs
index 38d34b2300..4845a60641 100644
--- a/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs
+++ b/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs
@@ -8,10 +8,11 @@
//
//------------------------------------------------------------------------------
-namespace Microsoft.Internal.Web.Utils {
+namespace Microsoft.Internal.Web.Utils
+{
using System;
-
-
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
@@ -22,112 +23,137 @@ namespace Microsoft.Internal.Web.Utils {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class CommonResources {
-
+ internal class CommonResources
+ {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal CommonResources() {
+ internal CommonResources()
+ {
}
-
+
///
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+#if NET45
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.Razor.Common.CommonResources", typeof(CommonResources).Assembly);
resourceMan = temp;
}
+#endif
return resourceMan;
}
}
-
+
///
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
return resourceCulture;
}
- set {
+ set
+ {
resourceCulture = value;
}
}
-
+
///
/// Looks up a localized string similar to Value cannot be null or an empty string..
///
- internal static string Argument_Cannot_Be_Null_Or_Empty {
- get {
+ internal static string Argument_Cannot_Be_Null_Or_Empty
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Cannot_Be_Null_Or_Empty", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value must be between {0} and {1}..
///
- internal static string Argument_Must_Be_Between {
- get {
+ internal static string Argument_Must_Be_Between
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_Between", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value must be a value from the "{0}" enumeration..
///
- internal static string Argument_Must_Be_Enum_Member {
- get {
+ internal static string Argument_Must_Be_Enum_Member
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_Enum_Member", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value must be greater than {0}..
///
- internal static string Argument_Must_Be_GreaterThan {
- get {
+ internal static string Argument_Must_Be_GreaterThan
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_GreaterThan", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value must be greater than or equal to {0}..
///
- internal static string Argument_Must_Be_GreaterThanOrEqualTo {
- get {
+ internal static string Argument_Must_Be_GreaterThanOrEqualTo
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_GreaterThanOrEqualTo", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value must be less than {0}..
///
- internal static string Argument_Must_Be_LessThan {
- get {
+ internal static string Argument_Must_Be_LessThan
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_LessThan", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value must be less than or equal to {0}..
///
- internal static string Argument_Must_Be_LessThanOrEqualTo {
- get {
+ internal static string Argument_Must_Be_LessThanOrEqualTo
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_LessThanOrEqualTo", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Value cannot be an empty string. It must either be null or a non-empty string..
///
- internal static string Argument_Must_Be_Null_Or_Non_Empty {
- get {
+ internal static string Argument_Must_Be_Null_Or_Non_Empty
+ {
+ get
+ {
return ResourceManager.GetString("Argument_Must_Be_Null_Or_Non_Empty", resourceCulture);
}
}
diff --git a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs
index ff953d54c6..d50c381a53 100644
--- a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs
+++ b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs
@@ -424,7 +424,9 @@ namespace Microsoft.AspNet.Razor.Editor
else
{
RazorEditorTrace.TraceLine(RazorResources.Trace_NoChangesArrived, fileNameOnly, parcel.Changes.Count);
+#if NET45
Thread.Yield();
+#endif
}
}
}
diff --git a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs
index 036e7ee1fd..2ce399b863 100644
--- a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs
+++ b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs
@@ -24,10 +24,12 @@ namespace Microsoft.AspNet.Razor.Editor
bool enabled;
if (Boolean.TryParse(Environment.GetEnvironmentVariable("RAZOR_EDITOR_TRACE"), out enabled))
{
+#if NET45
Trace.WriteLine(String.Format(
CultureInfo.CurrentCulture,
RazorResources.Trace_Startup,
enabled ? RazorResources.Trace_Enabled : RazorResources.Trace_Disabled));
+#endif
_enabled = enabled;
}
else
@@ -43,10 +45,12 @@ namespace Microsoft.AspNet.Razor.Editor
{
if (IsEnabled())
{
+#if NET45
Trace.WriteLine(String.Format(
CultureInfo.CurrentCulture,
RazorResources.Trace_Format,
String.Format(CultureInfo.CurrentCulture, format, args)));
+#endif
}
}
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs
index a7d7732836..4c4701c00a 100644
--- a/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs
@@ -35,6 +35,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
// Try to find the namespace in the existing imports
string ns = Namespace;
if (!String.IsNullOrEmpty(ns) && Char.IsWhiteSpace(ns[0]))
@@ -57,7 +58,7 @@ namespace Microsoft.AspNet.Razor.Generator
// Attach our info to the existing/new import.
import.LinePragma = context.GenerateLinePragma(target);
-
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs
index 1dabc940c4..60bd6249da 100644
--- a/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs
@@ -33,6 +33,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
if (context.Host.DesignTimeMode)
{
return; // Don't generate anything!
@@ -56,10 +57,8 @@ namespace Microsoft.AspNet.Razor.Generator
cw.WriteLocationTaggedString(Prefix);
cw.WriteParameterSeparator();
cw.WriteLocationTaggedString(Suffix);
-
- // In VB, we need a line continuation
- cw.WriteLineContinuation();
}));
+#endif
// TODO: Make this generate the primary generator
GenerateStartBlockCode(target, context.CodeTreeBuilder, context);
@@ -72,6 +71,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateEndBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
if (context.Host.DesignTimeMode)
{
return; // Don't generate anything!
@@ -83,7 +83,7 @@ namespace Microsoft.AspNet.Razor.Generator
cw.WriteEndMethodInvoke();
cw.WriteEndStatement();
}));
-
+#endif
// TODO: Make this generate the primary generator
GenerateEndBlockCode(target, context.CodeTreeBuilder, context);
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/CSharpRazorCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/CSharpRazorCodeGenerator.cs
index fcb1f27d53..b1b4458feb 100644
--- a/src/Microsoft.AspNet.Razor/Generator/CSharpRazorCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/CSharpRazorCodeGenerator.cs
@@ -24,8 +24,9 @@ namespace Microsoft.AspNet.Razor.Generator
protected override void Initialize(CodeGeneratorContext context)
{
base.Initialize(context);
-
+#if NET45
context.GeneratedClass.Members.Insert(0, new CodeSnippetTypeMember(HiddenLinePragma));
+#endif
}
}
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/CodeGenerationCompleteEventArgs.cs b/src/Microsoft.AspNet.Razor/Generator/CodeGenerationCompleteEventArgs.cs
deleted file mode 100644
index 32c12aac20..0000000000
--- a/src/Microsoft.AspNet.Razor/Generator/CodeGenerationCompleteEventArgs.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.CodeDom;
-using Microsoft.Internal.Web.Utils;
-
-namespace Microsoft.AspNet.Razor.Generator
-{
- public class CodeGenerationCompleteEventArgs : EventArgs
- {
- public CodeGenerationCompleteEventArgs(string virtualPath, string physicalPath, CodeCompileUnit generatedCode)
- {
- if (String.IsNullOrEmpty(virtualPath))
- {
- throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "virtualPath");
- }
- if (generatedCode == null)
- {
- throw new ArgumentNullException("generatedCode");
- }
- VirtualPath = virtualPath;
- PhysicalPath = physicalPath;
- GeneratedCode = generatedCode;
- }
-
- public CodeCompileUnit GeneratedCode { get; private set; }
- public string VirtualPath { get; private set; }
- public string PhysicalPath { get; private set; }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs b/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs
index 8ae0cb43ea..7a65fbf036 100644
--- a/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs
@@ -20,11 +20,6 @@ namespace Microsoft.AspNet.Razor.Generator
{
internal const string DesignTimeHelperMethodName = "__RazorDesignTimeHelpers__";
- private int _nextDesignTimePragmaId = 1;
- private bool _expressionHelperVariableWriten;
- private CodeMemberMethod _designTimeHelperMethod;
- private StatementBuffer _currentBuffer = new StatementBuffer();
-
private CodeGeneratorContext()
{
ExpressionRenderingMode = ExpressionRenderingMode.WriteToOutput;
@@ -33,62 +28,29 @@ namespace Microsoft.AspNet.Razor.Generator
// Internal/Private state. Technically consumers might want to use some of these but they can implement them independently if necessary.
// It's way safer to make them internal for now, especially with the code generator stuff in a bit of flux.
internal ExpressionRenderingMode ExpressionRenderingMode { get; set; }
+ public string SourceFile { get; internal set; }
+
+ #region deletable
+#if NET45
+ private int _nextDesignTimePragmaId = 1;
+ private bool _expressionHelperVariableWriten;
+ private CodeMemberMethod _designTimeHelperMethod;
+ private StatementBuffer _currentBuffer = new StatementBuffer();
+
private Action StatementCollector { get; set; }
private Func CodeWriterFactory { get; set; }
- public string SourceFile { get; internal set; }
public CodeCompileUnit CompileUnit { get; internal set; }
+
public CodeNamespace Namespace { get; internal set; }
public CodeTypeDeclaration GeneratedClass { get; internal set; }
- public RazorEngineHost Host { get; private set; }
- public IDictionary CodeMappings { get; private set; }
- public string TargetWriterName { get; set; }
public CodeMemberMethod TargetMethod { get; set; }
-
- public CodeTreeBuilder CodeTreeBuilder { get; set; }
-
+ public IDictionary CodeMappings { get; private set; }
public string CurrentBufferedStatement
{
get { return _currentBuffer == null ? String.Empty : _currentBuffer.Builder.ToString(); }
}
- public static CodeGeneratorContext Create(RazorEngineHost host, string className, string rootNamespace, string sourceFile, bool shouldGenerateLinePragmas)
- {
- return Create(host, null, className, rootNamespace, sourceFile, shouldGenerateLinePragmas);
- }
-
- internal static CodeGeneratorContext Create(RazorEngineHost host, Func writerFactory, string className, string rootNamespace, string sourceFile, bool shouldGenerateLinePragmas)
- {
- CodeGeneratorContext context = new CodeGeneratorContext()
- {
- CodeTreeBuilder = new CodeTreeBuilder(),
- Host = host,
- CodeWriterFactory = writerFactory,
- SourceFile = shouldGenerateLinePragmas ? sourceFile : null,
- CompileUnit = new CodeCompileUnit(),
- Namespace = new CodeNamespace(rootNamespace),
- GeneratedClass = new CodeTypeDeclaration(className)
- {
- IsClass = true
- },
- TargetMethod = new CodeMemberMethod()
- {
- Name = host.GeneratedClassContext.ExecuteMethodName,
- Attributes = MemberAttributes.Override | MemberAttributes.Public
- },
- CodeMappings = new Dictionary()
- };
- context.CompileUnit.Namespaces.Add(context.Namespace);
- context.Namespace.Types.Add(context.GeneratedClass);
- context.GeneratedClass.Members.Add(context.TargetMethod);
-
- context.Namespace.Imports.AddRange(host.NamespaceImports
- .Select(s => new CodeNamespaceImport(s))
- .ToArray());
-
- return context;
- }
-
public void AddDesignTimeHelperStatement(CodeSnippetStatement statement)
{
if (_designTimeHelperMethod == null)
@@ -184,7 +146,7 @@ namespace Microsoft.AspNet.Razor.Generator
}
int paddingLength; // unused, in this case there is enough context in the original code to calculate the right padding length
- // (padded.Length - _currentBuffer.Builder.Length)
+ // (padded.Length - _currentBuffer.Builder.Length)
string padded = CodeGeneratorPaddingHelper.Pad(Host, _currentBuffer.Builder.ToString(), sourceSpan, start, out paddingLength);
_currentBuffer.GeneratedCodeStart = start + (padded.Length - _currentBuffer.Builder.Length);
@@ -335,5 +297,52 @@ namespace Microsoft.AspNet.Razor.Generator
CodeLength = Builder.Length - GeneratedCodeStart;
}
}
+#endif
+ #endregion
+
+ public RazorEngineHost Host { get; private set; }
+ public string TargetWriterName { get; set; }
+
+ public CodeTreeBuilder CodeTreeBuilder { get; set; }
+
+ public static CodeGeneratorContext Create(RazorEngineHost host, string className, string rootNamespace, string sourceFile, bool shouldGenerateLinePragmas)
+ {
+ return Create(host, null, className, rootNamespace, sourceFile, shouldGenerateLinePragmas);
+ }
+
+ internal static CodeGeneratorContext Create(RazorEngineHost host, Func writerFactory, string className, string rootNamespace, string sourceFile, bool shouldGenerateLinePragmas)
+ {
+ CodeGeneratorContext context = new CodeGeneratorContext()
+ {
+ CodeTreeBuilder = new CodeTreeBuilder(),
+ Host = host,
+ SourceFile = shouldGenerateLinePragmas ? sourceFile : null,
+#if NET45
+ CodeWriterFactory = writerFactory,
+ CompileUnit = new CodeCompileUnit(),
+ Namespace = new CodeNamespace(rootNamespace),
+ GeneratedClass = new CodeTypeDeclaration(className)
+ {
+ IsClass = true
+ },
+ TargetMethod = new CodeMemberMethod()
+ {
+ Name = host.GeneratedClassContext.ExecuteMethodName,
+ Attributes = MemberAttributes.Override | MemberAttributes.Public
+ },
+ CodeMappings = new Dictionary()
+#endif
+ };
+#if NET45
+ context.CompileUnit.Namespaces.Add(context.Namespace);
+ context.Namespace.Types.Add(context.GeneratedClass);
+ context.GeneratedClass.Members.Add(context.TargetMethod);
+
+ context.Namespace.Imports.AddRange(host.NamespaceImports
+ .Select(s => new CodeNamespaceImport(s))
+ .ToArray());
+#endif
+ return context;
+ }
}
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorPaddingHelper.cs b/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorPaddingHelper.cs
index d1bd8f5d20..f689058b33 100644
--- a/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorPaddingHelper.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorPaddingHelper.cs
@@ -9,6 +9,7 @@ using Microsoft.AspNet.Razor.Parser.SyntaxTree;
namespace Microsoft.AspNet.Razor.Generator
{
+ #if NET45
internal static class CodeGeneratorPaddingHelper
{
private static readonly char[] _newLineChars = { '\r', '\n' };
@@ -201,4 +202,5 @@ namespace Microsoft.AspNet.Razor.Generator
return padding;
}
}
+#endif
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/CodeWriter.cs b/src/Microsoft.AspNet.Razor/Generator/CodeWriter.cs
index 8f378f162d..afd54fd9f2 100644
--- a/src/Microsoft.AspNet.Razor/Generator/CodeWriter.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/CodeWriter.cs
@@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Razor.Generator
public abstract void WriteSnippet(string snippet);
public abstract void WriteStringLiteral(string literal);
public abstract int WriteVariableDeclaration(string type, string name, string value);
-
+#if NET45
public virtual void WriteLinePragma()
{
WriteLinePragma(null);
@@ -71,6 +71,17 @@ namespace Microsoft.AspNet.Razor.Generator
}
}
+ public CodeSnippetStatement ToStatement()
+ {
+ return new CodeSnippetStatement(Content);
+ }
+
+ public CodeSnippetTypeMember ToTypeMember()
+ {
+ return new CodeSnippetTypeMember(Content);
+ }
+#endif
+
public virtual void WriteHiddenLinePragma()
{
}
@@ -157,7 +168,9 @@ namespace Microsoft.AspNet.Razor.Generator
public virtual void WriteBooleanLiteral(bool value)
{
+#if NET45
WriteSnippet(value.ToString(CultureInfo.InvariantCulture));
+#endif
}
public void Dispose()
@@ -174,16 +187,6 @@ namespace Microsoft.AspNet.Razor.Generator
}
}
- public CodeSnippetStatement ToStatement()
- {
- return new CodeSnippetStatement(Content);
- }
-
- public CodeSnippetTypeMember ToTypeMember()
- {
- return new CodeSnippetTypeMember(Content);
- }
-
protected internal abstract void EmitStartLambdaDelegate(string[] parameterNames);
protected internal abstract void EmitStartLambdaExpression(string[] parameterNames);
protected internal abstract void EmitStartConstructor(string typeName);
diff --git a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeBuilder.cs b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeBuilder.cs
index 447d951cb7..8b1f98d2d6 100644
--- a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeBuilder.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeBuilder.cs
@@ -29,7 +29,9 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
writer.WriteComment(new string('-', 78))
.WriteComment("")
.WriteComment(" This code was generated by a tool.")
+#if NET45
.WriteComment(" Runtime Version: " + Assembly.GetExecutingAssembly().ImageRuntimeVersion)
+#endif
.WriteComment("")
.WriteComment(" Changes to this file may cause incorrect behavior and will be lost if")
.WriteComment(" the code is regenerated.")
@@ -45,7 +47,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
// TODO: Include current projects namespace? Does that happen to be included in the namespace imports?
var baseTypeVisitor = new CSharpBaseTypeVisitor(writer);
-
+
baseTypeVisitor.Accept(Tree.Chunks);
string baseType = baseTypeVisitor.CurrentBaseType ?? Host.DefaultBaseClass;
@@ -55,7 +57,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
new CSharpClassAttributeVisitor(writer).Accept(Tree.Chunks);
- using (writer.BuildClassDeclaration("public", Host.DefaultClassName, String.IsNullOrEmpty(baseType) ? new string[0] : new string[]{baseType}))
+ using (writer.BuildClassDeclaration("public", Host.DefaultClassName, String.IsNullOrEmpty(baseType) ? new string[0] : new string[] { baseType }))
{
if (Host.DesignTimeMode)
{
diff --git a/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs
index dc0d8e6d5e..11966723ce 100644
--- a/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs
@@ -40,6 +40,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
if (context.Host.DesignTimeMode)
{
return; // Don't generate anything!
@@ -47,10 +48,13 @@ namespace Microsoft.AspNet.Razor.Generator
// What kind of block is nested within
string generatedCode;
+#endif
Block child = target.Children.Where(n => n.IsBlock).Cast().FirstOrDefault();
+
if (child != null && child.Type == BlockType.Expression)
{
_isExpression = true;
+#if NET45
generatedCode = context.BuildCodeString(cw =>
{
cw.WriteParameterSeparator();
@@ -59,10 +63,11 @@ namespace Microsoft.AspNet.Razor.Generator
cw.WriteParameterSeparator();
cw.WriteStartMethodInvoke("Tuple.Create", "System.Object", "System.Int32");
});
-
+#endif
_oldRenderingMode = context.ExpressionRenderingMode;
context.ExpressionRenderingMode = ExpressionRenderingMode.InjectCode;
}
+#if NET45
else
{
generatedCode = context.BuildCodeString(cw =>
@@ -79,7 +84,7 @@ namespace Microsoft.AspNet.Razor.Generator
context.MarkEndOfGeneratedCode();
context.BufferStatementFragment(generatedCode);
-
+#endif
_oldTargetWriter = context.TargetWriterName;
context.TargetWriterName = ValueWriterName;
@@ -102,6 +107,7 @@ namespace Microsoft.AspNet.Razor.Generator
string generatedCode;
if (_isExpression)
{
+#if NET45
generatedCode = context.BuildCodeString(cw =>
{
cw.WriteParameterSeparator();
@@ -113,8 +119,10 @@ namespace Microsoft.AspNet.Razor.Generator
cw.WriteEndMethodInvoke();
cw.WriteLineContinuation();
});
+#endif
context.ExpressionRenderingMode = _oldRenderingMode;
}
+#if NET45
else
{
generatedCode = context.BuildCodeString(cw =>
@@ -133,9 +141,9 @@ namespace Microsoft.AspNet.Razor.Generator
}
context.AddStatement(generatedCode);
+#endif
context.TargetWriterName = _oldTargetWriter;
-
// TODO: Make this generate the primary generator
GenerateEndBlockCode(target, context.CodeTreeBuilder, context);
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/ExpressionCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/ExpressionCodeGenerator.cs
index d7b5cde1cd..109525c4bd 100644
--- a/src/Microsoft.AspNet.Razor/Generator/ExpressionCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/ExpressionCodeGenerator.cs
@@ -17,6 +17,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
if (context.Host.EnableInstrumentation && context.ExpressionRenderingMode == ExpressionRenderingMode.WriteToOutput)
{
Span contentSpan = target.Children
@@ -54,6 +55,7 @@ namespace Microsoft.AspNet.Razor.Generator
context.BufferStatementFragment(writeInvocation);
context.MarkStartOfGeneratedCode();
+#endif
// TODO: Make this generate the primary generator
GenerateStartBlockCode(target, context.CodeTreeBuilder, context);
@@ -66,6 +68,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateEndBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
string endBlock = context.BuildCodeString(cw =>
{
if (context.ExpressionRenderingMode == ExpressionRenderingMode.WriteToOutput)
@@ -98,6 +101,7 @@ namespace Microsoft.AspNet.Razor.Generator
context.AddContextCall(contentSpan, context.Host.GeneratedClassContext.EndContextMethodName, false);
}
}
+#endif
// TODO: Make this generate the primary generator
GenerateEndBlockCode(target, context.CodeTreeBuilder, context);
@@ -110,12 +114,14 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
Span sourceSpan = null;
if (context.CreateCodeWriter().SupportsMidStatementLinePragmas || context.ExpressionRenderingMode == ExpressionRenderingMode.WriteToOutput)
{
sourceSpan = target;
}
context.BufferStatementFragment(target.Content, sourceSpan);
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
diff --git a/src/Microsoft.AspNet.Razor/Generator/HelperCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/HelperCodeGenerator.cs
index d3da5fcf63..1dad54a760 100644
--- a/src/Microsoft.AspNet.Razor/Generator/HelperCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/HelperCodeGenerator.cs
@@ -39,6 +39,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
_writer = context.CreateCodeWriter();
string prefix = context.BuildCodeString(
@@ -61,6 +62,7 @@ namespace Microsoft.AspNet.Razor.Generator
}
_statementCollectorToken = context.ChangeStatementCollector(AddStatementToHelper);
+#endif
_oldWriter = context.TargetWriterName;
context.TargetWriterName = HelperWriterName;
@@ -75,6 +77,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateEndBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
_statementCollectorToken.Dispose();
if (HeaderComplete)
{
@@ -92,6 +95,8 @@ namespace Microsoft.AspNet.Razor.Generator
_writer.WriteHelperTrailer();
context.GeneratedClass.Members.Add(new CodeSnippetTypeMember(_writer.Content));
+
+#endif
context.TargetWriterName = _oldWriter;
// TODO: Make this generate the primary generator
@@ -120,6 +125,7 @@ namespace Microsoft.AspNet.Razor.Generator
return "Helper:" + Signature.ToString("F", CultureInfo.CurrentCulture) + ";" + (HeaderComplete ? "C" : "I");
}
+#if NET45
private void AddStatementToHelper(string statement, CodeLinePragma pragma)
{
if (pragma != null)
@@ -133,5 +139,6 @@ namespace Microsoft.AspNet.Razor.Generator
_writer.WriteLinePragma();
}
}
+#endif
}
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs
index 5dd6ecf5c1..a6437af8e0 100644
--- a/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs
@@ -44,17 +44,22 @@ namespace Microsoft.AspNet.Razor.Generator
}
ExpressionRenderingMode oldMode = context.ExpressionRenderingMode;
+#if NET45
context.BufferStatementFragment(context.BuildCodeString(cw =>
{
cw.WriteParameterSeparator();
cw.WriteStartMethodInvoke("Tuple.Create");
cw.WriteLocationTaggedString(Prefix);
cw.WriteParameterSeparator();
+#endif
if (ValueGenerator != null)
{
+#if NET45
cw.WriteStartMethodInvoke("Tuple.Create", "System.Object", "System.Int32");
+#endif
context.ExpressionRenderingMode = ExpressionRenderingMode.InjectCode;
}
+#if NET45
else
{
cw.WriteLocationTaggedString(Value);
@@ -62,20 +67,22 @@ namespace Microsoft.AspNet.Razor.Generator
// literal: true - This attribute value is a literal value
cw.WriteBooleanLiteral(true);
cw.WriteEndMethodInvoke();
-
- // In VB, we need a line continuation
- cw.WriteLineContinuation();
}
}));
+#endif
if (ValueGenerator != null)
{
ValueGenerator.Value.GenerateCode(target, context);
+#if NET45
context.FlushBufferedStatement();
+#endif
context.ExpressionRenderingMode = oldMode;
+#if NET45
context.AddStatement(context.BuildCodeString(cw =>
{
+#endif
chunk.ValueLocation = ValueGenerator.Location;
-
+#if NET45
cw.WriteParameterSeparator();
cw.WriteSnippet(ValueGenerator.Location.AbsoluteIndex.ToString(CultureInfo.CurrentCulture));
cw.WriteEndMethodInvoke();
@@ -83,14 +90,12 @@ namespace Microsoft.AspNet.Razor.Generator
// literal: false - This attribute value is not a literal value, it is dynamically generated
cw.WriteBooleanLiteral(false);
cw.WriteEndMethodInvoke();
-
- // In VB, we need a line continuation
- cw.WriteLineContinuation();
}));
}
else
{
context.FlushBufferedStatement();
+#endif
}
context.CodeTreeBuilder.EndChunkBlock();
diff --git a/src/Microsoft.AspNet.Razor/Generator/MarkupCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/MarkupCodeGenerator.cs
index 7555e1cc2a..85ffc9225f 100644
--- a/src/Microsoft.AspNet.Razor/Generator/MarkupCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/MarkupCodeGenerator.cs
@@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Razor.Generator
{
return;
}
-
+#if NET45
if (context.Host.EnableInstrumentation)
{
context.AddContextCall(target, context.Host.GeneratedClassContext.BeginContextMethodName, isLiteral: true);
@@ -50,6 +50,7 @@ namespace Microsoft.AspNet.Razor.Generator
{
context.AddContextCall(target, context.Host.GeneratedClassContext.EndContextMethodName, isLiteral: true);
}
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
diff --git a/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs
index 69216e7ead..f121105a2f 100644
--- a/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs
@@ -76,7 +76,9 @@ namespace Microsoft.AspNet.Razor.Generator
public override void OnComplete()
{
+#if NET45
Context.FlushBufferedStatement();
+#endif
}
private void EnsureContextInitialized()
@@ -90,6 +92,7 @@ namespace Microsoft.AspNet.Razor.Generator
protected virtual void Initialize(CodeGeneratorContext context)
{
+#if NET45
context.Namespace.Imports.AddRange(Host.NamespaceImports.Select(s => new CodeNamespaceImport(s)).ToArray());
if (!String.IsNullOrEmpty(Host.DefaultBaseClass))
@@ -99,6 +102,7 @@ namespace Microsoft.AspNet.Razor.Generator
// Dev10 Bug 937438: Generate explicit Parameter-less constructor on Razor generated class
context.GeneratedClass.Members.Add(new CodeConstructor() { Attributes = MemberAttributes.Public });
+#endif
}
}
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/RazorCommentCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/RazorCommentCodeGenerator.cs
index 3d8cc6f8a4..bfe52af350 100644
--- a/src/Microsoft.AspNet.Razor/Generator/RazorCommentCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/RazorCommentCodeGenerator.cs
@@ -9,6 +9,7 @@ namespace Microsoft.AspNet.Razor.Generator
{
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
// Flush the buffered statement since we're interrupting it with a comment.
if (!String.IsNullOrEmpty(context.CurrentBufferedStatement))
{
@@ -16,6 +17,7 @@ namespace Microsoft.AspNet.Razor.Generator
context.BufferStatementFragment(context.BuildCodeString(cw => cw.WriteLineContinuation()));
}
context.FlushBufferedStatement();
+#endif
}
}
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/RazorDirectiveAttributeCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/RazorDirectiveAttributeCodeGenerator.cs
index 0b79b2b95f..6c1fdb4808 100644
--- a/src/Microsoft.AspNet.Razor/Generator/RazorDirectiveAttributeCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/RazorDirectiveAttributeCodeGenerator.cs
@@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Razor.Generator
public void GenerateCode(SyntaxTreeNode target, CodeTreeBuilder codeTreeBuilder, CodeGeneratorContext context)
{
- if(Name == SyntaxConstants.CSharp.SessionStateKeyword)
+ if (Name == SyntaxConstants.CSharp.SessionStateKeyword)
{
codeTreeBuilder.AddSessionStateChunk(Value, target, context);
}
@@ -35,13 +35,14 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
var attributeType = new CodeTypeReference(typeof(RazorDirectiveAttribute));
var attributeDeclaration = new CodeAttributeDeclaration(
attributeType,
new CodeAttributeArgument(new CodePrimitiveExpression(Name)),
new CodeAttributeArgument(new CodePrimitiveExpression(Value)));
context.GeneratedClass.CustomAttributes.Add(attributeDeclaration);
-
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs
index e2f302c398..63ef77b85d 100644
--- a/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs
@@ -22,7 +22,7 @@ namespace Microsoft.AspNet.Razor.Generator
new MarkupCodeGenerator().GenerateCode(target, context);
return;
}
-
+#if NET45
if (!context.Host.DesignTimeMode && String.IsNullOrEmpty(target.Content))
{
return;
@@ -79,7 +79,7 @@ namespace Microsoft.AspNet.Razor.Generator
{
context.AddContextCall(target, context.Host.GeneratedClassContext.EndContextMethodName, isLiteral: false);
}
-
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs
index 423a0582c7..3cfd902e9d 100644
--- a/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs
@@ -25,6 +25,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
string startBlock = context.BuildCodeString(cw =>
{
cw.WriteStartMethodInvoke(context.Host.GeneratedClassContext.DefineSectionMethodName);
@@ -33,6 +34,7 @@ namespace Microsoft.AspNet.Razor.Generator
cw.WriteStartLambdaDelegate();
});
context.AddStatement(startBlock);
+#endif
// TODO: Make this generate the primary generator
GenerateStartBlockCode(target, context.CodeTreeBuilder, context);
@@ -45,6 +47,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateEndBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
string startBlock = context.BuildCodeString(cw =>
{
cw.WriteEndLambdaDelegate();
@@ -52,6 +55,7 @@ namespace Microsoft.AspNet.Razor.Generator
cw.WriteEndStatement();
});
context.AddStatement(startBlock);
+#endif
// TODO: Make this generate the primary generator
GenerateEndBlockCode(target, context.CodeTreeBuilder, context);
diff --git a/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs
index 9259c94c0d..a35607af65 100644
--- a/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs
@@ -23,6 +23,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
context.GeneratedClass.BaseTypes.Clear();
context.GeneratedClass.BaseTypes.Add(new CodeTypeReference(ResolveType(context, BaseType.Trim())));
@@ -44,6 +45,7 @@ namespace Microsoft.AspNet.Razor.Generator
};
context.AddDesignTimeHelperStatement(stmt);
}
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
diff --git a/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs
index 69395e2a68..d3e6b129d8 100644
--- a/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs
@@ -23,6 +23,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
if (!context.Host.DesignTimeMode && !String.IsNullOrEmpty(context.Host.GeneratedClassContext.LayoutPropertyName))
{
context.TargetMethod.Statements.Add(
@@ -30,6 +31,7 @@ namespace Microsoft.AspNet.Razor.Generator
new CodePropertyReferenceExpression(null, context.Host.GeneratedClassContext.LayoutPropertyName),
new CodePrimitiveExpression(LayoutPath)));
}
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
diff --git a/src/Microsoft.AspNet.Razor/Generator/SetVBOptionCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SetVBOptionCodeGenerator.cs
deleted file mode 100644
index b707f4d3de..0000000000
--- a/src/Microsoft.AspNet.Razor/Generator/SetVBOptionCodeGenerator.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-
-namespace Microsoft.AspNet.Razor.Generator
-{
- public class SetVBOptionCodeGenerator : SpanCodeGenerator
- {
- public static readonly string StrictCodeDomOptionName = "AllowLateBound";
- public static readonly string ExplicitCodeDomOptionName = "RequireVariableDeclaration";
-
- public SetVBOptionCodeGenerator(string optionName, bool value)
- {
- OptionName = optionName;
- Value = value;
- }
-
- // CodeDOM Option Name, which is NOT the same as the VB Option Name
- public string OptionName { get; private set; }
- public bool Value { get; private set; }
-
- public static SetVBOptionCodeGenerator Strict(bool onOffValue)
- {
- // Strict On = AllowLateBound Off
- return new SetVBOptionCodeGenerator(StrictCodeDomOptionName, !onOffValue);
- }
-
- public static SetVBOptionCodeGenerator Explicit(bool onOffValue)
- {
- return new SetVBOptionCodeGenerator(ExplicitCodeDomOptionName, onOffValue);
- }
-
- public override void GenerateCode(Span target, CodeGeneratorContext context)
- {
- context.CompileUnit.UserData[OptionName] = Value;
- }
-
- public override string ToString()
- {
- return "Option:" + OptionName + "=" + Value;
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Generator/StatementCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/StatementCodeGenerator.cs
index 3eb3ab1295..d4807a5e84 100644
--- a/src/Microsoft.AspNet.Razor/Generator/StatementCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/StatementCodeGenerator.cs
@@ -15,6 +15,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
context.FlushBufferedStatement();
string generatedCode = context.BuildCodeString(cw =>
@@ -29,6 +30,7 @@ namespace Microsoft.AspNet.Razor.Generator
context.AddStatement(
generatedCode,
context.GenerateLinePragma(target, paddingCharCount));
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
diff --git a/src/Microsoft.AspNet.Razor/Generator/TemplateBlockCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/TemplateBlockCodeGenerator.cs
index 1d5143950d..1a1e511c2a 100644
--- a/src/Microsoft.AspNet.Razor/Generator/TemplateBlockCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/TemplateBlockCodeGenerator.cs
@@ -19,6 +19,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateStartBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
string generatedCode = context.BuildCodeString(cw =>
{
cw.WriteStartLambdaExpression(ItemParameterName);
@@ -29,6 +30,7 @@ namespace Microsoft.AspNet.Razor.Generator
context.MarkEndOfGeneratedCode();
context.BufferStatementFragment(generatedCode);
context.FlushBufferedStatement();
+#endif
_oldTargetWriter = context.TargetWriterName;
context.TargetWriterName = TemplateWriterName;
@@ -44,6 +46,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateEndBlockCode(Block target, CodeGeneratorContext context)
{
+#if NET45
string generatedCode = context.BuildCodeString(cw =>
{
cw.WriteEndLambdaDelegate();
@@ -52,6 +55,7 @@ namespace Microsoft.AspNet.Razor.Generator
});
context.BufferStatementFragment(generatedCode);
+#endif
context.TargetWriterName = _oldTargetWriter;
// TODO: Make this generate the primary generator
diff --git a/src/Microsoft.AspNet.Razor/Generator/TypeMemberCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/TypeMemberCodeGenerator.cs
index a6b776e67a..422fb19c73 100644
--- a/src/Microsoft.AspNet.Razor/Generator/TypeMemberCodeGenerator.cs
+++ b/src/Microsoft.AspNet.Razor/Generator/TypeMemberCodeGenerator.cs
@@ -16,6 +16,7 @@ namespace Microsoft.AspNet.Razor.Generator
public override void GenerateCode(Span target, CodeGeneratorContext context)
{
+#if NET45
string generatedCode = context.BuildCodeString(cw =>
{
cw.WriteSnippet(target.Content);
@@ -31,7 +32,7 @@ namespace Microsoft.AspNet.Razor.Generator
{
LinePragma = context.GenerateLinePragma(target, paddingCharCount)
});
-
+#endif
// TODO: Make this generate the primary generator
GenerateCode(target, context.CodeTreeBuilder, context);
}
diff --git a/src/Microsoft.AspNet.Razor/Generator/VBCodeWriter.cs b/src/Microsoft.AspNet.Razor/Generator/VBCodeWriter.cs
deleted file mode 100644
index 1b72efed7f..0000000000
--- a/src/Microsoft.AspNet.Razor/Generator/VBCodeWriter.cs
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-namespace Microsoft.AspNet.Razor.Generator
-{
- internal class VBCodeWriter : BaseCodeWriter
- {
- public override bool SupportsMidStatementLinePragmas
- {
- get { return false; }
- }
-
- protected internal override void WriteStartGenerics()
- {
- InnerWriter.Write("(Of ");
- }
-
- protected internal override void WriteEndGenerics()
- {
- InnerWriter.Write(")");
- }
-
- public override void WriteLineContinuation()
- {
- InnerWriter.Write(" _");
- }
-
- public override int WriteVariableDeclaration(string type, string name, string value)
- {
- InnerWriter.Write("Dim ");
- InnerWriter.Write(name);
- InnerWriter.Write(" As ");
- int typePos = InnerWriter.GetStringBuilder().Length;
- InnerWriter.Write(type);
- if (!String.IsNullOrEmpty(value))
- {
- InnerWriter.Write(" = ");
- InnerWriter.Write(value);
- }
- else
- {
- InnerWriter.Write(" = Nothing");
- }
- return typePos;
- }
-
- public override void WriteStringLiteral(string literal)
- {
- bool inQuotes = true;
- InnerWriter.Write("\"");
- for (int i = 0; i < literal.Length; i++)
- {
- switch (literal[i])
- {
- case '\t':
- case '\n':
- case '\r':
- case '\0':
- case '\u2028':
- case '\u2029':
- // Exit quotes
- EnsureOutOfQuotes(ref inQuotes);
-
- // Write concat character
- InnerWriter.Write("&");
-
- // Write character literal
- WriteCharLiteral(literal[i]);
- break;
- case '"':
- case '“':
- case '”':
- case (char)0xff02:
- EnsureInQuotes(ref inQuotes);
- InnerWriter.Write(literal[i]);
- InnerWriter.Write(literal[i]);
- break;
- default:
- EnsureInQuotes(ref inQuotes);
- InnerWriter.Write(literal[i]);
- break;
- }
- if (i > 0 && (i % 80) == 0)
- {
- if ((Char.IsHighSurrogate(literal[i]) && (i < (literal.Length - 1))) && Char.IsLowSurrogate(literal[i + 1]))
- {
- InnerWriter.Write(literal[++i]);
- }
- if (inQuotes)
- {
- InnerWriter.Write("\"");
- }
- inQuotes = true;
- InnerWriter.Write("& _ ");
- InnerWriter.Write(Environment.NewLine);
- InnerWriter.Write('"');
- }
- }
- EnsureOutOfQuotes(ref inQuotes);
- }
-
- protected internal override void EmitStartLambdaExpression(string[] parameterNames)
- {
- InnerWriter.Write("Function (");
- WriteCommaSeparatedList(parameterNames, InnerWriter.Write);
- InnerWriter.Write(") ");
- }
-
- protected internal override void EmitStartConstructor(string typeName)
- {
- InnerWriter.Write("New ");
- InnerWriter.Write(typeName);
- InnerWriter.Write("(");
- }
-
- protected internal override void EmitStartLambdaDelegate(string[] parameterNames)
- {
- InnerWriter.Write("Sub (");
- WriteCommaSeparatedList(parameterNames, InnerWriter.Write);
- InnerWriter.WriteLine(")");
- }
-
- protected internal override void EmitEndLambdaDelegate()
- {
- InnerWriter.Write("End Sub");
- }
-
- private void WriteCharLiteral(char literal)
- {
- InnerWriter.Write("Global.Microsoft.VisualBasic.ChrW(");
- InnerWriter.Write((int)literal);
- InnerWriter.Write(")");
- }
-
- private void EnsureInQuotes(ref bool inQuotes)
- {
- if (!inQuotes)
- {
- InnerWriter.Write("&\"");
- inQuotes = true;
- }
- }
-
- private void EnsureOutOfQuotes(ref bool inQuotes)
- {
- if (inQuotes)
- {
- InnerWriter.Write("\"");
- inQuotes = false;
- }
- }
-
- public override void WriteReturn()
- {
- InnerWriter.Write("Return ");
- }
-
- public override void WriteLinePragma(int? lineNumber, string fileName)
- {
- InnerWriter.WriteLine();
- if (lineNumber != null)
- {
- InnerWriter.Write("#ExternalSource(\"");
- InnerWriter.Write(fileName);
- InnerWriter.Write("\", ");
- InnerWriter.Write(lineNumber);
- InnerWriter.WriteLine(")");
- }
- else
- {
- InnerWriter.WriteLine("#End ExternalSource");
- }
- }
-
- public override void WriteHelperHeaderPrefix(string templateTypeName, bool isStatic)
- {
- InnerWriter.Write("Public ");
- if (isStatic)
- {
- InnerWriter.Write("Shared ");
- }
- InnerWriter.Write("Function ");
- }
-
- public override void WriteHelperHeaderSuffix(string templateTypeName)
- {
- InnerWriter.Write(" As ");
- InnerWriter.WriteLine(templateTypeName);
- }
-
- public override void WriteHelperTrailer()
- {
- InnerWriter.WriteLine("End Function");
- }
-
- public override void WriteEndStatement()
- {
- InnerWriter.WriteLine();
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Generator/VBRazorCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/VBRazorCodeGenerator.cs
deleted file mode 100644
index 71f86ea1ca..0000000000
--- a/src/Microsoft.AspNet.Razor/Generator/VBRazorCodeGenerator.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-namespace Microsoft.AspNet.Razor.Generator
-{
- public class VBRazorCodeGenerator : RazorCodeGenerator
- {
- public VBRazorCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host)
- : base(className, rootNamespaceName, sourceFileName, host)
- {
- }
-
- internal override Func CodeWriterFactory
- {
- get { return () => new VBCodeWriter(); }
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/GeneratorResults.cs b/src/Microsoft.AspNet.Razor/GeneratorResults.cs
index b745ad10e5..131915054f 100644
--- a/src/Microsoft.AspNet.Razor/GeneratorResults.cs
+++ b/src/Microsoft.AspNet.Razor/GeneratorResults.cs
@@ -37,8 +37,9 @@ namespace Microsoft.AspNet.Razor
public string GeneratedCode { get; private set; }
public IList DesignTimeLineMappings { get; private set; }
+#if NET45
public CodeCompileUnit CCU { get; set; }
-
+#endif
internal CodeTree CT { get; set; }
}
}
diff --git a/src/Microsoft.AspNet.Razor/GeneratorResultsOLD.cs b/src/Microsoft.AspNet.Razor/GeneratorResultsOLD.cs
deleted file mode 100644
index 4ea8fbcfd1..0000000000
--- a/src/Microsoft.AspNet.Razor/GeneratorResultsOLD.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System.CodeDom;
-using Microsoft.AspNet.Razor.Generator.Compiler;
-using System.Collections.Generic;
-using Microsoft.AspNet.Razor.Generator;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-
-namespace Microsoft.AspNet.Razor
-{
- ///
- /// Represents results from code generation (and parsing, since that is a pre-requisite of code generation)
- ///
- ///
- /// Since this inherits from ParserResults, it has all the data from ParserResults, and simply adds code generation data
- ///
- public class GeneratorResultsOLD : ParserResults
- {
- public GeneratorResultsOLD(ParserResults parserResults,
- CodeCompileUnit generatedCode,
- IDictionary designTimeLineMappings)
- : this(parserResults.Document, parserResults.ParserErrors, generatedCode, designTimeLineMappings)
- {
- }
-
- public GeneratorResultsOLD(Block document,
- IList parserErrors,
- CodeCompileUnit generatedCode,
- IDictionary designTimeLineMappings)
- : this(parserErrors.Count == 0, document, parserErrors, generatedCode, designTimeLineMappings)
- {
- }
-
- protected GeneratorResultsOLD(bool success,
- Block document,
- IList parserErrors,
- CodeCompileUnit generatedCode,
- IDictionary designTimeLineMappings)
- : base(success, document, parserErrors)
- {
- GeneratedCode = generatedCode;
- DesignTimeLineMappings = designTimeLineMappings;
- }
-
- public CodeTree CodeTree { get; set; }
-
- ///
- /// The generated code
- ///
- public CodeCompileUnit GeneratedCode { get; private set; }
-
- ///
- /// If design-time mode was used in the Code Generator, this will contain the dictionary
- /// of design-time generated code mappings
- ///
- public IDictionary DesignTimeLineMappings { get; private set; }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs b/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs
index c24f9e76ca..6cb2b9ef74 100644
--- a/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs
+++ b/src/Microsoft.AspNet.Razor/GlobalSuppressions.cs
@@ -19,4 +19,3 @@ using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Parser", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")]
[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor.Editor", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")]
[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.AspNet.Razor", Justification = "These namespaces are design to group classes by function. They will be reviewed to ensure they remain relevant.")]
-[assembly: SuppressMessage("Microsoft.Web.FxCop", "MW1000:UnusedResourceUsageRule", Justification = "There are numerous unused resources due to VB being disabled. This rule will be re-run after VB is restored")]
diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs
index ff7984eeef..fdf5de0eed 100644
--- a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs
+++ b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.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,25 +127,27 @@ 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
Debug.Fail("FlipBracket must be called with a bracket character");
- return CSharpSymbolType.Unknown;
+#endif
+ return CSharpSymbolType.Unknown;
}
}
@@ -162,26 +164,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;
diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs
index 8f44f89ad9..3c3fd86226 100644
--- a/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs
+++ b/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs
@@ -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.Solidus:
- 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.Solidus:
+ 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,17 +80,19 @@ 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
Debug.Fail("FlipBracket must be called with a bracket character");
- return HtmlSymbolType.Unknown;
+#endif
+ return HtmlSymbolType.Unknown;
}
}
@@ -103,24 +105,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;
}
}
diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs b/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs
index 04fc3eb0fb..66b4baf5a7 100644
--- a/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs
+++ b/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs
@@ -287,7 +287,9 @@ namespace Microsoft.AspNet.Razor.Parser
_infiniteLoopGuardCount++;
if (_infiniteLoopGuardCount > InfiniteLoopCountThreshold)
{
+#if NET45
Debug.Fail("An internal parser error is causing an infinite loop at this location.");
+#endif
_terminated = true;
return true;
}
diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs b/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs
index d80d7406fe..bdfd2014e8 100644
--- a/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs
+++ b/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs
@@ -33,7 +33,11 @@ namespace Microsoft.AspNet.Razor.Parser
value == '\f' ||
value == '\t' ||
value == '\u000B' || // Vertical Tab
+#if NET45
Char.GetUnicodeCategory(value) == UnicodeCategory.SpaceSeparator;
+#else
+ Char.IsSeparator(value);
+#endif
}
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace", Justification = "This would be a breaking change in a shipping API")]
@@ -88,7 +92,11 @@ namespace Microsoft.AspNet.Razor.Parser
public static bool IsDecimalDigit(char value)
{
+#if NET45
return Char.GetUnicodeCategory(value) == UnicodeCategory.DecimalDigitNumber;
+#else
+ return Char.IsDigit(value);
+#endif
}
public static bool IsLetterOrDecimalDigit(char value)
@@ -98,29 +106,49 @@ namespace Microsoft.AspNet.Razor.Parser
public static bool IsLetter(char value)
{
+#if NET45
var cat = Char.GetUnicodeCategory(value);
+
return cat == UnicodeCategory.UppercaseLetter
|| cat == UnicodeCategory.LowercaseLetter
|| cat == UnicodeCategory.TitlecaseLetter
|| cat == UnicodeCategory.ModifierLetter
|| cat == UnicodeCategory.OtherLetter
|| cat == UnicodeCategory.LetterNumber;
+#else
+ return Char.IsLetter(value);
+#endif
+
}
public static bool IsFormatting(char value)
{
+#if NET45
return Char.GetUnicodeCategory(value) == UnicodeCategory.Format;
+#else
+ return false; // TODO: Make the above work
+#endif
}
public static bool IsCombining(char value)
{
+#if NET45
var cat = Char.GetUnicodeCategory(value);
+
return cat == UnicodeCategory.SpacingCombiningMark || cat == UnicodeCategory.NonSpacingMark;
+#else
+ return false; // TODO: Make the above work
+#endif
+
}
public static bool IsConnecting(char value)
{
+#if NET45
return Char.GetUnicodeCategory(value) == UnicodeCategory.ConnectorPunctuation;
+#else
+ return false; // TODO: Make the above work
+#endif
}
public static string SanitizeClassName(string inputName)
diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs
index 33510e76f7..caaaa051ab 100644
--- a/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs
+++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxConstants.cs
@@ -27,26 +27,5 @@ namespace Microsoft.AspNet.Razor.Parser
public static readonly string LayoutKeyword = "layout";
public static readonly string SessionStateKeyword = "sessionstate";
}
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Class is nested to provide better organization")]
- public static class VB
- {
- public static readonly int ImportsKeywordLength = 7;
- public static readonly string EndKeyword = "End";
- public static readonly string CodeKeyword = "Code";
- public static readonly string FunctionsKeyword = "Functions";
- public static readonly string SectionKeyword = "Section";
- public static readonly string StrictKeyword = "Strict";
- public static readonly string ExplicitKeyword = "Explicit";
- public static readonly string OffKeyword = "Off";
- public static readonly string HelperKeyword = "Helper";
- public static readonly string SelectCaseKeyword = "Select Case";
- public static readonly string LayoutKeyword = "Layout";
- public static readonly string EndCodeKeyword = "End Code";
- public static readonly string EndHelperKeyword = "End Helper";
- public static readonly string EndFunctionsKeyword = "End Functions";
- public static readonly string EndSectionKeyword = "End Section";
- public static readonly string SessionStateKeyword = "SessionState";
- }
}
}
diff --git a/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.Directives.cs b/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.Directives.cs
deleted file mode 100644
index ce3f4ff7b3..0000000000
--- a/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.Directives.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-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;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Resources;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.AspNet.Razor.Tokenizer;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-
-namespace Microsoft.AspNet.Razor.Parser
-{
- public partial class VBCodeParser : TokenizerBackedParser
- {
- private void SetUpDirectives()
- {
- MapDirective(SyntaxConstants.VB.CodeKeyword, EndTerminatedDirective(SyntaxConstants.VB.CodeKeyword,
- BlockType.Statement,
- new StatementCodeGenerator(),
- allowMarkup: true));
- MapDirective(SyntaxConstants.VB.FunctionsKeyword, EndTerminatedDirective(SyntaxConstants.VB.FunctionsKeyword,
- BlockType.Functions,
- new TypeMemberCodeGenerator(),
- allowMarkup: false));
- MapDirective(SyntaxConstants.VB.SectionKeyword, SectionDirective);
- MapDirective(SyntaxConstants.VB.HelperKeyword, HelperDirective);
-
- MapDirective(SyntaxConstants.VB.LayoutKeyword, LayoutDirective);
- MapDirective(SyntaxConstants.VB.SessionStateKeyword, SessionStateDirective);
- }
-
- protected virtual bool LayoutDirective()
- {
- AssertDirective(SyntaxConstants.VB.LayoutKeyword);
- AcceptAndMoveNext();
- Context.CurrentBlock.Type = BlockType.Directive;
-
- // Accept spaces, but not newlines
- bool foundSomeWhitespace = At(VBSymbolType.WhiteSpace);
- AcceptWhile(VBSymbolType.WhiteSpace);
- Output(SpanKind.MetaCode, foundSomeWhitespace ? AcceptedCharacters.None : AcceptedCharacters.Any);
-
- // First non-whitespace character starts the Layout Page, then newline ends it
- AcceptUntil(VBSymbolType.NewLine);
- Span.CodeGenerator = new SetLayoutCodeGenerator(Span.GetContent());
- Span.EditHandler.EditorHints = EditorHints.LayoutPage | EditorHints.VirtualPath;
- bool foundNewline = Optional(VBSymbolType.NewLine);
- AddMarkerSymbolIfNecessary();
- Output(SpanKind.MetaCode, foundNewline ? AcceptedCharacters.None : AcceptedCharacters.Any);
- return true;
- }
-
- protected virtual bool SessionStateDirective()
- {
- AssertDirective(SyntaxConstants.VB.SessionStateKeyword);
- AcceptAndMoveNext();
- Context.CurrentBlock.Type = BlockType.Directive;
-
- // Accept spaces, but not newlines
- bool foundSomeWhitespace = At(VBSymbolType.WhiteSpace);
- AcceptWhile(VBSymbolType.WhiteSpace);
- Output(SpanKind.MetaCode, foundSomeWhitespace ? AcceptedCharacters.None : AcceptedCharacters.Any);
-
- // First non-whitespace character starts the session state directive, then newline ends it
- AcceptUntil(VBSymbolType.NewLine);
- var value = String.Concat(Span.Symbols.Select(sym => sym.Content));
- Span.CodeGenerator = new RazorDirectiveAttributeCodeGenerator(SyntaxConstants.VB.SessionStateKeyword, value);
- bool foundNewline = Optional(VBSymbolType.NewLine);
- AddMarkerSymbolIfNecessary();
- Output(SpanKind.MetaCode, foundNewline ? AcceptedCharacters.None : AcceptedCharacters.Any);
- return true;
- }
-
- protected virtual bool HelperDirective()
- {
- if (Context.IsWithin(BlockType.Helper))
- {
- Context.OnError(CurrentLocation, RazorResources.ParseError_Helpers_Cannot_Be_Nested);
- }
-
- Context.CurrentBlock.Type = BlockType.Helper;
- SourceLocation blockStart = CurrentLocation;
-
- AssertDirective(SyntaxConstants.VB.HelperKeyword);
- AcceptAndMoveNext();
-
- VBSymbolType firstAfterKeyword = VBSymbolType.Unknown;
- if (CurrentSymbol != null)
- {
- firstAfterKeyword = CurrentSymbol.Type;
- }
-
- VBSymbol remainingWs = null;
- if (At(VBSymbolType.NewLine))
- {
- // Accept a _single_ new line, we'll be aborting later.
- AcceptAndMoveNext();
- }
- else
- {
- remainingWs = AcceptSingleWhiteSpaceCharacter();
- }
- if (firstAfterKeyword == VBSymbolType.WhiteSpace || firstAfterKeyword == VBSymbolType.NewLine)
- {
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- }
- Output(SpanKind.MetaCode);
- if (firstAfterKeyword != VBSymbolType.WhiteSpace)
- {
- string error;
- if (At(VBSymbolType.NewLine))
- {
- error = RazorResources.ErrorComponent_Newline;
- }
- else if (EndOfFile)
- {
- error = RazorResources.ErrorComponent_EndOfFile;
- }
- else
- {
- error = String.Format(CultureInfo.CurrentCulture, RazorResources.ErrorComponent_Character, CurrentSymbol.Content);
- }
-
- Context.OnError(
- CurrentLocation,
- RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start,
- error);
-
- // Bail out.
- PutCurrentBack();
- Output(SpanKind.Code);
- return false;
- }
-
- if (remainingWs != null)
- {
- Accept(remainingWs);
- }
-
- bool errorReported = !Required(VBSymbolType.Identifier, RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start);
-
- AcceptWhile(VBSymbolType.WhiteSpace);
-
- SourceLocation parensStart = CurrentLocation;
- bool headerComplete = false;
- if (!Optional(VBSymbolType.LeftParenthesis))
- {
- if (!errorReported)
- {
- errorReported = true;
- Context.OnError(CurrentLocation,
- RazorResources.ParseError_MissingCharAfterHelperName,
- VBSymbol.GetSample(VBSymbolType.LeftParenthesis));
- }
- }
- else if (!Balance(BalancingModes.NoErrorOnFailure, VBSymbolType.LeftParenthesis, VBSymbolType.RightParenthesis, parensStart))
- {
- Context.OnError(parensStart, RazorResources.ParseError_UnterminatedHelperParameterList);
- }
- else
- {
- Expected(VBSymbolType.RightParenthesis);
- headerComplete = true;
- }
-
- AddMarkerSymbolIfNecessary();
- Context.CurrentBlock.CodeGenerator = new HelperCodeGenerator(
- Span.GetContent(),
- headerComplete);
- AutoCompleteEditHandler editHandler = new AutoCompleteEditHandler(Language.TokenizeString);
- Span.EditHandler = editHandler;
- Output(SpanKind.Code);
-
- if (headerComplete)
- {
- bool old = IsNested;
- IsNested = true;
- using (Context.StartBlock(BlockType.Statement))
- {
- using (PushSpanConfig(StatementBlockSpanConfiguration(new StatementCodeGenerator())))
- {
- try
- {
- if (!EndTerminatedDirectiveBody(SyntaxConstants.VB.HelperKeyword, blockStart, allowAllTransitions: true))
- {
- if (Context.LastAcceptedCharacters != AcceptedCharacters.Any)
- {
- AddMarkerSymbolIfNecessary();
- }
-
- editHandler.AutoCompleteString = SyntaxConstants.VB.EndHelperKeyword;
- return false;
- }
- else
- {
- return true;
- }
- }
- finally
- {
- Output(SpanKind.Code);
- IsNested = old;
- }
- }
- }
- }
- else
- {
- Output(SpanKind.Code);
- }
- PutCurrentBack();
- return false;
- }
-
- protected virtual bool SectionDirective()
- {
- SourceLocation start = CurrentLocation;
- AssertDirective(SyntaxConstants.VB.SectionKeyword);
- AcceptAndMoveNext();
-
- if (Context.IsWithin(BlockType.Section))
- {
- Context.OnError(CurrentLocation, RazorResources.ParseError_Sections_Cannot_Be_Nested, RazorResources.SectionExample_VB);
- }
-
- if (At(VBSymbolType.NewLine))
- {
- AcceptAndMoveNext();
- }
- else
- {
- AcceptVBSpaces();
- }
- string sectionName = null;
- if (!At(VBSymbolType.Identifier))
- {
- Context.OnError(CurrentLocation,
- RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start,
- GetCurrentSymbolDisplay());
- }
- else
- {
- sectionName = CurrentSymbol.Content;
- AcceptAndMoveNext();
- }
- Context.CurrentBlock.Type = BlockType.Section;
- Context.CurrentBlock.CodeGenerator = new SectionCodeGenerator(sectionName ?? String.Empty);
-
- AutoCompleteEditHandler editHandler = new AutoCompleteEditHandler(Language.TokenizeString);
- Span.EditHandler = editHandler;
-
- PutCurrentBack();
-
- Output(SpanKind.MetaCode);
-
- // Parse the section
- OtherParserBlock(null, SyntaxConstants.VB.EndSectionKeyword);
-
- Span.CodeGenerator = SpanCodeGenerator.Null;
- bool complete = false;
- if (!At(VBKeyword.End))
- {
- Context.OnError(start,
- RazorResources.ParseError_BlockNotTerminated,
- SyntaxConstants.VB.SectionKeyword,
- SyntaxConstants.VB.EndSectionKeyword);
- editHandler.AutoCompleteString = SyntaxConstants.VB.EndSectionKeyword;
- }
- else
- {
- AcceptAndMoveNext();
- AcceptWhile(VBSymbolType.WhiteSpace);
- if (!At(SyntaxConstants.VB.SectionKeyword))
- {
- Context.OnError(start,
- RazorResources.ParseError_BlockNotTerminated,
- SyntaxConstants.VB.SectionKeyword,
- SyntaxConstants.VB.EndSectionKeyword);
- }
- else
- {
- AcceptAndMoveNext();
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- complete = true;
- }
- }
- PutCurrentBack();
- Output(SpanKind.MetaCode);
- return complete;
- }
-
- protected virtual Func EndTerminatedDirective(string directive, BlockType blockType, SpanCodeGenerator codeGenerator, bool allowMarkup)
- {
- return () =>
- {
- SourceLocation blockStart = CurrentLocation;
- Context.CurrentBlock.Type = blockType;
- AssertDirective(directive);
- AcceptAndMoveNext();
-
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- Span.CodeGenerator = SpanCodeGenerator.Null;
- Output(SpanKind.MetaCode);
-
- using (PushSpanConfig(StatementBlockSpanConfiguration(codeGenerator)))
- {
- AutoCompleteEditHandler editHandler = new AutoCompleteEditHandler(Language.TokenizeString);
- Span.EditHandler = editHandler;
-
- if (!EndTerminatedDirectiveBody(directive, blockStart, allowMarkup))
- {
- editHandler.AutoCompleteString = String.Concat(SyntaxConstants.VB.EndKeyword, " ", directive);
- return false;
- }
- return true;
- }
- };
- }
-
- protected virtual bool EndTerminatedDirectiveBody(string directive, SourceLocation blockStart, bool allowAllTransitions)
- {
- while (!EndOfFile)
- {
- VBSymbol lastWhitespace = AcceptWhiteSpaceInLines();
- if (IsAtEmbeddedTransition(allowTemplatesAndComments: allowAllTransitions, allowTransitions: allowAllTransitions))
- {
- HandleEmbeddedTransition(lastWhitespace);
- }
- else
- {
- if (At(VBKeyword.End))
- {
- Accept(lastWhitespace);
- VBSymbol end = CurrentSymbol;
- NextToken();
- IEnumerable ws = ReadVBSpaces();
- if (At(directive))
- {
- if (Context.LastAcceptedCharacters != AcceptedCharacters.Any)
- {
- AddMarkerSymbolIfNecessary(end.Start);
- }
- Output(SpanKind.Code);
- Accept(end);
- Accept(ws);
- AcceptAndMoveNext();
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- Span.CodeGenerator = SpanCodeGenerator.Null;
- Output(SpanKind.MetaCode);
- return true;
- }
- else
- {
- Accept(end);
- Accept(ws);
- AcceptAndMoveNext();
- }
- }
- else
- {
- Accept(lastWhitespace);
- AcceptAndMoveNext();
- }
- }
- }
-
- // This is a language keyword, so it does not need to be localized
- Context.OnError(blockStart, RazorResources.ParseError_BlockNotTerminated, directive, String.Concat(SyntaxConstants.VB.EndKeyword, " ", directive));
- return false;
- }
-
- protected bool At(string directive)
- {
- return At(VBSymbolType.Identifier) && String.Equals(CurrentSymbol.Content, directive, StringComparison.OrdinalIgnoreCase);
- }
-
- [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "'this' is used in DEBUG builds")]
- [Conditional("DEBUG")]
- protected void AssertDirective(string directive)
- {
- Assert(VBSymbolType.Identifier);
- Debug.Assert(String.Equals(directive, CurrentSymbol.Content, StringComparison.OrdinalIgnoreCase));
- }
-
- private string GetCurrentSymbolDisplay()
- {
- if (EndOfFile)
- {
- return RazorResources.ErrorComponent_EndOfFile;
- }
- else if (At(VBSymbolType.NewLine))
- {
- return RazorResources.ErrorComponent_Newline;
- }
- else if (At(VBSymbolType.WhiteSpace))
- {
- return RazorResources.ErrorComponent_Whitespace;
- }
- else
- {
- return String.Format(CultureInfo.CurrentCulture, RazorResources.ErrorComponent_Character, CurrentSymbol.Content);
- }
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.Statements.cs b/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.Statements.cs
deleted file mode 100644
index 046d1eb477..0000000000
--- a/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.Statements.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using Microsoft.AspNet.Razor.Generator;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Resources;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.AspNet.Razor.Tokenizer;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-
-namespace Microsoft.AspNet.Razor.Parser
-{
- public partial class VBCodeParser : TokenizerBackedParser
- {
- private void SetUpKeywords()
- {
- MapKeyword(VBKeyword.Using, EndTerminatedStatement(VBKeyword.Using, supportsExit: false, supportsContinue: false)); // http://msdn.microsoft.com/en-us/library/htd05whh.aspx
- MapKeyword(VBKeyword.While, EndTerminatedStatement(VBKeyword.While, supportsExit: true, supportsContinue: true)); // http://msdn.microsoft.com/en-us/library/zh1f56zs.aspx
- MapKeyword(VBKeyword.If, EndTerminatedStatement(VBKeyword.If, supportsExit: false, supportsContinue: false)); // http://msdn.microsoft.com/en-us/library/752y8abs.aspx
- MapKeyword(VBKeyword.Select, EndTerminatedStatement(VBKeyword.Select, supportsExit: true, supportsContinue: false, blockName: SyntaxConstants.VB.SelectCaseKeyword)); // http://msdn.microsoft.com/en-us/library/cy37t14y.aspx
- MapKeyword(VBKeyword.Try, EndTerminatedStatement(VBKeyword.Try, supportsExit: true, supportsContinue: false)); // http://msdn.microsoft.com/en-us/library/fk6t46tz.aspx
- MapKeyword(VBKeyword.With, EndTerminatedStatement(VBKeyword.With, supportsExit: false, supportsContinue: false)); // http://msdn.microsoft.com/en-us/library/wc500chb.aspx
- MapKeyword(VBKeyword.SyncLock, EndTerminatedStatement(VBKeyword.SyncLock, supportsExit: false, supportsContinue: false)); // http://msdn.microsoft.com/en-us/library/3a86s51t.aspx
-
- // http://msdn.microsoft.com/en-us/library/5z06z1kb.aspx
- // http://msdn.microsoft.com/en-us/library/5ebk1751.aspx
- MapKeyword(VBKeyword.For, KeywordTerminatedStatement(VBKeyword.For, VBKeyword.Next, supportsExit: true, supportsContinue: true));
- MapKeyword(VBKeyword.Do, KeywordTerminatedStatement(VBKeyword.Do, VBKeyword.Loop, supportsExit: true, supportsContinue: true)); // http://msdn.microsoft.com/en-us/library/eked04a7.aspx
-
- MapKeyword(VBKeyword.Imports, ImportsStatement);
- MapKeyword(VBKeyword.Option, OptionStatement);
- MapKeyword(VBKeyword.Inherits, InheritsStatement);
-
- MapKeyword(VBKeyword.Class, ReservedWord);
- MapKeyword(VBKeyword.Namespace, ReservedWord);
- }
-
- protected virtual bool InheritsStatement()
- {
- Assert(VBKeyword.Inherits);
-
- Span.CodeGenerator = SpanCodeGenerator.Null;
- Context.CurrentBlock.Type = BlockType.Directive;
-
- AcceptAndMoveNext();
- SourceLocation endInherits = CurrentLocation;
-
- if (At(VBSymbolType.WhiteSpace))
- {
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- }
-
- AcceptWhile(VBSymbolType.WhiteSpace);
- Output(SpanKind.MetaCode);
-
- if (EndOfFile || At(VBSymbolType.WhiteSpace) || At(VBSymbolType.NewLine))
- {
- Context.OnError(endInherits, RazorResources.ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName);
- }
-
- // Just accept to a newline
- AcceptUntil(VBSymbolType.NewLine);
- if (!Context.DesignTimeMode)
- {
- // We want the newline to be treated as code, but it causes issues at design-time.
- Optional(VBSymbolType.NewLine);
- }
-
- string baseType = Span.GetContent();
- Span.CodeGenerator = new SetBaseTypeCodeGenerator(baseType.Trim());
-
- Output(SpanKind.Code);
- return false;
- }
-
- protected virtual bool OptionStatement()
- {
- try
- {
- Context.CurrentBlock.Type = BlockType.Directive;
-
- Assert(VBKeyword.Option);
- AcceptAndMoveNext();
- AcceptWhile(VBSymbolType.WhiteSpace);
- if (!At(VBSymbolType.Identifier))
- {
- if (CurrentSymbol != null)
- {
- Context.OnError(CurrentLocation, String.Format(CultureInfo.CurrentCulture,
- RazorResources.ParseError_Unexpected,
- CurrentSymbol.Content));
- }
- return false;
- }
- SourceLocation optionLoc = CurrentLocation;
- string option = CurrentSymbol.Content;
- AcceptAndMoveNext();
-
- AcceptWhile(VBSymbolType.WhiteSpace);
- bool boolVal;
- if (At(VBKeyword.On))
- {
- AcceptAndMoveNext();
- boolVal = true;
- }
- else if (At(VBSymbolType.Identifier))
- {
- if (String.Equals(CurrentSymbol.Content, SyntaxConstants.VB.OffKeyword, StringComparison.OrdinalIgnoreCase))
- {
- AcceptAndMoveNext();
- boolVal = false;
- }
- else
- {
- Context.OnError(CurrentLocation, String.Format(CultureInfo.CurrentCulture,
- RazorResources.ParseError_InvalidOptionValue,
- option,
- CurrentSymbol.Content));
- AcceptAndMoveNext();
- return false;
- }
- }
- else
- {
- if (!EndOfFile)
- {
- Context.OnError(CurrentLocation, String.Format(CultureInfo.CurrentCulture,
- RazorResources.ParseError_Unexpected,
- CurrentSymbol.Content));
- AcceptAndMoveNext();
- }
- return false;
- }
-
- if (String.Equals(option, SyntaxConstants.VB.StrictKeyword, StringComparison.OrdinalIgnoreCase))
- {
- Span.CodeGenerator = SetVBOptionCodeGenerator.Strict(boolVal);
- }
- else if (String.Equals(option, SyntaxConstants.VB.ExplicitKeyword, StringComparison.OrdinalIgnoreCase))
- {
- Span.CodeGenerator = SetVBOptionCodeGenerator.Explicit(boolVal);
- }
- else
- {
- Span.CodeGenerator = new SetVBOptionCodeGenerator(option, boolVal);
- Context.OnError(optionLoc, RazorResources.ParseError_UnknownOption, option);
- }
- }
- finally
- {
- if (Span.Symbols.Count > 0)
- {
- Output(SpanKind.MetaCode);
- }
- }
- return true;
- }
-
- protected virtual bool ImportsStatement()
- {
- Context.CurrentBlock.Type = BlockType.Directive;
- Assert(VBKeyword.Imports);
- AcceptAndMoveNext();
-
- AcceptVBSpaces();
- if (At(VBSymbolType.WhiteSpace) || At(VBSymbolType.NewLine))
- {
- Context.OnError(CurrentLocation, RazorResources.ParseError_NamespaceOrTypeAliasExpected);
- }
-
- // Just accept to a newline
- AcceptUntil(VBSymbolType.NewLine);
- Optional(VBSymbolType.NewLine);
-
- string ns = String.Concat(Span.Symbols.Skip(1).Select(s => s.Content));
- Span.CodeGenerator = new AddImportCodeGenerator(ns, SyntaxConstants.VB.ImportsKeywordLength);
-
- Output(SpanKind.MetaCode);
- return false;
- }
-
- protected virtual Func EndTerminatedStatement(VBKeyword keyword, bool supportsExit, bool supportsContinue)
- {
- return EndTerminatedStatement(keyword, supportsExit, supportsContinue, blockName: keyword.ToString());
- }
-
- protected virtual Func EndTerminatedStatement(VBKeyword keyword, bool supportsExit, bool supportsContinue, string blockName)
- {
- return () =>
- {
- using (PushSpanConfig(StatementBlockSpanConfiguration(new StatementCodeGenerator())))
- {
- SourceLocation blockStart = CurrentLocation;
- Assert(keyword);
- AcceptAndMoveNext();
-
- while (!EndOfFile)
- {
- VBSymbol lastWhitespace = AcceptWhiteSpaceInLines();
- if (IsAtEmbeddedTransition(allowTemplatesAndComments: true, allowTransitions: true))
- {
- HandleEmbeddedTransition(lastWhitespace);
- }
- else
- {
- Accept(lastWhitespace);
-
- if ((supportsExit && At(VBKeyword.Exit)) || (supportsContinue && At(VBKeyword.Continue)))
- {
- HandleExitOrContinue(keyword);
- }
- else if (At(VBKeyword.End))
- {
- AcceptAndMoveNext();
- AcceptVBSpaces();
- if (At(keyword))
- {
- AcceptAndMoveNext();
- if (!Context.DesignTimeMode)
- {
- Optional(VBSymbolType.NewLine);
- }
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- return false;
- }
- }
- else if (At(keyword))
- {
- // Parse nested statement
- EndTerminatedStatement(keyword, supportsExit, supportsContinue)();
- }
- else if (!EndOfFile)
- {
- AcceptAndMoveNext();
- }
- }
- }
-
- Context.OnError(blockStart,
- RazorResources.ParseError_BlockNotTerminated,
- blockName,
- // This is a language keyword, so it does not need to be localized
- String.Concat(VBKeyword.End, " ", keyword));
- return false;
- }
- };
- }
-
- protected virtual Func KeywordTerminatedStatement(VBKeyword start, VBKeyword terminator, bool supportsExit, bool supportsContinue)
- {
- return () =>
- {
- using (PushSpanConfig(StatementBlockSpanConfiguration(new StatementCodeGenerator())))
- {
- SourceLocation blockStart = CurrentLocation;
- Assert(start);
- AcceptAndMoveNext();
- while (!EndOfFile)
- {
- VBSymbol lastWhitespace = AcceptWhiteSpaceInLines();
- if (IsAtEmbeddedTransition(allowTemplatesAndComments: true, allowTransitions: true))
- {
- HandleEmbeddedTransition(lastWhitespace);
- }
- else
- {
- Accept(lastWhitespace);
- if ((supportsExit && At(VBKeyword.Exit)) || (supportsContinue && At(VBKeyword.Continue)))
- {
- HandleExitOrContinue(start);
- }
- else if (At(start))
- {
- // Parse nested statement
- KeywordTerminatedStatement(start, terminator, supportsExit, supportsContinue)();
- }
- else if (At(terminator))
- {
- AcceptUntil(VBSymbolType.NewLine);
- Optional(VBSymbolType.NewLine);
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.AnyExceptNewline;
- return false;
- }
- else if (!EndOfFile)
- {
- AcceptAndMoveNext();
- }
- }
- }
-
- Context.OnError(blockStart,
- RazorResources.ParseError_BlockNotTerminated,
- start, terminator);
- return false;
- }
- };
- }
-
- protected void HandleExitOrContinue(VBKeyword keyword)
- {
- Assert(VBSymbolType.Keyword);
- Debug.Assert(CurrentSymbol.Keyword == VBKeyword.Continue || CurrentSymbol.Keyword == VBKeyword.Exit);
-
- // Accept, read whitespace and look for the next keyword
- AcceptAndMoveNext();
- AcceptWhile(VBSymbolType.WhiteSpace);
-
- // If this is the start keyword, skip it and continue (to avoid starting a nested statement block)
- Optional(keyword);
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.cs b/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.cs
deleted file mode 100644
index 4fa6194866..0000000000
--- a/src/Microsoft.AspNet.Razor/Parser/VBCodeParser.cs
+++ /dev/null
@@ -1,601 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using Microsoft.AspNet.Razor.Editor;
-using Microsoft.AspNet.Razor.Generator;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Resources;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.AspNet.Razor.Tokenizer;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-
-namespace Microsoft.AspNet.Razor.Parser
-{
- public partial class VBCodeParser : TokenizerBackedParser
- {
- internal static ISet DefaultKeywords = new HashSet(StringComparer.OrdinalIgnoreCase)
- {
- "functions",
- "code",
- "section",
- "do",
- "while",
- "if",
- "select",
- "for",
- "try",
- "with",
- "synclock",
- "using",
- "imports",
- "inherits",
- "option",
- "helper",
- "namespace",
- "class",
- "layout",
- "sessionstate"
- };
-
- private Dictionary> _keywordHandlers = new Dictionary>();
- private Dictionary> _directiveHandlers = new Dictionary>(StringComparer.OrdinalIgnoreCase);
-
- [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification = "Necessary state is initialized before calling virtual methods")]
- public VBCodeParser()
- {
- DirectParentIsCode = false;
- Keywords = new HashSet(StringComparer.OrdinalIgnoreCase);
- SetUpKeywords();
- SetUpDirectives();
- }
-
- protected internal ISet Keywords { get; private set; }
-
- protected override LanguageCharacteristics Language
- {
- get { return VBLanguageCharacteristics.Instance; }
- }
-
- protected override ParserBase OtherParser
- {
- get { return Context.MarkupParser; }
- }
-
- private bool IsNested { get; set; }
- private bool DirectParentIsCode { get; set; }
-
- protected override bool IsAtEmbeddedTransition(bool allowTemplatesAndComments, bool allowTransitions)
- {
- return (allowTransitions && Language.IsTransition(CurrentSymbol) && !Was(VBSymbolType.Dot)) ||
- (allowTemplatesAndComments && Language.IsCommentStart(CurrentSymbol)) ||
- (Language.IsTransition(CurrentSymbol) && NextIs(VBSymbolType.Transition));
- }
-
- protected override void HandleEmbeddedTransition()
- {
- HandleEmbeddedTransition(null);
- }
-
- protected void HandleEmbeddedTransition(VBSymbol lastWhiteSpace)
- {
- if (At(VBSymbolType.RazorCommentTransition))
- {
- Accept(lastWhiteSpace);
- RazorComment();
- }
- else if ((At(VBSymbolType.Transition) && !Was(VBSymbolType.Dot)))
- {
- HandleTransition(lastWhiteSpace);
- }
- }
-
- public override void ParseBlock()
- {
- if (Context == null)
- {
- throw new InvalidOperationException(RazorResources.Parser_Context_Not_Set);
- }
- using (PushSpanConfig())
- {
- if (Context == null)
- {
- throw new InvalidOperationException(RazorResources.Parser_Context_Not_Set);
- }
-
- Initialize(Span);
- NextToken();
- using (Context.StartBlock())
- {
- IEnumerable syms = ReadWhile(sym => sym.Type == VBSymbolType.WhiteSpace);
- if (At(VBSymbolType.Transition))
- {
- Accept(syms);
- Span.CodeGenerator = new StatementCodeGenerator();
- Output(SpanKind.Code);
- }
- else
- {
- PutBack(syms);
- EnsureCurrent();
- }
-
- // Allow a transition span, but don't require it
- if (Optional(VBSymbolType.Transition))
- {
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- Span.CodeGenerator = SpanCodeGenerator.Null;
- Output(SpanKind.Transition);
- }
-
- Context.CurrentBlock.Type = BlockType.Expression;
- Context.CurrentBlock.CodeGenerator = new ExpressionCodeGenerator();
-
- // Determine the type of the block
- bool isComplete = false;
- Action config = null;
- if (!EndOfFile)
- {
- switch (CurrentSymbol.Type)
- {
- case VBSymbolType.Identifier:
- if (!TryDirectiveBlock(ref isComplete))
- {
- ImplicitExpression();
- }
- break;
- case VBSymbolType.LeftParenthesis:
- isComplete = ExplicitExpression();
- break;
- case VBSymbolType.Keyword:
- Context.CurrentBlock.Type = BlockType.Statement;
- Context.CurrentBlock.CodeGenerator = BlockCodeGenerator.Null;
- isComplete = KeywordBlock();
- break;
- case VBSymbolType.WhiteSpace:
- case VBSymbolType.NewLine:
- config = ImplictExpressionSpanConfig;
- Context.OnError(CurrentLocation,
- RazorResources.ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_VB);
- break;
- default:
- config = ImplictExpressionSpanConfig;
- Context.OnError(CurrentLocation,
- RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_VB,
- CurrentSymbol.Content);
- break;
- }
- }
- else
- {
- config = ImplictExpressionSpanConfig;
- Context.OnError(CurrentLocation,
- RazorResources.ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock);
- }
- using (PushSpanConfig(config))
- {
- if (!isComplete && Span.Symbols.Count == 0 && Context.LastAcceptedCharacters != AcceptedCharacters.Any)
- {
- AddMarkerSymbolIfNecessary();
- }
- Output(SpanKind.Code);
- PutCurrentBack();
- }
- }
- }
- }
-
- private void ImplictExpressionSpanConfig(SpanBuilder span)
- {
- span.CodeGenerator = new ExpressionCodeGenerator();
- span.EditHandler = new ImplicitExpressionEditHandler(
- Language.TokenizeString,
- Keywords,
- acceptTrailingDot: DirectParentIsCode)
- {
- AcceptedCharacters = AcceptedCharacters.NonWhiteSpace
- };
- }
-
- private Action StatementBlockSpanConfiguration(SpanCodeGenerator codeGenerator)
- {
- return span =>
- {
- span.Kind = SpanKind.Code;
- span.CodeGenerator = codeGenerator;
- span.EditHandler = SpanEditHandler.CreateDefault(Language.TokenizeString);
- };
- }
-
- // Pass "complete" flag by ref, not out because some paths may not change it.
- private bool TryDirectiveBlock(ref bool complete)
- {
- Assert(VBSymbolType.Identifier);
- Func handler;
- if (_directiveHandlers.TryGetValue(CurrentSymbol.Content, out handler))
- {
- Context.CurrentBlock.CodeGenerator = BlockCodeGenerator.Null;
- complete = handler();
- return true;
- }
- return false;
- }
-
- private bool KeywordBlock()
- {
- Assert(VBSymbolType.Keyword);
- Func handler;
- if (_keywordHandlers.TryGetValue(CurrentSymbol.Keyword.Value, out handler))
- {
- Span.CodeGenerator = new StatementCodeGenerator();
- Context.CurrentBlock.Type = BlockType.Statement;
- return handler();
- }
- else
- {
- ImplicitExpression();
- return false;
- }
- }
-
- private bool ExplicitExpression()
- {
- Context.CurrentBlock.Type = BlockType.Expression;
- Context.CurrentBlock.CodeGenerator = new ExpressionCodeGenerator();
- SourceLocation start = CurrentLocation;
- Expected(VBSymbolType.LeftParenthesis);
- Span.CodeGenerator = SpanCodeGenerator.Null;
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- Output(SpanKind.MetaCode);
-
- Span.CodeGenerator = new ExpressionCodeGenerator();
- using (PushSpanConfig(span => span.CodeGenerator = new ExpressionCodeGenerator()))
- {
- if (!Balance(BalancingModes.NoErrorOnFailure |
- BalancingModes.BacktrackOnFailure |
- BalancingModes.AllowCommentsAndTemplates,
- VBSymbolType.LeftParenthesis,
- VBSymbolType.RightParenthesis,
- start))
- {
- Context.OnError(start,
- RazorResources.ParseError_Expected_EndOfBlock_Before_EOF,
- RazorResources.BlockName_ExplicitExpression,
- VBSymbol.GetSample(VBSymbolType.RightParenthesis),
- VBSymbol.GetSample(VBSymbolType.LeftParenthesis));
- AcceptUntil(VBSymbolType.NewLine);
- AddMarkerSymbolIfNecessary();
- Output(SpanKind.Code);
- PutCurrentBack();
- return false;
- }
- else
- {
- AddMarkerSymbolIfNecessary();
- Output(SpanKind.Code);
- Expected(VBSymbolType.RightParenthesis);
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
- Span.CodeGenerator = SpanCodeGenerator.Null;
- Output(SpanKind.MetaCode);
- PutCurrentBack();
- return true;
- }
- }
- }
-
- private void ImplicitExpression()
- {
- Context.CurrentBlock.Type = BlockType.Expression;
- Context.CurrentBlock.CodeGenerator = new ExpressionCodeGenerator();
- using (PushSpanConfig(ImplictExpressionSpanConfig))
- {
- Expected(VBSymbolType.Identifier, VBSymbolType.Keyword);
- Span.CodeGenerator = new ExpressionCodeGenerator();
- while (!EndOfFile)
- {
- switch (CurrentSymbol.Type)
- {
- case VBSymbolType.LeftParenthesis:
- SourceLocation start = CurrentLocation;
- AcceptAndMoveNext();
-
- Action oldConfig = SpanConfig;
- using (PushSpanConfig())
- {
- ConfigureSpan(span =>
- {
- oldConfig(span);
- span.EditHandler.AcceptedCharacters = AcceptedCharacters.Any;
- });
- Balance(BalancingModes.AllowCommentsAndTemplates,
- VBSymbolType.LeftParenthesis,
- VBSymbolType.RightParenthesis,
- start);
- }
- if (Optional(VBSymbolType.RightParenthesis))
- {
- Span.EditHandler.AcceptedCharacters = AcceptedCharacters.NonWhiteSpace;
- }
- break;
- case VBSymbolType.Dot:
- VBSymbol dot = CurrentSymbol;
- NextToken();
- if (At(VBSymbolType.Identifier) || At(VBSymbolType.Keyword))
- {
- Accept(dot);
- AcceptAndMoveNext();
- }
- else if (At(VBSymbolType.Transition))
- {
- VBSymbol at = CurrentSymbol;
- NextToken();
- if (At(VBSymbolType.Identifier) || At(VBSymbolType.Keyword))
- {
- Accept(dot);
- Accept(at);
- AcceptAndMoveNext();
- }
- else
- {
- PutBack(at);
- PutBack(dot);
- }
- }
- else
- {
- PutCurrentBack();
- if (IsNested)
- {
- Accept(dot);
- }
- else
- {
- PutBack(dot);
- }
- return;
- }
- break;
- default:
- PutCurrentBack();
- return;
- }
- }
- }
- }
-
- protected void MapKeyword(VBKeyword keyword, Func action)
- {
- _keywordHandlers[keyword] = action;
- Keywords.Add(keyword.ToString());
- }
-
- protected void MapDirective(string directive, Func action)
- {
- _directiveHandlers[directive] = action;
- Keywords.Add(directive);
- }
-
- [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This only occurs in Release builds, where this method is empty by design")]
- [Conditional("DEBUG")]
- protected void Assert(VBKeyword keyword)
- {
- Debug.Assert(CurrentSymbol.Type == VBSymbolType.Keyword && CurrentSymbol.Keyword == keyword);
- }
-
- protected bool At(VBKeyword keyword)
- {
- return At(VBSymbolType.Keyword) && CurrentSymbol.Keyword == keyword;
- }
-
- protected void OtherParserBlock()
- {
- OtherParserBlock(null, null);
- }
-
- protected void OtherParserBlock(string startSequence, string endSequence)
- {
- using (PushSpanConfig())
- {
- if (Span.Symbols.Count > 0)
- {
- Output(SpanKind.Code);
- }
-
- Context.SwitchActiveParser();
-
- bool old = DirectParentIsCode;
- DirectParentIsCode = false;
-
- Debug.Assert(ReferenceEquals(Context.ActiveParser, Context.MarkupParser));
- if (!String.IsNullOrEmpty(startSequence) || !String.IsNullOrEmpty(endSequence))
- {
- Context.MarkupParser.ParseSection(Tuple.Create(startSequence, endSequence), false);
- }
- else
- {
- Context.MarkupParser.ParseBlock();
- }
-
- DirectParentIsCode = old;
-
- Context.SwitchActiveParser();
- EnsureCurrent();
- }
- Initialize(Span);
- }
-
- protected void HandleTransition(VBSymbol lastWhiteSpace)
- {
- if (At(VBSymbolType.RazorCommentTransition))
- {
- Accept(lastWhiteSpace);
- RazorComment();
- return;
- }
-
- // Check the next character
- VBSymbol transition = CurrentSymbol;
- NextToken();
- if (At(VBSymbolType.LessThan) || At(VBSymbolType.Colon))
- {
- // Put the transition back
- PutCurrentBack();
- PutBack(transition);
-
- // If we're in design-time mode, accept the whitespace, otherwise put it back
- if (Context.DesignTimeMode)
- {
- Accept(lastWhiteSpace);
- }
- else
- {
- PutBack(lastWhiteSpace);
- }
-
- // Switch to markup
- OtherParserBlock();
- }
- else if (At(VBSymbolType.Transition))
- {
- if (Context.IsWithin(BlockType.Template))
- {
- Context.OnError(transition.Start, RazorResources.ParseError_InlineMarkup_Blocks_Cannot_Be_Nested);
- }
- Accept(lastWhiteSpace);
- VBSymbol transition2 = CurrentSymbol;
- NextToken();
- if (At(VBSymbolType.LessThan) || At(VBSymbolType.Colon))
- {
- PutCurrentBack();
- PutBack(transition2);
- PutBack(transition);
- Output(SpanKind.Code);
-
- // Start a template block and switch to Markup
- using (Context.StartBlock(BlockType.Template))
- {
- Context.CurrentBlock.CodeGenerator = new TemplateBlockCodeGenerator();
- OtherParserBlock();
- Initialize(Span);
- }
- }
- else
- {
- Accept(transition);
- Accept(transition2);
- }
- }
- else
- {
- Accept(lastWhiteSpace);
-
- PutCurrentBack();
- PutBack(transition);
-
- bool old = IsNested;
- IsNested = true;
- NestedBlock();
- IsNested = old;
- }
- }
-
- protected override void OutputSpanBeforeRazorComment()
- {
- Output(SpanKind.Code);
- }
-
- protected bool ReservedWord()
- {
- Context.CurrentBlock.Type = BlockType.Directive;
- Context.OnError(CurrentLocation, RazorResources.ParseError_ReservedWord, CurrentSymbol.Content);
- Span.CodeGenerator = SpanCodeGenerator.Null;
- AcceptAndMoveNext();
- Output(SpanKind.MetaCode, AcceptedCharacters.None);
- return true;
- }
-
- protected void NestedBlock()
- {
- using (PushSpanConfig())
- {
- Output(SpanKind.Code);
-
- bool old = DirectParentIsCode;
- DirectParentIsCode = true;
-
- ParseBlock();
-
- DirectParentIsCode = old;
- }
- Initialize(Span);
- }
-
- protected bool Required(VBSymbolType expected, string errorBase)
- {
- if (!Optional(expected))
- {
- Context.OnError(CurrentLocation, errorBase, GetCurrentSymbolDisplay());
- return false;
- }
- return true;
- }
-
- protected bool Optional(VBKeyword keyword)
- {
- if (At(keyword))
- {
- AcceptAndMoveNext();
- return true;
- }
- return false;
- }
-
- protected void AcceptVBSpaces()
- {
- Accept(ReadVBSpacesLazy());
- }
-
- protected IEnumerable ReadVBSpaces()
- {
- return ReadVBSpacesLazy().ToList();
- }
-
- public bool IsDirectiveDefined(string directive)
- {
- return _directiveHandlers.ContainsKey(directive);
- }
-
- private IEnumerable ReadVBSpacesLazy()
- {
- foreach (var symbol in ReadWhileLazy(sym => sym.Type == VBSymbolType.WhiteSpace))
- {
- yield return symbol;
- }
- while (At(VBSymbolType.LineContinuation))
- {
- int bookmark = CurrentLocation.AbsoluteIndex;
- VBSymbol under = CurrentSymbol;
- NextToken();
- if (At(VBSymbolType.NewLine))
- {
- yield return under;
- yield return CurrentSymbol;
- NextToken();
- foreach (var symbol in ReadVBSpaces())
- {
- yield return symbol;
- }
- }
- else
- {
- Context.Source.Position = bookmark;
- NextToken();
- yield break;
- }
- }
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Parser/VBLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/VBLanguageCharacteristics.cs
deleted file mode 100644
index 213db975a4..0000000000
--- a/src/Microsoft.AspNet.Razor/Parser/VBLanguageCharacteristics.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.AspNet.Razor.Tokenizer;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-
-namespace Microsoft.AspNet.Razor.Parser
-{
- public class VBLanguageCharacteristics : LanguageCharacteristics
- {
- private static readonly VBLanguageCharacteristics _instance = new VBLanguageCharacteristics();
-
- private VBLanguageCharacteristics()
- {
- }
-
- public static VBLanguageCharacteristics Instance
- {
- get { return _instance; }
- }
-
- public override VBTokenizer CreateTokenizer(ITextDocument source)
- {
- return new VBTokenizer(source);
- }
-
- public override string GetSample(VBSymbolType type)
- {
- return VBSymbol.GetSample(type);
- }
-
- public override VBSymbolType FlipBracket(VBSymbolType bracket)
- {
- switch (bracket)
- {
- case VBSymbolType.LeftBrace:
- return VBSymbolType.RightBrace;
- case VBSymbolType.LeftBracket:
- return VBSymbolType.RightBracket;
- case VBSymbolType.LeftParenthesis:
- return VBSymbolType.RightParenthesis;
- case VBSymbolType.RightBrace:
- return VBSymbolType.LeftBrace;
- case VBSymbolType.RightBracket:
- return VBSymbolType.LeftBracket;
- case VBSymbolType.RightParenthesis:
- return VBSymbolType.LeftParenthesis;
- default:
- return VBSymbolType.Unknown;
- }
- }
-
- public override VBSymbol CreateMarkerSymbol(SourceLocation location)
- {
- return new VBSymbol(location, String.Empty, VBSymbolType.Unknown);
- }
-
- public override VBSymbolType GetKnownSymbolType(KnownSymbolType type)
- {
- switch (type)
- {
- case KnownSymbolType.CommentStart:
- return VBSymbolType.RazorCommentTransition;
- case KnownSymbolType.CommentStar:
- return VBSymbolType.RazorCommentStar;
- case KnownSymbolType.CommentBody:
- return VBSymbolType.RazorComment;
- case KnownSymbolType.Identifier:
- return VBSymbolType.Identifier;
- case KnownSymbolType.Keyword:
- return VBSymbolType.Keyword;
- case KnownSymbolType.NewLine:
- return VBSymbolType.NewLine;
- case KnownSymbolType.Transition:
- return VBSymbolType.Transition;
- case KnownSymbolType.WhiteSpace:
- return VBSymbolType.WhiteSpace;
- default:
- return VBSymbolType.Unknown;
- }
- }
-
- protected override VBSymbol CreateSymbol(SourceLocation location, string content, VBSymbolType type, IEnumerable errors)
- {
- return new VBSymbol(location, content, type, errors);
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/RazorCodeLanguage.cs b/src/Microsoft.AspNet.Razor/RazorCodeLanguage.cs
index 8291081718..eb8101340c 100644
--- a/src/Microsoft.AspNet.Razor/RazorCodeLanguage.cs
+++ b/src/Microsoft.AspNet.Razor/RazorCodeLanguage.cs
@@ -14,8 +14,7 @@ namespace Microsoft.AspNet.Razor
{
private static IDictionary _services = new Dictionary(StringComparer.OrdinalIgnoreCase)
{
- { "cshtml", new CSharpRazorCodeLanguage() },
- { "vbhtml", new VBRazorCodeLanguage() }
+ { "cshtml", new CSharpRazorCodeLanguage() }
};
///
@@ -30,11 +29,12 @@ namespace Microsoft.AspNet.Razor
/// The name of the language (for use in System.Web.Compilation.BuildProvider.GetDefaultCompilerTypeForLanguage)
///
public abstract string LanguageName { get; }
-
+#if NET45
///
/// The type of the CodeDOM provider for this language
///
public abstract Type CodeDomProviderType { get; }
+#endif
///
/// Gets the RazorCodeLanguage registered for the specified file extension
diff --git a/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs b/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs
index be7c267b12..08ccff7ef2 100644
--- a/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs
+++ b/src/Microsoft.AspNet.Razor/RazorDebugHelpers.cs
@@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Razor
{
get { return _outputDebuggingEnabled; }
}
-
+#if NET45
[SuppressMessage("Microsoft.Security", "CA2141:TransparentMethodsMustNotSatisfyLinkDemandsFxCopRule", Justification = "This is debug only")]
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "This is debug only")]
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.IO.StringWriter.#ctor", Justification = "This is debug only")]
@@ -69,7 +69,7 @@ namespace Microsoft.AspNet.Razor
}
});
}
-
+#endif
internal static void WriteDebugTree(string sourceFile, Block document, PartialParseResult result, TextChange change, RazorEditorParser parser, bool treeStructureChanged)
{
if (!OutputDebuggingEnabled)
diff --git a/src/Microsoft.AspNet.Razor/RazorDirectiveAttribute.cs b/src/Microsoft.AspNet.Razor/RazorDirectiveAttribute.cs
index 2304531330..95cab6ddf4 100644
--- a/src/Microsoft.AspNet.Razor/RazorDirectiveAttribute.cs
+++ b/src/Microsoft.AspNet.Razor/RazorDirectiveAttribute.cs
@@ -11,8 +11,6 @@ namespace Microsoft.AspNet.Razor
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class RazorDirectiveAttribute : Attribute
{
- private readonly object _typeId = new object();
-
public RazorDirectiveAttribute(string name, string value)
{
if (String.IsNullOrEmpty(name))
@@ -24,11 +22,6 @@ namespace Microsoft.AspNet.Razor
Value = value;
}
- public override object TypeId
- {
- get { return _typeId; }
- }
-
public string Name { get; private set; }
public string Value { get; private set; }
diff --git a/src/Microsoft.AspNet.Razor/RazorEngineHost.cs b/src/Microsoft.AspNet.Razor/RazorEngineHost.cs
index d100bf1d5c..fb3dbe6c61 100644
--- a/src/Microsoft.AspNet.Razor/RazorEngineHost.cs
+++ b/src/Microsoft.AspNet.Razor/RazorEngineHost.cs
@@ -200,7 +200,7 @@ namespace Microsoft.AspNet.Razor
}
return incomingCodeGenerator;
}
-
+#if NET45
///
/// Gets the important CodeDOM nodes generated by the code generator and has a chance to add to them.
///
@@ -236,5 +236,6 @@ namespace Microsoft.AspNet.Razor
throw new ArgumentNullException("executeMethod");
}
}
+#endif
}
}
diff --git a/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs b/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs
index 58cf49a62e..6e786aad5f 100644
--- a/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs
+++ b/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs
@@ -166,15 +166,18 @@ namespace Microsoft.AspNet.Razor
RazorCodeGenerator generator = CreateCodeGenerator(className, rootNamespace, sourceFileName);
generator.DesignTimeMode = Host.DesignTimeMode;
generator.Visit(results);
-
+#if NET45
// Post process code
Host.PostProcessGeneratedCode(generator.Context);
+#endif
// Extract design-time mappings
IDictionary designTimeLineMappings = null;
if (Host.DesignTimeMode)
{
+#if NET45
designTimeLineMappings = generator.Context.CodeMappings;
+#endif
}
var builder = new CSharpCodeBuilder(generator.Context.CodeTreeBuilder.CodeTree, rootNamespace, Host, sourceFileName);
@@ -183,7 +186,9 @@ namespace Microsoft.AspNet.Razor
// Collect results and return
return new GeneratorResults(results, builderResult)
{
+#if NET45
CCU = generator.Context.CompileUnit,
+#endif
CT = generator.Context.CodeTreeBuilder.CodeTree
};
}
diff --git a/src/Microsoft.AspNet.Razor/Resources/RazorResources.Designer.cs b/src/Microsoft.AspNet.Razor/Resources/RazorResources.Designer.cs
index 28d71aa195..915daca451 100644
--- a/src/Microsoft.AspNet.Razor/Resources/RazorResources.Designer.cs
+++ b/src/Microsoft.AspNet.Razor/Resources/RazorResources.Designer.cs
@@ -8,10 +8,11 @@
//
//------------------------------------------------------------------------------
-namespace Microsoft.AspNet.Razor.Resources {
+namespace Microsoft.AspNet.Razor.Resources
+{
using System;
-
-
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
@@ -22,269 +23,329 @@ namespace Microsoft.AspNet.Razor.Resources {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class RazorResources {
-
+ internal class RazorResources
+ {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal RazorResources() {
+ internal RazorResources()
+ {
}
-
+
///
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if (object.ReferenceEquals(resourceMan, null))
+ {
+#if NET45
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.Razor.Resources.RazorResources", typeof(RazorResources).Assembly);
resourceMan = temp;
+#endif
}
return resourceMan;
}
}
-
+
///
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
return resourceCulture;
}
- set {
+ set
+ {
resourceCulture = value;
}
}
-
+
///
/// Looks up a localized string similar to The active parser must the same as either the markup or code parser..
///
- internal static string ActiveParser_Must_Be_Code_Or_Markup_Parser {
- get {
+ internal static string ActiveParser_Must_Be_Code_Or_Markup_Parser
+ {
+ get
+ {
return ResourceManager.GetString("ActiveParser_Must_Be_Code_Or_Markup_Parser", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Block cannot be built because a Type has not been specified in the BlockBuilder.
///
- internal static string Block_Type_Not_Specified {
- get {
+ internal static string Block_Type_Not_Specified
+ {
+ get
+ {
return ResourceManager.GetString("Block_Type_Not_Specified", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to code.
///
- internal static string BlockName_Code {
- get {
+ internal static string BlockName_Code
+ {
+ get
+ {
return ResourceManager.GetString("BlockName_Code", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to explicit expression.
///
- internal static string BlockName_ExplicitExpression {
- get {
+ internal static string BlockName_ExplicitExpression
+ {
+ get
+ {
return ResourceManager.GetString("BlockName_ExplicitExpression", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The "CancelBacktrack" method can be called only while in a look-ahead process started with the "BeginLookahead" method..
///
- internal static string CancelBacktrack_Must_Be_Called_Within_Lookahead {
- get {
+ internal static string CancelBacktrack_Must_Be_Called_Within_Lookahead
+ {
+ get
+ {
return ResourceManager.GetString("CancelBacktrack_Must_Be_Called_Within_Lookahead", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot call CreateCodeWriter, a CodeWriter was not provided to the Create method.
///
- internal static string CreateCodeWriter_NoCodeWriter {
- get {
+ internal static string CreateCodeWriter_NoCodeWriter
+ {
+ get
+ {
return ResourceManager.GetString("CreateCodeWriter_NoCodeWriter", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<character literal>>.
///
- internal static string CSharpSymbol_CharacterLiteral {
- get {
+ internal static string CSharpSymbol_CharacterLiteral
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_CharacterLiteral", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<comment>>.
///
- internal static string CSharpSymbol_Comment {
- get {
+ internal static string CSharpSymbol_Comment
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_Comment", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<identifier>>.
///
- internal static string CSharpSymbol_Identifier {
- get {
+ internal static string CSharpSymbol_Identifier
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_Identifier", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<integer literal>>.
///
- internal static string CSharpSymbol_IntegerLiteral {
- get {
+ internal static string CSharpSymbol_IntegerLiteral
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_IntegerLiteral", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<keyword>>.
///
- internal static string CSharpSymbol_Keyword {
- get {
+ internal static string CSharpSymbol_Keyword
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_Keyword", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<newline sequence>>.
///
- internal static string CSharpSymbol_Newline {
- get {
+ internal static string CSharpSymbol_Newline
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_Newline", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<real literal>>.
///
- internal static string CSharpSymbol_RealLiteral {
- get {
+ internal static string CSharpSymbol_RealLiteral
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_RealLiteral", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<string literal>>.
///
- internal static string CSharpSymbol_StringLiteral {
- get {
+ internal static string CSharpSymbol_StringLiteral
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_StringLiteral", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<white space>>.
///
- internal static string CSharpSymbol_Whitespace {
- get {
+ internal static string CSharpSymbol_Whitespace
+ {
+ get
+ {
return ResourceManager.GetString("CSharpSymbol_Whitespace", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to "EndBlock" was called without a matching call to "StartBlock"..
///
- internal static string EndBlock_Called_Without_Matching_StartBlock {
- get {
+ internal static string EndBlock_Called_Without_Matching_StartBlock
+ {
+ get
+ {
return ResourceManager.GetString("EndBlock_Called_Without_Matching_StartBlock", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to "{0}" character.
///
- internal static string ErrorComponent_Character {
- get {
+ internal static string ErrorComponent_Character
+ {
+ get
+ {
return ResourceManager.GetString("ErrorComponent_Character", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to end of file.
///
- internal static string ErrorComponent_EndOfFile {
- get {
+ internal static string ErrorComponent_EndOfFile
+ {
+ get
+ {
return ResourceManager.GetString("ErrorComponent_EndOfFile", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to line break.
///
- internal static string ErrorComponent_Newline {
- get {
+ internal static string ErrorComponent_Newline
+ {
+ get
+ {
return ResourceManager.GetString("ErrorComponent_Newline", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to space or line break.
///
- internal static string ErrorComponent_Whitespace {
- get {
+ internal static string ErrorComponent_Whitespace
+ {
+ get
+ {
return ResourceManager.GetString("ErrorComponent_Whitespace", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<newline sequence>>.
///
- internal static string HtmlSymbol_NewLine {
- get {
+ internal static string HtmlSymbol_NewLine
+ {
+ get
+ {
return ResourceManager.GetString("HtmlSymbol_NewLine", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<razor comment>>.
///
- internal static string HtmlSymbol_RazorComment {
- get {
+ internal static string HtmlSymbol_RazorComment
+ {
+ get
+ {
return ResourceManager.GetString("HtmlSymbol_RazorComment", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<text>>.
///
- internal static string HtmlSymbol_Text {
- get {
+ internal static string HtmlSymbol_Text
+ {
+ get
+ {
return ResourceManager.GetString("HtmlSymbol_Text", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<white space>>.
///
- internal static string HtmlSymbol_WhiteSpace {
- get {
+ internal static string HtmlSymbol_WhiteSpace
+ {
+ get
+ {
return ResourceManager.GetString("HtmlSymbol_WhiteSpace", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot use built-in RazorComment handler, language characteristics does not define the CommentStart, CommentStar and CommentBody known symbol types or parser does not override TokenizerBackedParser.OutputSpanBeforeRazorComment.
///
- internal static string Language_Does_Not_Support_RazorComment {
- get {
+ internal static string Language_Does_Not_Support_RazorComment
+ {
+ get
+ {
return ResourceManager.GetString("Language_Does_Not_Support_RazorComment", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The "@" character must be followed by a ":", "(", or a C# identifier. If you intended to switch to markup, use an HTML start tag, for example:
///
@@ -292,129 +353,157 @@ namespace Microsoft.AspNet.Razor.Resources {
/// <p>Hello, @user!</p>
///}.
///
- internal static string ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start {
- get {
+ internal static string ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence..
///
- internal static string ParseError_BlockComment_Not_Terminated {
- get {
+ internal static string ParseError_BlockComment_Not_Terminated
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_BlockComment_Not_Terminated", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The "{0}" block was not terminated. All "{0}" statements must be terminated with a matching "{1}"..
///
- internal static string ParseError_BlockNotTerminated {
- get {
+ internal static string ParseError_BlockNotTerminated
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_BlockNotTerminated", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to An opening "{0}" is missing the corresponding closing "{1}"..
///
- internal static string ParseError_Expected_CloseBracket_Before_EOF {
- get {
+ internal static string ParseError_Expected_CloseBracket_Before_EOF
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Expected_CloseBracket_Before_EOF", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The {0} block is missing a closing "{1}" character. Make sure you have a matching "{1}" character for all the "{2}" characters within this block, and that none of the "{1}" characters are being interpreted as markup..
///
- internal static string ParseError_Expected_EndOfBlock_Before_EOF {
- get {
+ internal static string ParseError_Expected_EndOfBlock_Before_EOF
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Expected_EndOfBlock_Before_EOF", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Expected "{0}"..
///
- internal static string ParseError_Expected_X {
- get {
+ internal static string ParseError_Expected_X
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Expected_X", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Helper blocks cannot be nested within each other..
///
- internal static string ParseError_Helpers_Cannot_Be_Nested {
- get {
+ internal static string ParseError_Helpers_Cannot_Be_Nested
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Helpers_Cannot_Be_Nested", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The 'inherits' keyword must be followed by a type name on the same line..
///
- internal static string ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName {
- get {
+ internal static string ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed..
///
- internal static string ParseError_InlineMarkup_Blocks_Cannot_Be_Nested {
- get {
+ internal static string ParseError_InlineMarkup_Blocks_Cannot_Be_Nested
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_InlineMarkup_Blocks_Cannot_Be_Nested", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to "{1}" is not a valid value for the "{0}" option. The "Option {0}" statement must be followed by either "On" or "Off". .
///
- internal static string ParseError_InvalidOptionValue {
- get {
+ internal static string ParseError_InvalidOptionValue
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_InvalidOptionValue", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Markup in a code block must start with a tag and all start tags must be matched with end tags. Do not use unclosed tags like "<br>". Instead use self-closing tags like "<br/>"..
///
- internal static string ParseError_MarkupBlock_Must_Start_With_Tag {
- get {
+ internal static string ParseError_MarkupBlock_Must_Start_With_Tag
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_MarkupBlock_Must_Start_With_Tag", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Expected a "{0}" after the helper name..
///
- internal static string ParseError_MissingCharAfterHelperName {
- get {
+ internal static string ParseError_MissingCharAfterHelperName
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_MissingCharAfterHelperName", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Expected a "{0}" after the helper parameters..
///
- internal static string ParseError_MissingCharAfterHelperParameters {
- get {
+ internal static string ParseError_MissingCharAfterHelperParameters
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_MissingCharAfterHelperParameters", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The "{0}" element was not closed. All elements must be either self-closing or have a matching end tag..
///
- internal static string ParseError_MissingEndTag {
- get {
+ internal static string ParseError_MissingEndTag
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_MissingEndTag", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Sections cannot be empty. The "@section" keyword must be followed by a block of markup surrounded by "{}". For example:
///
@@ -422,12 +511,14 @@ namespace Microsoft.AspNet.Razor.Resources {
/// <!-- Markup and text goes here -->
///}.
///
- internal static string ParseError_MissingOpenBraceAfterSection {
- get {
+ internal static string ParseError_MissingOpenBraceAfterSection
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_MissingOpenBraceAfterSection", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Namespace imports and type aliases cannot be placed within code blocks. They must immediately follow an "@" character in markup. It is recommended that you put them at the top of the page, as in the following example:
///
@@ -436,57 +527,69 @@ namespace Microsoft.AspNet.Razor.Resources {
/// // OK here to use types from System.Drawing in the page.
///}.
///
- internal static string ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock {
- get {
+ internal static string ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The "Imports" keyword must be followed by a namespace or a type alias on the same line..
///
- internal static string ParseError_NamespaceOrTypeAliasExpected {
- get {
+ internal static string ParseError_NamespaceOrTypeAliasExpected
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_NamespaceOrTypeAliasExpected", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Outer tag is missing a name. The first character of a markup block must be an HTML tag with a valid name..
///
- internal static string ParseError_OuterTagMissingName {
- get {
+ internal static string ParseError_OuterTagMissingName
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_OuterTagMissingName", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" sequence..
///
- internal static string ParseError_RazorComment_Not_Terminated {
- get {
+ internal static string ParseError_RazorComment_Not_Terminated
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_RazorComment_Not_Terminated", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to "{0}" is a reserved word and cannot be used in implicit expressions. An explicit expression ("@()") must be used..
///
- internal static string ParseError_ReservedWord {
- get {
+ internal static string ParseError_ReservedWord
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_ReservedWord", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Section blocks ("{0}") cannot be nested. Only one level of section blocks are allowed..
///
- internal static string ParseError_Sections_Cannot_Be_Nested {
- get {
+ internal static string ParseError_Sections_Cannot_Be_Nested
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Sections_Cannot_Be_Nested", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Expected a "{0}" but found a "{1}". Block statements must be enclosed in "{{" and "}}". You cannot use single-statement control-flow statements in CSHTML pages. For example, the following is not allowed:
///
@@ -499,505 +602,463 @@ namespace Microsoft.AspNet.Razor.Resources {
/// <p>Hello, @user</p>
///}}.
///
- internal static string ParseError_SingleLine_ControlFlowStatements_Not_Allowed {
- get {
+ internal static string ParseError_SingleLine_ControlFlowStatements_Not_Allowed
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_SingleLine_ControlFlowStatements_Not_Allowed", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to "<text>" and "</text>" tags cannot contain attributes..
///
- internal static string ParseError_TextTagCannotContainAttributes {
- get {
+ internal static string ParseError_TextTagCannotContainAttributes
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_TextTagCannotContainAttributes", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unexpected "{0}".
///
- internal static string ParseError_Unexpected {
- get {
+ internal static string ParseError_Unexpected
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unexpected {0} after helper keyword. All helpers must have a name which starts with an "_" or alphabetic character. The remaining characters must be either "_" or alphanumeric..
///
- internal static string ParseError_Unexpected_Character_At_Helper_Name_Start {
- get {
+ internal static string ParseError_Unexpected_Character_At_Helper_Name_Start
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_Character_At_Helper_Name_Start", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unexpected {0} after section keyword. Section names must start with an "_" or alphabetic character, and the remaining characters must be either "_" or alphanumeric..
///
- internal static string ParseError_Unexpected_Character_At_Section_Name_Start {
- get {
+ internal static string ParseError_Unexpected_Character_At_Section_Name_Start
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_Character_At_Section_Name_Start", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to "{0}" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{{" are valid..
///
- internal static string ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS {
- get {
+ internal static string ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS", resourceCulture);
}
}
-
- ///
- /// Looks up a localized string similar to "{0}" is not valid at the start of a code block. Only identifiers, keywords, comments, and "(" are valid..
- ///
- internal static string ParseError_Unexpected_Character_At_Start_Of_CodeBlock_VB {
- get {
- return ResourceManager.GetString("ParseError_Unexpected_Character_At_Start_Of_CodeBlock_VB", resourceCulture);
- }
- }
-
+
///
/// Looks up a localized string similar to End-of-file was found after the "@" character. "@" must be followed by a valid code block. If you want to output an "@", escape it using the sequence: "@@".
///
- internal static string ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock {
- get {
+ internal static string ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unexpected "{0}" keyword after "@" character. Once inside code, you do not need to prefix constructs like "{0}" with "@"..
///
- internal static string ParseError_Unexpected_Keyword_After_At {
- get {
+ internal static string ParseError_Unexpected_Keyword_After_At
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_Keyword_After_At", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unexpected "{" after "@" character. Once inside the body of a code block (@if {}, @{}, etc.) you do not need to use "@{" to switch to code..
///
- internal static string ParseError_Unexpected_Nested_CodeBlock {
- get {
+ internal static string ParseError_Unexpected_Nested_CodeBlock
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_Nested_CodeBlock", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "@" with no space in between..
///
- internal static string ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS {
- get {
+ internal static string ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS", resourceCulture);
}
}
-
- ///
- /// Looks up a localized string similar to A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, and "(" are valid at the start of a code block and they must occur immediately following "@" with no space in between..
- ///
- internal static string ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_VB {
- get {
- return ResourceManager.GetString("ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_VB", resourceCulture);
- }
- }
-
+
///
/// Looks up a localized string similar to Encountered end tag "{0}" with no matching start tag. Are your start/end tags properly balanced?.
///
- internal static string ParseError_UnexpectedEndTag {
- get {
+ internal static string ParseError_UnexpectedEndTag
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_UnexpectedEndTag", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to End of file or an unexpected character was reached before the "{0}" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "<" HTML entity..
///
- internal static string ParseError_UnfinishedTag {
- get {
+ internal static string ParseError_UnfinishedTag
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_UnfinishedTag", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unknown option: "{0}"..
///
- internal static string ParseError_UnknownOption {
- get {
+ internal static string ParseError_UnknownOption
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_UnknownOption", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines..
///
- internal static string ParseError_Unterminated_String_Literal {
- get {
+ internal static string ParseError_Unterminated_String_Literal
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_Unterminated_String_Literal", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Helper parameter list is missing a closing ")"..
///
- internal static string ParseError_UnterminatedHelperParameterList {
- get {
+ internal static string ParseError_UnterminatedHelperParameterList
+ {
+ get
+ {
return ResourceManager.GetString("ParseError_UnterminatedHelperParameterList", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Parser was started with a null Context property. The Context property must be set BEFORE calling any methods on the parser..
///
- internal static string Parser_Context_Not_Set {
- get {
+ internal static string Parser_Context_Not_Set
+ {
+ get
+ {
return ResourceManager.GetString("Parser_Context_Not_Set", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot complete the tree, StartBlock must be called at least once..
///
- internal static string ParserContext_CannotCompleteTree_NoRootBlock {
- get {
+ internal static string ParserContext_CannotCompleteTree_NoRootBlock
+ {
+ get
+ {
return ResourceManager.GetString("ParserContext_CannotCompleteTree_NoRootBlock", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot complete the tree, there are still open blocks..
///
- internal static string ParserContext_CannotCompleteTree_OutstandingBlocks {
- get {
+ internal static string ParserContext_CannotCompleteTree_OutstandingBlocks
+ {
+ get
+ {
return ResourceManager.GetString("ParserContext_CannotCompleteTree_OutstandingBlocks", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot finish span, there is no current block. Call StartBlock at least once before finishing a span.
///
- internal static string ParserContext_NoCurrentBlock {
- get {
+ internal static string ParserContext_NoCurrentBlock
+ {
+ get
+ {
return ResourceManager.GetString("ParserContext_NoCurrentBlock", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot complete action, the parser has finished. Only CompleteParse can be called to extract the final parser results after the parser has finished.
///
- internal static string ParserContext_ParseComplete {
- get {
+ internal static string ParserContext_ParseComplete
+ {
+ get
+ {
return ResourceManager.GetString("ParserContext_ParseComplete", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Missing value for session state directive..
///
- internal static string ParserEror_SessionDirectiveMissingValue {
- get {
+ internal static string ParserEror_SessionDirectiveMissingValue
+ {
+ get
+ {
return ResourceManager.GetString("ParserEror_SessionDirectiveMissingValue", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to The parser provided to the ParserContext was not a Markup Parser..
///
- internal static string ParserIsNotAMarkupParser {
- get {
+ internal static string ParserIsNotAMarkupParser
+ {
+ get
+ {
return ResourceManager.GetString("ParserIsNotAMarkupParser", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to @section Header { ... }.
///
- internal static string SectionExample_CS {
- get {
+ internal static string SectionExample_CS
+ {
+ get
+ {
return ResourceManager.GetString("SectionExample_CS", resourceCulture);
}
}
-
- ///
- /// Looks up a localized string similar to @Section Header ... End Section.
- ///
- internal static string SectionExample_VB {
- get {
- return ResourceManager.GetString("SectionExample_VB", resourceCulture);
- }
- }
-
+
///
/// Looks up a localized string similar to The {0} property of the {1} structure cannot be null..
///
- internal static string Structure_Member_CannotBeNull {
- get {
+ internal static string Structure_Member_CannotBeNull
+ {
+ get
+ {
return ResourceManager.GetString("Structure_Member_CannotBeNull", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to <<unknown>>.
///
- internal static string Symbol_Unknown {
- get {
+ internal static string Symbol_Unknown
+ {
+ get
+ {
return ResourceManager.GetString("Symbol_Unknown", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Cannot resume this symbol. Only the symbol immediately preceding the current one can be resumed..
///
- internal static string Tokenizer_CannotResumeSymbolUnlessIsPrevious {
- get {
+ internal static string Tokenizer_CannotResumeSymbolUnlessIsPrevious
+ {
+ get
+ {
return ResourceManager.GetString("Tokenizer_CannotResumeSymbolUnlessIsPrevious", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to In order to put a symbol back, it must have been the symbol which ended at the current position. The specified symbol ends at {0}, but the current position is {1}.
///
- internal static string TokenizerView_CannotPutBack {
- get {
+ internal static string TokenizerView_CannotPutBack
+ {
+ get
+ {
return ResourceManager.GetString("TokenizerView_CannotPutBack", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] Shutdown.
///
- internal static string Trace_BackgroundThreadShutdown {
- get {
+ internal static string Trace_BackgroundThreadShutdown
+ {
+ get
+ {
return ResourceManager.GetString("Trace_BackgroundThreadShutdown", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] Startup.
///
- internal static string Trace_BackgroundThreadStart {
- get {
+ internal static string Trace_BackgroundThreadStart
+ {
+ get
+ {
return ResourceManager.GetString("Trace_BackgroundThreadStart", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] {1} changes arrived.
///
- internal static string Trace_ChangesArrived {
- get {
+ internal static string Trace_ChangesArrived
+ {
+ get
+ {
return ResourceManager.GetString("Trace_ChangesArrived", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] Discarded {1} changes.
///
- internal static string Trace_ChangesDiscarded {
- get {
+ internal static string Trace_ChangesDiscarded
+ {
+ get
+ {
return ResourceManager.GetString("Trace_ChangesDiscarded", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] Collecting {1} discarded changes.
///
- internal static string Trace_CollectedDiscardedChanges {
- get {
+ internal static string Trace_CollectedDiscardedChanges
+ {
+ get
+ {
return ResourceManager.GetString("Trace_CollectedDiscardedChanges", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Disabled.
///
- internal static string Trace_Disabled {
- get {
+ internal static string Trace_Disabled
+ {
+ get
+ {
return ResourceManager.GetString("Trace_Disabled", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [P][{0}] {3} Change in {2} milliseconds: {1}.
///
- internal static string Trace_EditorProcessedChange {
- get {
+ internal static string Trace_EditorProcessedChange
+ {
+ get
+ {
return ResourceManager.GetString("Trace_EditorProcessedChange", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [P][{0}] Received Change: {1}.
///
- internal static string Trace_EditorReceivedChange {
- get {
+ internal static string Trace_EditorReceivedChange
+ {
+ get
+ {
return ResourceManager.GetString("Trace_EditorReceivedChange", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Enabled.
///
- internal static string Trace_Enabled {
- get {
+ internal static string Trace_Enabled
+ {
+ get
+ {
return ResourceManager.GetString("Trace_Enabled", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [Razor] {0}.
///
- internal static string Trace_Format {
- get {
+ internal static string Trace_Format
+ {
+ get
+ {
return ResourceManager.GetString("Trace_Format", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] no changes arrived?.
///
- internal static string Trace_NoChangesArrived {
- get {
+ internal static string Trace_NoChangesArrived
+ {
+ get
+ {
return ResourceManager.GetString("Trace_NoChangesArrived", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] Parse Complete in {1} milliseconds.
///
- internal static string Trace_ParseComplete {
- get {
+ internal static string Trace_ParseComplete
+ {
+ get
+ {
return ResourceManager.GetString("Trace_ParseComplete", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [M][{0}] Queuing Parse for: {1}.
///
- internal static string Trace_QueuingParse {
- get {
+ internal static string Trace_QueuingParse
+ {
+ get
+ {
return ResourceManager.GetString("Trace_QueuingParse", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [Razor] Editor Tracing {0}.
///
- internal static string Trace_Startup {
- get {
+ internal static string Trace_Startup
+ {
+ get
+ {
return ResourceManager.GetString("Trace_Startup", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to [BG][{0}] Trees Compared in {1} milliseconds. Different = {2}.
///
- internal static string Trace_TreesCompared {
- get {
+ internal static string Trace_TreesCompared
+ {
+ get
+ {
return ResourceManager.GetString("Trace_TreesCompared", resourceCulture);
}
}
-
- ///
- /// Looks up a localized string similar to <<character literal>>.
- ///
- internal static string VBSymbol_CharacterLiteral {
- get {
- return ResourceManager.GetString("VBSymbol_CharacterLiteral", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<comment>>.
- ///
- internal static string VBSymbol_Comment {
- get {
- return ResourceManager.GetString("VBSymbol_Comment", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<date literal>>.
- ///
- internal static string VBSymbol_DateLiteral {
- get {
- return ResourceManager.GetString("VBSymbol_DateLiteral", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<floating point literal>>.
- ///
- internal static string VBSymbol_FloatingPointLiteral {
- get {
- return ResourceManager.GetString("VBSymbol_FloatingPointLiteral", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<identifier>>.
- ///
- internal static string VBSymbol_Identifier {
- get {
- return ResourceManager.GetString("VBSymbol_Identifier", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<integer literal>>.
- ///
- internal static string VBSymbol_IntegerLiteral {
- get {
- return ResourceManager.GetString("VBSymbol_IntegerLiteral", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<keyword>>.
- ///
- internal static string VBSymbol_Keyword {
- get {
- return ResourceManager.GetString("VBSymbol_Keyword", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<newline sequence>>.
- ///
- internal static string VBSymbol_NewLine {
- get {
- return ResourceManager.GetString("VBSymbol_NewLine", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<razor comment>>.
- ///
- internal static string VBSymbol_RazorComment {
- get {
- return ResourceManager.GetString("VBSymbol_RazorComment", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<string literal>>.
- ///
- internal static string VBSymbol_StringLiteral {
- get {
- return ResourceManager.GetString("VBSymbol_StringLiteral", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to <<white space>>.
- ///
- internal static string VBSymbol_WhiteSpace {
- get {
- return ResourceManager.GetString("VBSymbol_WhiteSpace", resourceCulture);
- }
- }
}
}
diff --git a/src/Microsoft.AspNet.Razor/Resources/RazorResources.resx b/src/Microsoft.AspNet.Razor/Resources/RazorResources.resx
index ae500cb212..10234812f7 100644
--- a/src/Microsoft.AspNet.Razor/Resources/RazorResources.resx
+++ b/src/Microsoft.AspNet.Razor/Resources/RazorResources.resx
@@ -177,10 +177,6 @@
// OK here to use types from System.Drawing in the page.
}
-
- Section blocks ("{0}") cannot be nested. Only one level of section blocks are allowed.
- {0} is one of SectionExample_VB or SectionExample_CS based on the language.
-
Expected a "{0}" but found a "{1}". Block statements must be enclosed in "{{" and "}}". You cannot use single-statement control-flow statements in CSHTML pages. For example, the following is not allowed:
@@ -210,10 +206,6 @@ Instead, wrap the contents of the block in "{{}}":
Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines.
-
- "{1}" is not a valid value for the "{0}" option. The "Option {0}" statement must be followed by either "On" or "Off".
- {0} is either Strict or Explicit and represent VB's "Option Strict" and "Option Explicit" keywords
-
Unknown option: "{0}".
@@ -251,15 +243,9 @@ Instead, wrap the contents of the block in "{{}}":
space or line break
-
- "{0}" is not valid at the start of a code block. Only identifiers, keywords, comments, and "(" are valid.
-
End-of-file was found after the "@" character. "@" must be followed by a valid code block. If you want to output an "@", escape it using the sequence: "@@"
-
- A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, and "(" are valid at the start of a code block and they must occur immediately following "@" with no space in between.
-
The {0} property of the {1} structure cannot be null.
@@ -347,43 +333,6 @@ Instead, wrap the contents of the block in "{{}}":
line break
-
- @Section Header ... End Section
- In VBHTML, the @Section keyword is case-insensitive (as with all VB keywords), but the standard practice is to Title Case it
-
-
- <<character literal>>
-
-
- <<comment>>
-
-
- <<date literal>>
-
-
- <<floating point literal>>
-
-
- <<identifier>>
-
-
- <<integer literal>>
-
-
- <<keyword>>
-
-
- <<newline sequence>>
-
-
- <<razor comment>>
-
-
- <<string literal>>
-
-
- <<white space>>
-
<<newline sequence>>
diff --git a/src/Microsoft.AspNet.Razor/Text/SourceLocation.cs b/src/Microsoft.AspNet.Razor/Text/SourceLocation.cs
index ca8cd8194c..cdb213b201 100644
--- a/src/Microsoft.AspNet.Razor/Text/SourceLocation.cs
+++ b/src/Microsoft.AspNet.Razor/Text/SourceLocation.cs
@@ -5,7 +5,9 @@ using System.Globalization;
namespace Microsoft.AspNet.Razor.Text
{
+#if NET45
[Serializable]
+#endif
public struct SourceLocation : IEquatable, IComparable
{
public static readonly SourceLocation Undefined = CreateUndefined();
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/CSharpHelpers.cs b/src/Microsoft.AspNet.Razor/Tokenizer/CSharpHelpers.cs
index 3467cb752a..8c2c2e0971 100644
--- a/src/Microsoft.AspNet.Razor/Tokenizer/CSharpHelpers.cs
+++ b/src/Microsoft.AspNet.Razor/Tokenizer/CSharpHelpers.cs
@@ -11,8 +11,13 @@ namespace Microsoft.AspNet.Razor.Tokenizer
public static bool IsIdentifierStart(char character)
{
return Char.IsLetter(character) ||
- character == '_' ||
- Char.GetUnicodeCategory(character) == UnicodeCategory.LetterNumber; // Ln
+ character == '_'
+#if NET45
+ || Char.GetUnicodeCategory(character) == UnicodeCategory.LetterNumber
+#else
+ || Char.IsLetterOrDigit(character)
+#endif
+ ; // Ln
}
public static bool IsIdentifierPart(char character)
@@ -34,11 +39,16 @@ namespace Microsoft.AspNet.Razor.Tokenizer
private static bool IsIdentifierPartByUnicodeCategory(char character)
{
+#if NET45
UnicodeCategory category = Char.GetUnicodeCategory(character);
+
return category == UnicodeCategory.NonSpacingMark || // Mn
category == UnicodeCategory.SpacingCombiningMark || // Mc
category == UnicodeCategory.ConnectorPunctuation || // Pc
category == UnicodeCategory.Format; // Cf
+#else
+ return false; // TODO: Make the above work
+#endif
}
}
}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/HtmlTokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/HtmlTokenizer.cs
index b8742d54b9..25ea2b3bb8 100644
--- a/src/Microsoft.AspNet.Razor/Tokenizer/HtmlTokenizer.cs
+++ b/src/Microsoft.AspNet.Razor/Tokenizer/HtmlTokenizer.cs
@@ -127,33 +127,35 @@ namespace Microsoft.AspNet.Razor.Tokenizer
TakeCurrent();
switch (sym)
{
- case '<':
- return EndSymbol(HtmlSymbolType.OpenAngle);
- case '!':
- return EndSymbol(HtmlSymbolType.Bang);
- case '/':
- return EndSymbol(HtmlSymbolType.Solidus);
- 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.Solidus);
+ 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
Debug.Fail("Unexpected symbol!");
- return EndSymbol(HtmlSymbolType.Unknown);
+#endif
+ return EndSymbol(HtmlSymbolType.Unknown);
}
}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs
index d7a2aab2d4..4b1832f68d 100644
--- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs
+++ b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolTypeSuppressions.cs
@@ -1,8 +1,5 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-// Centralized all the supressions for the CSharpSymbolType and VBSymbolType enum members here for clarity. They are
-// not in the CodeAnalysisDictionary because they are special case exclusions
-
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Foreach", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Foreach", Justification = Justifications.SymbolTypeNames)]
@@ -14,11 +11,6 @@ using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Uint", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Uint", Justification = Justifications.SymbolTypeNames)]
[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ulong", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Ulong", Justification = Justifications.SymbolTypeNames)]
[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ushort", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.CSharpKeyword.#Ushort", Justification = Justifications.SymbolTypeNames)]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Val", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.VBKeyword.#ByVal", Justification = Justifications.SymbolTypeNames)]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sng", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.VBKeyword.#CSng", Justification = Justifications.SymbolTypeNames)]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ReDim", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.VBKeyword.#ReDim", Justification = Justifications.SymbolTypeNames)]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Re", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.VBKeyword.#ReDim", Justification = Justifications.SymbolTypeNames)]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Str", Scope = "member", Target = "Microsoft.AspNet.Razor.Tokenizer.Symbols.VBKeyword.#CStr", Justification = Justifications.SymbolTypeNames)]
internal static partial class Justifications
{
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBKeyword.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBKeyword.cs
deleted file mode 100644
index e4dd67f3f0..0000000000
--- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBKeyword.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System.Diagnostics.CodeAnalysis;
-
-namespace Microsoft.AspNet.Razor.Tokenizer.Symbols
-{
- public enum VBKeyword
- {
- AddHandler,
- AndAlso,
- Byte,
- Catch,
- CDate,
- CInt,
- Const,
- CSng,
-
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lng", Justification = "This is a VB Keyword. Note: Excluded here because it is a specific case")]
- CULng,
- Declare,
- DirectCast,
- Else,
- Enum,
- Exit,
- Friend,
- GetXmlNamespace,
- Handles,
- In,
- Is,
- Like,
- Mod,
- MyBase,
- New,
- AddressOf,
- As,
- ByVal,
- CBool,
-
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dbl", Justification = "This is a VB Keyword. Note: Excluded here because it is a specific case")]
- CDbl,
- Class,
- Continue,
- CStr,
- CUShort,
- Default,
- Do,
- ElseIf,
- Erase,
- False,
- Function,
- Global,
- If,
- Inherits,
- IsNot,
- Long,
- Module,
- MyClass,
- Next,
- Alias,
- Boolean,
- Call,
- CByte,
- CDec,
-
- [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lng", Justification = "This is a VB Keyword. Note: Excluded here because it is a specific case")]
- CLng,
- CSByte,
- CType,
- Date,
- Delegate,
- Double,
- End,
- Error,
- Finally,
- Get,
- GoSub,
- Implements,
- Integer,
- Let,
- Loop,
- MustInherit,
- Namespace,
- Not,
- And,
- ByRef,
- Case,
- CChar,
- Char,
- CObj,
- CShort,
- CUInt,
- Decimal,
- Dim,
- Each,
- EndIf,
- Event,
- For,
- GetType,
- GoTo,
- Imports,
- Interface,
- Lib,
- Me,
- MustOverride,
- Narrowing,
- Nothing,
- NotInheritable,
- On,
- Or,
- Overrides,
- Property,
- ReadOnly,
- Resume,
- Set,
- Single,
- String,
- Then,
- Try,
- ULong,
- Wend,
- With,
- NotOverridable,
- Operator,
- OrElse,
- ParamArray,
- Protected,
- ReDim,
- Return,
- Shadows,
- Static,
- Structure,
- Throw,
- TryCast,
- UShort,
- When,
- WithEvents,
- Object,
- Option,
- Overloads,
- Partial,
- Public,
- Rem,
- SByte,
- Shared,
- Step,
- Sub,
- To,
- TypeOf,
- Using,
- While,
- WriteOnly,
- Of,
- Optional,
- Overridable,
- Private,
- RaiseEvent,
- RemoveHandler,
- Select,
- Short,
- Stop,
- SyncLock,
- True,
- UInteger,
- Variant,
- Widening,
- Xor
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBSymbol.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBSymbol.cs
deleted file mode 100644
index 08ea8b70c4..0000000000
--- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBSymbol.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Resources;
-using Microsoft.AspNet.Razor.Text;
-
-namespace Microsoft.AspNet.Razor.Tokenizer.Symbols
-{
- public class VBSymbol : SymbolBase
- {
- // Helper constructor
- private static Dictionary _symbolSamples = new Dictionary()
- {
- { VBSymbolType.LineContinuation, "_" },
- { VBSymbolType.LeftParenthesis, "(" },
- { VBSymbolType.RightParenthesis, ")" },
- { VBSymbolType.LeftBracket, "[" },
- { VBSymbolType.RightBracket, "]" },
- { VBSymbolType.LeftBrace, "{" },
- { VBSymbolType.RightBrace, "}" },
- { VBSymbolType.Bang, "!" },
- { VBSymbolType.Hash, "#" },
- { VBSymbolType.Comma, "," },
- { VBSymbolType.Dot, "." },
- { VBSymbolType.Colon, ":" },
- { VBSymbolType.QuestionMark, "?" },
- { VBSymbolType.Concatenation, "&" },
- { VBSymbolType.Multiply, "*" },
- { VBSymbolType.Add, "+" },
- { VBSymbolType.Subtract, "-" },
- { VBSymbolType.Divide, "/" },
- { VBSymbolType.IntegerDivide, "\\" },
- { VBSymbolType.Exponentiation, "^" },
- { VBSymbolType.Equal, "=" },
- { VBSymbolType.LessThan, "<" },
- { VBSymbolType.GreaterThan, ">" },
- { VBSymbolType.Dollar, "$" },
- { VBSymbolType.Transition, "@" },
- { VBSymbolType.RazorCommentTransition, "@" },
- { VBSymbolType.RazorCommentStar, "*" }
- };
-
- public VBSymbol(int offset, int line, int column, string content, VBSymbolType type)
- : this(new SourceLocation(offset, line, column), content, type, Enumerable.Empty())
- {
- }
-
- public VBSymbol(SourceLocation start, string content, VBSymbolType type)
- : this(start, content, type, Enumerable.Empty())
- {
- }
-
- public VBSymbol(int offset, int line, int column, string content, VBSymbolType type, IEnumerable errors)
- : base(new SourceLocation(offset, line, column), content, type, errors)
- {
- }
-
- public VBSymbol(SourceLocation start, string content, VBSymbolType type, IEnumerable errors)
- : base(start, content, type, errors)
- {
- }
-
- public VBKeyword? Keyword { get; set; }
-
- public override bool Equals(object obj)
- {
- VBSymbol other = obj as VBSymbol;
- return base.Equals(obj) && other.Keyword == Keyword;
- }
-
- public override int GetHashCode()
- {
- return base.GetHashCode() ^ Keyword.GetHashCode();
- }
-
- public static string GetSample(VBSymbolType type)
- {
- string sample;
- if (!_symbolSamples.TryGetValue(type, out sample))
- {
- switch (type)
- {
- case VBSymbolType.WhiteSpace:
- return RazorResources.VBSymbol_WhiteSpace;
- case VBSymbolType.NewLine:
- return RazorResources.VBSymbol_NewLine;
- case VBSymbolType.Comment:
- return RazorResources.VBSymbol_Comment;
- case VBSymbolType.Identifier:
- return RazorResources.VBSymbol_Identifier;
- case VBSymbolType.Keyword:
- return RazorResources.VBSymbol_Keyword;
- case VBSymbolType.IntegerLiteral:
- return RazorResources.VBSymbol_IntegerLiteral;
- case VBSymbolType.FloatingPointLiteral:
- return RazorResources.VBSymbol_FloatingPointLiteral;
- case VBSymbolType.StringLiteral:
- return RazorResources.VBSymbol_StringLiteral;
- case VBSymbolType.CharacterLiteral:
- return RazorResources.VBSymbol_CharacterLiteral;
- case VBSymbolType.DateLiteral:
- return RazorResources.VBSymbol_DateLiteral;
- case VBSymbolType.RazorComment:
- return RazorResources.VBSymbol_RazorComment;
- default:
- return RazorResources.Symbol_Unknown;
- }
- }
- return sample;
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBSymbolType.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBSymbolType.cs
deleted file mode 100644
index 7cb608b41f..0000000000
--- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/VBSymbolType.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-namespace Microsoft.AspNet.Razor.Tokenizer.Symbols
-{
- public enum VBSymbolType
- {
- Unknown,
- WhiteSpace,
- NewLine,
- LineContinuation,
- Comment,
- Identifier,
- Keyword,
- IntegerLiteral,
- FloatingPointLiteral,
- StringLiteral,
- CharacterLiteral,
- DateLiteral,
- LeftParenthesis,
- RightBrace,
- LeftBrace,
- RightParenthesis,
- Hash,
- Bang,
- Comma,
- Dot,
- Colon,
- Concatenation,
- QuestionMark,
- Subtract,
- Multiply,
- Add,
- Divide,
- IntegerDivide,
- Exponentiation,
- LessThan,
- GreaterThan,
- Equal,
- RightBracket,
- LeftBracket,
- Dollar,
- Transition,
-
- RazorCommentTransition,
- RazorCommentStar,
- RazorComment
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs
index 909738c188..64c9d05964 100644
--- a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs
+++ b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs
@@ -321,7 +321,9 @@ namespace Microsoft.AspNet.Razor.Tokenizer
[Conditional("DEBUG")]
internal void AssertCurrent(char current)
{
+#if NET45
Debug.Assert(CurrentCharacter == current, "CurrentCharacter Assumption violated", "Assumed that the current character would be {0}, but it is actually {1}", current, CurrentCharacter);
+#endif
}
ISymbol ITokenizer.NextSymbol()
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/VBHelpers.cs b/src/Microsoft.AspNet.Razor/Tokenizer/VBHelpers.cs
deleted file mode 100644
index 27611b45c0..0000000000
--- a/src/Microsoft.AspNet.Razor/Tokenizer/VBHelpers.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-namespace Microsoft.AspNet.Razor.Tokenizer
-{
- public static class VBHelpers
- {
- public static bool IsSingleQuote(char character)
- {
- return character == '\'' || character == '‘' || character == '’';
- }
-
- public static bool IsDoubleQuote(char character)
- {
- return character == '"' || character == '“' || character == '”';
- }
-
- public static bool IsOctalDigit(char character)
- {
- return character >= '0' && character <= '7';
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/VBKeywordDetector.cs b/src/Microsoft.AspNet.Razor/Tokenizer/VBKeywordDetector.cs
deleted file mode 100644
index 8c2bc167e6..0000000000
--- a/src/Microsoft.AspNet.Razor/Tokenizer/VBKeywordDetector.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-
-namespace Microsoft.AspNet.Razor.Tokenizer
-{
- internal static class VBKeywordDetector
- {
- private static readonly Dictionary _keywords = new Dictionary(StringComparer.OrdinalIgnoreCase)
- {
- { "addhandler", VBKeyword.AddHandler },
- { "andalso", VBKeyword.AndAlso },
- { "byte", VBKeyword.Byte },
- { "catch", VBKeyword.Catch },
- { "cdate", VBKeyword.CDate },
- { "cint", VBKeyword.CInt },
- { "const", VBKeyword.Const },
- { "csng", VBKeyword.CSng },
- { "culng", VBKeyword.CULng },
- { "declare", VBKeyword.Declare },
- { "directcast", VBKeyword.DirectCast },
- { "else", VBKeyword.Else },
- { "enum", VBKeyword.Enum },
- { "exit", VBKeyword.Exit },
- { "friend", VBKeyword.Friend },
- { "getxmlnamespace", VBKeyword.GetXmlNamespace },
- { "handles", VBKeyword.Handles },
- { "in", VBKeyword.In },
- { "is", VBKeyword.Is },
- { "like", VBKeyword.Like },
- { "mod", VBKeyword.Mod },
- { "mybase", VBKeyword.MyBase },
- { "new", VBKeyword.New },
- { "addressof", VBKeyword.AddressOf },
- { "as", VBKeyword.As },
- { "byval", VBKeyword.ByVal },
- { "cbool", VBKeyword.CBool },
- { "cdbl", VBKeyword.CDbl },
- { "class", VBKeyword.Class },
- { "continue", VBKeyword.Continue },
- { "cstr", VBKeyword.CStr },
- { "cushort", VBKeyword.CUShort },
- { "default", VBKeyword.Default },
- { "do", VBKeyword.Do },
- { "elseif", VBKeyword.ElseIf },
- { "erase", VBKeyword.Erase },
- { "false", VBKeyword.False },
- { "function", VBKeyword.Function },
- { "global", VBKeyword.Global },
- { "if", VBKeyword.If },
- { "inherits", VBKeyword.Inherits },
- { "isnot", VBKeyword.IsNot },
- { "long", VBKeyword.Long },
- { "module", VBKeyword.Module },
- { "myclass", VBKeyword.MyClass },
- { "next", VBKeyword.Next },
- { "alias", VBKeyword.Alias },
- { "boolean", VBKeyword.Boolean },
- { "call", VBKeyword.Call },
- { "cbyte", VBKeyword.CByte },
- { "cdec", VBKeyword.CDec },
- { "clng", VBKeyword.CLng },
- { "csbyte", VBKeyword.CSByte },
- { "ctype", VBKeyword.CType },
- { "date", VBKeyword.Date },
- { "delegate", VBKeyword.Delegate },
- { "double", VBKeyword.Double },
- { "end", VBKeyword.End },
- { "error", VBKeyword.Error },
- { "finally", VBKeyword.Finally },
- { "get", VBKeyword.Get },
- { "gosub", VBKeyword.GoSub },
- { "implements", VBKeyword.Implements },
- { "integer", VBKeyword.Integer },
- { "let", VBKeyword.Let },
- { "loop", VBKeyword.Loop },
- { "mustinherit", VBKeyword.MustInherit },
- { "namespace", VBKeyword.Namespace },
- { "not", VBKeyword.Not },
- { "and", VBKeyword.And },
- { "byref", VBKeyword.ByRef },
- { "case", VBKeyword.Case },
- { "cchar", VBKeyword.CChar },
- { "char", VBKeyword.Char },
- { "cobj", VBKeyword.CObj },
- { "cshort", VBKeyword.CShort },
- { "cuint", VBKeyword.CUInt },
- { "decimal", VBKeyword.Decimal },
- { "dim", VBKeyword.Dim },
- { "each", VBKeyword.Each },
- { "endif", VBKeyword.EndIf },
- { "event", VBKeyword.Event },
- { "for", VBKeyword.For },
- { "gettype", VBKeyword.GetType },
- { "goto", VBKeyword.GoTo },
- { "imports", VBKeyword.Imports },
- { "interface", VBKeyword.Interface },
- { "lib", VBKeyword.Lib },
- { "me", VBKeyword.Me },
- { "mustoverride", VBKeyword.MustOverride },
- { "narrowing", VBKeyword.Narrowing },
- { "nothing", VBKeyword.Nothing },
- { "notinheritable", VBKeyword.NotInheritable },
- { "on", VBKeyword.On },
- { "or", VBKeyword.Or },
- { "overrides", VBKeyword.Overrides },
- { "property", VBKeyword.Property },
- { "rem", VBKeyword.Rem },
- { "readonly", VBKeyword.ReadOnly },
- { "resume", VBKeyword.Resume },
- { "set", VBKeyword.Set },
- { "single", VBKeyword.Single },
- { "string", VBKeyword.String },
- { "then", VBKeyword.Then },
- { "try", VBKeyword.Try },
- { "ulong", VBKeyword.ULong },
- { "wend", VBKeyword.Wend },
- { "with", VBKeyword.With },
- { "notoverridable", VBKeyword.NotOverridable },
- { "operator", VBKeyword.Operator },
- { "orelse", VBKeyword.OrElse },
- { "paramarray", VBKeyword.ParamArray },
- { "protected", VBKeyword.Protected },
- { "redim", VBKeyword.ReDim },
- { "return", VBKeyword.Return },
- { "shadows", VBKeyword.Shadows },
- { "static", VBKeyword.Static },
- { "structure", VBKeyword.Structure },
- { "throw", VBKeyword.Throw },
- { "trycast", VBKeyword.TryCast },
- { "ushort", VBKeyword.UShort },
- { "when", VBKeyword.When },
- { "withevents", VBKeyword.WithEvents },
- { "object", VBKeyword.Object },
- { "option", VBKeyword.Option },
- { "overloads", VBKeyword.Overloads },
- { "partial", VBKeyword.Partial },
- { "public", VBKeyword.Public },
- { "sbyte", VBKeyword.SByte },
- { "shared", VBKeyword.Shared },
- { "step", VBKeyword.Step },
- { "sub", VBKeyword.Sub },
- { "to", VBKeyword.To },
- { "typeof", VBKeyword.TypeOf },
- { "using", VBKeyword.Using },
- { "while", VBKeyword.While },
- { "writeonly", VBKeyword.WriteOnly },
- { "of", VBKeyword.Of },
- { "optional", VBKeyword.Optional },
- { "overridable", VBKeyword.Overridable },
- { "private", VBKeyword.Private },
- { "raiseevent", VBKeyword.RaiseEvent },
- { "removehandler", VBKeyword.RemoveHandler },
- { "select", VBKeyword.Select },
- { "short", VBKeyword.Short },
- { "stop", VBKeyword.Stop },
- { "synclock", VBKeyword.SyncLock },
- { "true", VBKeyword.True },
- { "uinteger", VBKeyword.UInteger },
- { "variant", VBKeyword.Variant },
- { "widening", VBKeyword.Widening },
- { "xor", VBKeyword.Xor }
- };
-
- public static VBKeyword? GetKeyword(string id)
- {
- VBKeyword type;
- if (!_keywords.TryGetValue(id, out type))
- {
- return null;
- }
- return type;
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/VBTokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/VBTokenizer.cs
deleted file mode 100644
index de313c0d53..0000000000
--- a/src/Microsoft.AspNet.Razor/Tokenizer/VBTokenizer.cs
+++ /dev/null
@@ -1,384 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using Microsoft.AspNet.Razor.Parser;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-
-namespace Microsoft.AspNet.Razor.Tokenizer
-{
- public class VBTokenizer : Tokenizer
- {
- private static Dictionary _operatorTable = new Dictionary()
- {
- { '_', VBSymbolType.LineContinuation },
- { '(', VBSymbolType.LeftParenthesis },
- { ')', VBSymbolType.RightParenthesis },
- { '[', VBSymbolType.LeftBracket },
- { ']', VBSymbolType.RightBracket },
- { '{', VBSymbolType.LeftBrace },
- { '}', VBSymbolType.RightBrace },
- { '!', VBSymbolType.Bang },
- { '#', VBSymbolType.Hash },
- { ',', VBSymbolType.Comma },
- { '.', VBSymbolType.Dot },
- { ':', VBSymbolType.Colon },
- { '?', VBSymbolType.QuestionMark },
- { '&', VBSymbolType.Concatenation },
- { '*', VBSymbolType.Multiply },
- { '+', VBSymbolType.Add },
- { '-', VBSymbolType.Subtract },
- { '/', VBSymbolType.Divide },
- { '\\', VBSymbolType.IntegerDivide },
- { '^', VBSymbolType.Exponentiation },
- { '=', VBSymbolType.Equal },
- { '<', VBSymbolType.LessThan },
- { '>', VBSymbolType.GreaterThan },
- { '$', VBSymbolType.Dollar },
- };
-
- public VBTokenizer(ITextDocument source)
- : base(source)
- {
- CurrentState = Data;
- }
-
- protected override State StartState
- {
- get { return Data; }
- }
-
- public override VBSymbolType RazorCommentType
- {
- get { return VBSymbolType.RazorComment; }
- }
-
- public override VBSymbolType RazorCommentTransitionType
- {
- get { return VBSymbolType.RazorCommentTransition; }
- }
-
- public override VBSymbolType RazorCommentStarType
- {
- get { return VBSymbolType.RazorCommentStar; }
- }
-
- internal static IEnumerable Tokenize(string content)
- {
- using (SeekableTextReader reader = new SeekableTextReader(content))
- {
- VBTokenizer tok = new VBTokenizer(reader);
- VBSymbol sym;
- while ((sym = tok.NextSymbol()) != null)
- {
- yield return sym;
- }
- }
- }
-
- protected override VBSymbol CreateSymbol(SourceLocation start, string content, VBSymbolType type, IEnumerable errors)
- {
- return new VBSymbol(start, content, type, errors);
- }
-
- private StateResult Data()
- {
- // We are accepting more characters and whitespace/newlines then the VB Spec defines, to simplify things
- // Since the code must still be compiled by a VB compiler, this will not cause adverse effects.
- if (ParserHelpers.IsNewLine(CurrentCharacter))
- {
- // VB Spec §2.1.1
- bool checkTwoCharNewline = CurrentCharacter == '\r';
- TakeCurrent();
- if (checkTwoCharNewline && CurrentCharacter == '\n')
- {
- TakeCurrent();
- }
- return Stay(EndSymbol(VBSymbolType.NewLine));
- }
- else if (ParserHelpers.IsWhitespace(CurrentCharacter))
- {
- // CSharp Spec §2.1.3
- TakeUntil(c => !ParserHelpers.IsWhitespace(c));
- return Stay(EndSymbol(VBSymbolType.WhiteSpace));
- }
- else if (VBHelpers.IsSingleQuote(CurrentCharacter))
- {
- TakeCurrent();
- return CommentBody();
- }
- else if (IsIdentifierStart())
- {
- return Identifier();
- }
- else if (Char.IsDigit(CurrentCharacter))
- {
- return DecimalLiteral();
- }
- else if (CurrentCharacter == '&')
- {
- char next = Char.ToLower(Peek(), CultureInfo.InvariantCulture);
- if (next == 'h')
- {
- return HexLiteral();
- }
- else if (next == 'o')
- {
- return OctLiteral();
- }
- }
- else if (CurrentCharacter == '.' && Char.IsDigit(Peek()))
- {
- return FloatingPointLiteralEnd();
- }
- else if (VBHelpers.IsDoubleQuote(CurrentCharacter))
- {
- TakeCurrent();
- return Transition(QuotedLiteral);
- }
- else if (AtDateLiteral())
- {
- return DateLiteral();
- }
- else if (CurrentCharacter == '@')
- {
- TakeCurrent();
- if (CurrentCharacter == '*')
- {
- return Transition(EndSymbol(VBSymbolType.RazorCommentTransition), AfterRazorCommentTransition);
- }
- else if (CurrentCharacter == '@')
- {
- // Could be escaped comment transition
- return Transition(EndSymbol(VBSymbolType.Transition), () =>
- {
- TakeCurrent();
- return Transition(EndSymbol(VBSymbolType.Transition), Data);
- });
- }
- else
- {
- return Stay(EndSymbol(VBSymbolType.Transition));
- }
- }
- return Stay(EndSymbol(Operator()));
- }
-
- private StateResult DateLiteral()
- {
- AssertCurrent('#');
- TakeCurrent();
- TakeUntil(c => c == '#' || ParserHelpers.IsNewLine(c));
- if (CurrentCharacter == '#')
- {
- TakeCurrent();
- }
- return Stay(EndSymbol(VBSymbolType.DateLiteral));
- }
-
- private bool AtDateLiteral()
- {
- if (CurrentCharacter != '#')
- {
- return false;
- }
- int start = Source.Position;
- try
- {
- MoveNext();
- while (ParserHelpers.IsWhitespace(CurrentCharacter))
- {
- MoveNext();
- }
- return Char.IsDigit(CurrentCharacter);
- }
- finally
- {
- Source.Position = start;
- }
- }
-
- private StateResult QuotedLiteral()
- {
- TakeUntil(c => VBHelpers.IsDoubleQuote(c) || ParserHelpers.IsNewLine(c));
- if (VBHelpers.IsDoubleQuote(CurrentCharacter))
- {
- TakeCurrent();
- if (VBHelpers.IsDoubleQuote(CurrentCharacter))
- {
- // Escape sequence, remain in the string
- TakeCurrent();
- return Stay();
- }
- }
-
- VBSymbolType type = VBSymbolType.StringLiteral;
- if (Char.ToLowerInvariant(CurrentCharacter) == 'c')
- {
- TakeCurrent();
- type = VBSymbolType.CharacterLiteral;
- }
- return Transition(EndSymbol(type), Data);
- }
-
- private StateResult DecimalLiteral()
- {
- TakeUntil(c => !Char.IsDigit(c));
- char lower = Char.ToLowerInvariant(CurrentCharacter);
- if (IsFloatTypeSuffix(lower) || lower == '.' || lower == 'e')
- {
- return FloatingPointLiteralEnd();
- }
- else
- {
- TakeIntTypeSuffix();
- return Stay(EndSymbol(VBSymbolType.IntegerLiteral));
- }
- }
-
- private static bool IsFloatTypeSuffix(char chr)
- {
- chr = Char.ToLowerInvariant(chr);
- return chr == 'f' || chr == 'r' || chr == 'd';
- }
-
- private StateResult FloatingPointLiteralEnd()
- {
- if (CurrentCharacter == '.')
- {
- TakeCurrent();
- TakeUntil(c => !Char.IsDigit(c));
- }
- if (Char.ToLowerInvariant(CurrentCharacter) == 'e')
- {
- TakeCurrent();
- if (CurrentCharacter == '+' || CurrentCharacter == '-')
- {
- TakeCurrent();
- }
- TakeUntil(c => !Char.IsDigit(c));
- }
- if (IsFloatTypeSuffix(CurrentCharacter))
- {
- TakeCurrent();
- }
- return Stay(EndSymbol(VBSymbolType.FloatingPointLiteral));
- }
-
- private StateResult HexLiteral()
- {
- AssertCurrent('&');
- TakeCurrent();
- Debug.Assert(Char.ToLowerInvariant(CurrentCharacter) == 'h');
- TakeCurrent();
- TakeUntil(c => !ParserHelpers.IsHexDigit(c));
- TakeIntTypeSuffix();
- return Stay(EndSymbol(VBSymbolType.IntegerLiteral));
- }
-
- private StateResult OctLiteral()
- {
- AssertCurrent('&');
- TakeCurrent();
- Debug.Assert(Char.ToLowerInvariant(CurrentCharacter) == 'o');
- TakeCurrent();
- TakeUntil(c => !VBHelpers.IsOctalDigit(c));
- TakeIntTypeSuffix();
- return Stay(EndSymbol(VBSymbolType.IntegerLiteral));
- }
-
- private VBSymbolType Operator()
- {
- char op = CurrentCharacter;
- TakeCurrent();
- VBSymbolType ret;
- if (_operatorTable.TryGetValue(op, out ret))
- {
- return ret;
- }
- return VBSymbolType.Unknown;
- }
-
- private void TakeIntTypeSuffix()
- {
- // Take the "U" in US, UI, UL
- if (Char.ToLowerInvariant(CurrentCharacter) == 'u')
- {
- TakeCurrent(); // Unsigned Prefix
- }
-
- // Take the S, I or L integer suffix
- if (IsIntegerSuffix(CurrentCharacter))
- {
- TakeCurrent();
- }
- }
-
- private static bool IsIntegerSuffix(char chr)
- {
- chr = Char.ToLowerInvariant(chr);
- return chr == 's' || chr == 'i' || chr == 'l';
- }
-
- private StateResult CommentBody()
- {
- TakeUntil(ParserHelpers.IsNewLine);
- return Stay(EndSymbol(VBSymbolType.Comment));
- }
-
- private StateResult Identifier()
- {
- bool isEscaped = false;
- if (CurrentCharacter == '[')
- {
- TakeCurrent();
- isEscaped = true;
- }
- TakeUntil(c => !ParserHelpers.IsIdentifierPart(c));
-
- // If we're escaped, take the ']'
- if (isEscaped)
- {
- if (CurrentCharacter == ']')
- {
- TakeCurrent();
- }
- }
-
- // Check for Keywords and build the symbol
- VBKeyword? keyword = VBKeywordDetector.GetKeyword(Buffer.ToString());
- if (keyword == VBKeyword.Rem)
- {
- return CommentBody();
- }
-
- VBSymbol sym = new VBSymbol(CurrentStart, Buffer.ToString(), keyword == null ? VBSymbolType.Identifier : VBSymbolType.Keyword)
- {
- Keyword = keyword
- };
-
- StartSymbol();
-
- return Stay(sym);
- }
-
- private bool IsIdentifierStart()
- {
- if (CurrentCharacter == '_')
- {
- // VB Spec §2.2:
- // If an identifier begins with an underscore, it must contain at least one other valid identifier character to disambiguate it from a line continuation.
- return ParserHelpers.IsIdentifierPart(Peek());
- }
- if (CurrentCharacter == '[')
- {
- return ParserHelpers.IsIdentifierPart(Peek());
- }
- return ParserHelpers.IsIdentifierStart(CurrentCharacter);
- }
- }
-}
diff --git a/src/Microsoft.AspNet.Razor/VBRazorCodeLanguage.cs b/src/Microsoft.AspNet.Razor/VBRazorCodeLanguage.cs
deleted file mode 100644
index 4b7a19bb08..0000000000
--- a/src/Microsoft.AspNet.Razor/VBRazorCodeLanguage.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using Microsoft.AspNet.Razor.Generator;
-using Microsoft.AspNet.Razor.Parser;
-using Microsoft.VisualBasic;
-using System;
-
-namespace Microsoft.AspNet.Razor
-{
- ///
- /// Defines the Visual Basic Code Language for Razor
- ///
- public class VBRazorCodeLanguage : RazorCodeLanguage
- {
- private const string VBLanguageName = "vb";
-
- ///
- /// Returns the name of the language: "vb"
- ///
- public override string LanguageName
- {
- get { return VBLanguageName; }
- }
-
- ///
- /// Returns the type of the CodeDOM provider for this language
- ///
- public override Type CodeDomProviderType
- {
- get { return typeof(VBCodeProvider); }
- }
-
- ///
- /// Constructs a new instance of the code parser for this language
- ///
- public override ParserBase CreateCodeParser()
- {
- return new VBCodeParser();
- }
-
- ///
- /// Constructs a new instance of the code generator for this language with the specified settings
- ///
- public override RazorCodeGenerator CreateCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host)
- {
- return new VBRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host);
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs b/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs
index 96dc9859e0..b7ca203a73 100644
--- a/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs
+++ b/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs
@@ -21,12 +21,6 @@ namespace Microsoft.AspNet.Razor.Test.Framework
self.Span(SpanKind.Code, new CSharpSymbol(self.LocationTracker.CurrentLocation, String.Empty, CSharpSymbolType.Unknown)));
}
- public static UnclassifiedCodeSpanConstructor EmptyVB(this SpanFactory self)
- {
- return new UnclassifiedCodeSpanConstructor(
- self.Span(SpanKind.Code, new VBSymbol(self.LocationTracker.CurrentLocation, String.Empty, VBSymbolType.Unknown)));
- }
-
public static SpanConstructor EmptyHtml(this SpanFactory self)
{
return self.Span(SpanKind.Markup, new HtmlSymbol(self.LocationTracker.CurrentLocation, String.Empty, HtmlSymbolType.Unknown))
@@ -59,16 +53,6 @@ namespace Microsoft.AspNet.Razor.Test.Framework
return self.Span(SpanKind.Transition, content, type).Accepts(AcceptedCharacters.None);
}
- public static SpanConstructor CodeTransition(this SpanFactory self, VBSymbolType type)
- {
- return self.Span(SpanKind.Transition, SyntaxConstants.TransitionString, type).Accepts(AcceptedCharacters.None);
- }
-
- public static SpanConstructor CodeTransition(this SpanFactory self, string content, VBSymbolType type)
- {
- return self.Span(SpanKind.Transition, content, type).Accepts(AcceptedCharacters.None);
- }
-
public static SpanConstructor MarkupTransition(this SpanFactory self)
{
return self.Span(SpanKind.Transition, SyntaxConstants.TransitionString, markup: true).Accepts(AcceptedCharacters.None);
@@ -99,11 +83,6 @@ namespace Microsoft.AspNet.Razor.Test.Framework
return self.Span(SpanKind.MetaCode, content, type);
}
- public static SpanConstructor MetaCode(this SpanFactory self, string content, VBSymbolType type)
- {
- return self.Span(SpanKind.MetaCode, content, type);
- }
-
public static SpanConstructor MetaMarkup(this SpanFactory self, string content)
{
return self.Span(SpanKind.MetaCode, content, markup: true);
@@ -119,11 +98,6 @@ namespace Microsoft.AspNet.Razor.Test.Framework
return self.Span(SpanKind.Comment, content, type);
}
- public static SpanConstructor Comment(this SpanFactory self, string content, VBSymbolType type)
- {
- return self.Span(SpanKind.Comment, content, type);
- }
-
public static SpanConstructor Comment(this SpanFactory self, string content, HtmlSymbolType type)
{
return self.Span(SpanKind.Comment, content, type);
@@ -162,15 +136,6 @@ namespace Microsoft.AspNet.Razor.Test.Framework
};
}
- public static SpanFactory CreateVbHtml()
- {
- return new SpanFactory()
- {
- MarkupTokenizerFactory = doc => new HtmlTokenizer(doc),
- CodeTokenizerFactory = doc => new VBTokenizer(doc)
- };
- }
-
public SpanFactory()
{
LocationTracker = new SourceLocationTracker();
@@ -181,11 +146,6 @@ namespace Microsoft.AspNet.Razor.Test.Framework
return CreateSymbolSpan(kind, content, st => new CSharpSymbol(st, content, type));
}
- public SpanConstructor Span(SpanKind kind, string content, VBSymbolType type)
- {
- return CreateSymbolSpan(kind, content, st => new VBSymbol(st, content, type));
- }
-
public SpanConstructor Span(SpanKind kind, string content, HtmlSymbolType type)
{
return CreateSymbolSpan(kind, content, st => new HtmlSymbol(st, content, type));
diff --git a/test/Microsoft.AspNet.Razor.Test/Framework/VBHtmlCodeParserTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Framework/VBHtmlCodeParserTestBase.cs
deleted file mode 100644
index 523f59e785..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/Framework/VBHtmlCodeParserTestBase.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using Microsoft.AspNet.Razor.Parser;
-
-namespace Microsoft.AspNet.Razor.Test.Framework
-{
- public abstract class VBHtmlCodeParserTestBase : CodeParserTestBase
- {
- protected override ISet KeywordSet
- {
- get { return VBCodeParser.DefaultKeywords; }
- }
-
- protected override SpanFactory CreateSpanFactory()
- {
- return SpanFactory.CreateVbHtml();
- }
-
- public override ParserBase CreateMarkupParser()
- {
- return new HtmlMarkupParser();
- }
-
- public override ParserBase CreateCodeParser()
- {
- return new VBCodeParser();
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Razor.Test/Framework/VBHtmlMarkupParserTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Framework/VBHtmlMarkupParserTestBase.cs
deleted file mode 100644
index 5f72448cbf..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/Framework/VBHtmlMarkupParserTestBase.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System.Collections.Generic;
-using Microsoft.AspNet.Razor.Parser;
-
-namespace Microsoft.AspNet.Razor.Test.Framework
-{
- public abstract class VBHtmlMarkupParserTestBase : MarkupParserTestBase
- {
- protected override ISet KeywordSet
- {
- get { return VBCodeParser.DefaultKeywords; }
- }
-
- protected override SpanFactory CreateSpanFactory()
- {
- return SpanFactory.CreateVbHtml();
- }
-
- public override ParserBase CreateMarkupParser()
- {
- return new HtmlMarkupParser();
- }
-
- public override ParserBase CreateCodeParser()
- {
- return new VBCodeParser();
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CodeTreeGenerationTest.cs b/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CodeTreeGenerationTest.cs
index 452d008df3..e8ae85fb65 100644
--- a/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CodeTreeGenerationTest.cs
+++ b/test/Microsoft.AspNet.Razor.Test/Generator/CodeTree/CodeTreeGenerationTest.cs
@@ -22,6 +22,6 @@ namespace Microsoft.AspNet.Razor.Test.Generator
File.WriteAllText("./testfile_ct.cs", results.GeneratedCode);
File.WriteAllText("./testfile_cd.cs", codDOMOutput);
}, designTimeMode: false);
- }
+ }
}
}
diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/VBRazorCodeGeneratorTest.cs b/test/Microsoft.AspNet.Razor.Test/Generator/VBRazorCodeGeneratorTest.cs
deleted file mode 100644
index 04ba001dce..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/Generator/VBRazorCodeGeneratorTest.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.AspNet.Razor.Generator;
-using Microsoft.TestCommon;
-
-namespace Microsoft.AspNet.Razor.Test.Generator
-{
- public class VBRazorCodeGeneratorTest : RazorCodeGeneratorTest
- {
- private const string TestPhysicalPath = @"C:\Bar.vbhtml";
- private const string TestVirtualPath = "~/Foo/Bar.vbhtml";
-
- protected override string FileExtension
- {
- get { return "vbhtml"; }
- }
-
- protected override string LanguageName
- {
- get { return "VB"; }
- }
-
- protected override string BaselineExtension
- {
- get { return "vb"; }
- }
-
- [Fact]
- public void ConstructorRequiresNonNullClassName()
- {
- Assert.ThrowsArgumentNullOrEmptyString(() => new VBRazorCodeGenerator(null, TestRootNamespaceName, TestPhysicalPath, CreateHost()), "className");
- }
-
- [Fact]
- public void ConstructorRequiresNonEmptyClassName()
- {
- Assert.ThrowsArgumentNullOrEmptyString(() => new VBRazorCodeGenerator(String.Empty, TestRootNamespaceName, TestPhysicalPath, CreateHost()), "className");
- }
-
- [Fact]
- public void ConstructorRequiresNonNullRootNamespaceName()
- {
- Assert.ThrowsArgumentNull(() => new VBRazorCodeGenerator("Foo", null, TestPhysicalPath, CreateHost()), "rootNamespaceName");
- }
-
- [Fact]
- public void ConstructorAllowsEmptyRootNamespaceName()
- {
- new VBRazorCodeGenerator("Foo", String.Empty, TestPhysicalPath, CreateHost());
- }
-
- [Fact]
- public void ConstructorRequiresNonNullHost()
- {
- Assert.ThrowsArgumentNull(() => new VBRazorCodeGenerator("Foo", TestRootNamespaceName, TestPhysicalPath, null), "host");
- }
-
- [Theory]
- [InlineData("NestedCodeBlocks")]
- [InlineData("NestedCodeBlocks")]
- [InlineData("CodeBlock")]
- [InlineData("ExplicitExpression")]
- [InlineData("MarkupInCodeBlock")]
- [InlineData("Blocks")]
- [InlineData("ImplicitExpression")]
- [InlineData("Imports")]
- [InlineData("ExpressionsInCode")]
- [InlineData("FunctionsBlock")]
- [InlineData("Options")]
- [InlineData("Templates")]
- [InlineData("RazorComments")]
- [InlineData("Sections")]
- [InlineData("EmptySection")] // this scenario causes a crash in Razor V2.0
- [InlineData("Helpers")]
- [InlineData("HelpersMissingCloseParen")]
- [InlineData("HelpersMissingOpenParen")]
- [InlineData("NestedHelpers")]
- [InlineData("LayoutDirective")]
- [InlineData("ConditionalAttributes")]
- [InlineData("ResolveUrl")]
- public void VBCodeGeneratorCorrectlyGeneratesRunTimeCode(string testName)
- {
- RunTest(testName);
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesMappingsForRazorCommentsAtDesignTime()
- {
- // (4, 6) -> (?, 6) [6]
- // ( 5, 40) -> (?, 39) [2]
- // ( 8, 6) -> (?, 6) [33]
- // ( 9, 46) -> (?, 46) [3]
- // ( 12, 3) -> (?, 7) [3]
- // ( 12, 8) -> (?, 8) [1]
- RunTest("RazorComments", "RazorComments.DesignTime", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(4, 6, 6, 6),
- /* 02 */ new GeneratedCodeMapping(5, 40, 39, 2),
- /* 03 */ new GeneratedCodeMapping(8, 6, 6, 33),
- /* 04 */ new GeneratedCodeMapping(9, 46, 46, 3),
- /* 05 */ new GeneratedCodeMapping(12, 3, 7, 1),
- /* 06 */ new GeneratedCodeMapping(12, 8, 8, 1)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesHelperMissingNameAtDesignTime()
- {
- RunTest("HelpersMissingName", designTimeMode: true);
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesImportStatementsAtDesignTimeButCannotWrapPragmasAroundImportStatement()
- {
- RunTest("Imports", "Imports.DesignTime", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 2, 1, 19),
- /* 02 */ new GeneratedCodeMapping(2, 2, 1, 36),
- /* 03 */ new GeneratedCodeMapping(3, 2, 1, 16),
- /* 04 */ new GeneratedCodeMapping(5, 30, 30, 22),
- /* 05 */ new GeneratedCodeMapping(6, 36, 36, 21),
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesFunctionsBlocksAtDesignTime()
- {
- RunTest("FunctionsBlock", "FunctionsBlock.DesignTime", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 11, 11, 4),
- /* 02 */ new GeneratedCodeMapping(5, 11, 11, 129),
- /* 03 */ new GeneratedCodeMapping(12, 26, 26, 11)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesFunctionsBlocksAtDesignTimeTabs()
- {
- RunTest("FunctionsBlock", "FunctionsBlock.DesignTime.Tabs", designTimeMode: true, tabTest: TabTest.Tabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 11, 5, 4),
- /* 02 */ new GeneratedCodeMapping(5, 11, 5, 129),
- /* 03 */ new GeneratedCodeMapping(12, 26, 14, 11)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorGeneratesCodeWithParserErrorsInDesignTimeMode()
- {
- RunTest("ParserError", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 6, 6, 16)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesInheritsAtRuntime()
- {
- RunTest("Inherits", baselineName: "Inherits.Runtime");
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesInheritsAtDesigntime()
- {
- RunTest("Inherits", baselineName: "Inherits.Designtime", designTimeMode: true, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 11, 25, 27)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForUnfinishedExpressionsInCode()
- {
- RunTest("UnfinishedExpressionInCode", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 6, 6, 2),
- /* 02 */ new GeneratedCodeMapping(2, 2, 7, 9),
- /* 03 */ new GeneratedCodeMapping(2, 11, 11, 2)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasMarkupAndExpressions()
- {
- RunTest("DesignTime", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(2, 14, 13, 17),
- /* 02 */ new GeneratedCodeMapping(3, 20, 20, 1),
- /* 03 */ new GeneratedCodeMapping(3, 25, 25, 20),
- /* 04 */ new GeneratedCodeMapping(8, 3, 7, 12),
- /* 05 */ new GeneratedCodeMapping(9, 2, 7, 4),
- /* 06 */ new GeneratedCodeMapping(9, 16, 16, 3),
- /* 07 */ new GeneratedCodeMapping(9, 27, 27, 1),
- /* 08 */ new GeneratedCodeMapping(14, 6, 7, 3),
- /* 09 */ new GeneratedCodeMapping(17, 9, 24, 5),
- /* 10 */ new GeneratedCodeMapping(17, 14, 14, 28),
- /* 11 */ new GeneratedCodeMapping(19, 20, 20, 14)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForImplicitExpressionStartedAtEOF()
- {
- RunTest("ImplicitExpressionAtEOF", designTimeMode: true, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(3, 2, 7, 0)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForExplicitExpressionStartedAtEOF()
- {
- RunTest("ExplicitExpressionAtEOF", designTimeMode: true, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(3, 3, 7, 0)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForCodeBlockStartedAtEOF()
- {
- RunTest("CodeBlockAtEOF", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(3, 6, 6, 0)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForEmptyImplicitExpression()
- {
- RunTest("EmptyImplicitExpression", designTimeMode: true, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(3, 2, 7, 0)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForEmptyImplicitExpressionInCode()
- {
- RunTest("EmptyImplicitExpressionInCode", designTimeMode: true, tabTest: TabTest.NoTabs, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(1, 6, 6, 6),
- /* 02 */ new GeneratedCodeMapping(2, 6, 7, 0),
- /* 03 */ new GeneratedCodeMapping(2, 6, 6, 2)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyGeneratesDesignTimePragmasForEmptyExplicitExpression()
- {
- RunTest("EmptyExplicitExpression", designTimeMode: true, expectedDesignTimePragmas: new List()
- {
- /* 01 */ new GeneratedCodeMapping(3, 3, 7, 0)
- });
- }
-
- [Fact]
- public void VBCodeGeneratorDoesNotRenderLinePragmasIfGenerateLinePragmasIsSetToFalse()
- {
- RunTest("NoLinePragmas", generatePragmas: false);
- }
-
- [Fact]
- public void VBCodeGeneratorRendersHelpersBlockCorrectlyWhenInstanceHelperRequested()
- {
- RunTest("Helpers", baselineName: "Helpers.Instance", hostConfig: h => h.StaticHelpers = false);
- }
-
- [Fact]
- public void VBCodeGeneratorCorrectlyInstrumentsRazorCodeWhenInstrumentationRequested()
- {
- RunTest("Instrumented", hostConfig: host =>
- {
- host.EnableInstrumentation = true;
- host.InstrumentedSourceFilePath = String.Format("~/{0}.vbhtml", host.DefaultClassName);
- });
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Razor.Test/Microsoft.AspNet.Razor.Test.csproj b/test/Microsoft.AspNet.Razor.Test/Microsoft.AspNet.Razor.Test.csproj
index 7b6511871d..1a403d35e4 100644
--- a/test/Microsoft.AspNet.Razor.Test/Microsoft.AspNet.Razor.Test.csproj
+++ b/test/Microsoft.AspNet.Razor.Test/Microsoft.AspNet.Razor.Test.csproj
@@ -49,8 +49,6 @@
-
-
@@ -76,35 +74,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -165,12 +142,6 @@
-
-
-
-
-
-
@@ -182,14 +153,12 @@
-
-
@@ -210,7 +179,6 @@
Code
-
@@ -233,45 +201,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -296,26 +225,17 @@
-
-
-
-
-
-
-
-
-
@@ -334,27 +254,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -370,45 +272,23 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -417,57 +297,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/VBPartialParsingTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/VBPartialParsingTest.cs
deleted file mode 100644
index 64e2552a74..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/VBPartialParsingTest.cs
+++ /dev/null
@@ -1,375 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using Microsoft.AspNet.Razor.Parser;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Test.Framework;
-using Microsoft.AspNet.Razor.Text;
-using System.Web.WebPages.TestUtils;
-using Microsoft.TestCommon;
-using System;
-
-namespace Microsoft.AspNet.Razor.Test.Parser.PartialParsing
-{
- public class VBPartialParsingTest : PartialParsingTestBase
- {
- [Fact]
- public void ImplicitExpressionProvisionallyAcceptsDeleteOfIdentifierPartsIfDotRemains()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("foo @User. baz");
- StringTextBuffer old = new StringTextBuffer("foo @User.Name baz");
- RunPartialParseTest(new TextChange(10, 4, old, 0, changed),
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("User.")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" baz")),
- additionalFlags: PartialParseResult.Provisional);
- }
-
- [Fact]
- public void ImplicitExpressionAcceptsDeleteOfIdentifierPartsIfSomeOfIdentifierRemains()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("foo @Us baz");
- StringTextBuffer old = new StringTextBuffer("foo @User baz");
- RunPartialParseTest(new TextChange(7, 2, old, 0, changed),
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("Us")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" baz")));
- }
-
- [Fact]
- public void ImplicitExpressionProvisionallyAcceptsMultipleInsertionIfItCausesIdentifierExpansionAndTrailingDot()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("foo @User. baz");
- StringTextBuffer old = new StringTextBuffer("foo @U baz");
- RunPartialParseTest(new TextChange(6, 0, old, 4, changed),
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("User.")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" baz")),
- additionalFlags: PartialParseResult.Provisional);
- }
-
- [Fact]
- public void ImplicitExpressionAcceptsMultipleInsertionIfItOnlyCausesIdentifierExpansion()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("foo @barbiz baz");
- StringTextBuffer old = new StringTextBuffer("foo @bar baz");
- RunPartialParseTest(new TextChange(8, 0, old, 3, changed),
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("barbiz")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" baz")));
- }
-
- [Fact]
- public void ImplicitExpressionRejectsChangeWhichWouldHaveBeenAcceptedIfLastChangeWasProvisionallyAcceptedOnDifferentSpan()
- {
- var factory = SpanFactory.CreateVbHtml();
-
- // Arrange
- TextChange dotTyped = new TextChange(8, 0, new StringTextBuffer("foo @foo @bar"), 1, new StringTextBuffer("foo @foo. @bar"));
- TextChange charTyped = new TextChange(14, 0, new StringTextBuffer("foo @foo. @barb"), 1, new StringTextBuffer("foo @foo. @barb"));
- TestParserManager manager = CreateParserManager();
- manager.InitializeWithDocument(dotTyped.OldBuffer);
-
- // Apply the dot change
- Assert.Equal(PartialParseResult.Provisional | PartialParseResult.Accepted, manager.CheckForStructureChangesAndWait(dotTyped));
-
- // Act (apply the identifier start char change)
- PartialParseResult result = manager.CheckForStructureChangesAndWait(charTyped);
-
- // Assert
- Assert.Equal(PartialParseResult.Rejected, result);
- Assert.False(manager.Parser.LastResultProvisional, "LastResultProvisional flag should have been cleared but it was not");
- ParserTestBase.EvaluateParseTree(manager.Parser.CurrentParseTree,
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foo")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(". "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("barb")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.EmptyHtml()));
- }
-
- [Fact]
- public void ImplicitExpressionAcceptsIdentifierTypedAfterDotIfLastChangeWasProvisionalAcceptanceOfDot()
- {
- var factory = SpanFactory.CreateVbHtml();
-
- // Arrange
- TextChange dotTyped = new TextChange(8, 0, new StringTextBuffer("foo @foo bar"), 1, new StringTextBuffer("foo @foo. bar"));
- TextChange charTyped = new TextChange(9, 0, new StringTextBuffer("foo @foo. bar"), 1, new StringTextBuffer("foo @foo.b bar"));
- TestParserManager manager = CreateParserManager();
- manager.InitializeWithDocument(dotTyped.OldBuffer);
-
- // Apply the dot change
- Assert.Equal(PartialParseResult.Provisional | PartialParseResult.Accepted, manager.CheckForStructureChangesAndWait(dotTyped));
-
- // Act (apply the identifier start char change)
- PartialParseResult result = manager.CheckForStructureChangesAndWait(charTyped);
-
- // Assert
- Assert.Equal(PartialParseResult.Accepted, result);
- Assert.False(manager.Parser.LastResultProvisional, "LastResultProvisional flag should have been cleared but it was not");
- ParserTestBase.EvaluateParseTree(manager.Parser.CurrentParseTree,
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foo.b")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" bar")));
- }
- [Fact]
- public void ImplicitExpressionAcceptsIdentifierExpansionAtEndOfNonWhitespaceCharacters()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("@Code" + Environment.NewLine
- + " @food" + Environment.NewLine
- + "End Code");
- StringTextBuffer old = new StringTextBuffer("@Code" + Environment.NewLine
- + " @foo" + Environment.NewLine
- + "End Code");
- RunPartialParseTest(new TextChange(15, 0, old, 1, changed),
- new MarkupBlock(
- factory.EmptyHtml(),
- new StatementBlock(
- factory.CodeTransition(),
- factory.MetaCode("Code")
- .Accepts(AcceptedCharacters.None),
- factory.Code("\r\n ").AsStatement(),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("food")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords, acceptTrailingDot: true)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Code("\r\n").AsStatement(),
- factory.MetaCode("End Code").Accepts(AcceptedCharacters.None)),
- factory.EmptyHtml()));
- }
-
- [Fact]
- public void ImplicitExpressionProvisionallyAcceptsDotAfterIdentifierInMarkup()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("foo @foo. bar");
- StringTextBuffer old = new StringTextBuffer("foo @foo bar");
- RunPartialParseTest(new TextChange(8, 0, old, 1, changed),
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foo.")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" bar")),
- additionalFlags: PartialParseResult.Provisional);
- }
-
- [Fact]
- public void ImplicitExpressionAcceptsAdditionalIdentifierCharactersIfEndOfSpanIsIdentifier()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("foo @foob baz");
- StringTextBuffer old = new StringTextBuffer("foo @foo bar");
- RunPartialParseTest(new TextChange(8, 0, old, 1, changed),
- new MarkupBlock(
- factory.Markup("foo "),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foob")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Markup(" bar")));
- }
-
- [Fact]
- public void ImplicitExpressionAcceptsAdditionalIdentifierStartCharactersIfEndOfSpanIsDot()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("@Code @foo.b End Code");
- StringTextBuffer old = new StringTextBuffer("@Code @foo. End Code");
- RunPartialParseTest(new TextChange(11, 0, old, 1, changed),
- new MarkupBlock(
- factory.EmptyHtml(),
- new StatementBlock(
- factory.CodeTransition(),
- factory.MetaCode("Code").Accepts(AcceptedCharacters.None),
- factory.Code(" ").AsStatement(),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foo.b")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords, acceptTrailingDot: true)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Code(" ").AsStatement(),
- factory.MetaCode("End Code").Accepts(AcceptedCharacters.None)),
- factory.EmptyHtml()));
- }
-
- [Fact]
- public void ImplicitExpressionAcceptsDotIfTrailingDotsAreAllowed()
- {
- var factory = SpanFactory.CreateVbHtml();
- StringTextBuffer changed = new StringTextBuffer("@Code @foo. End Code");
- StringTextBuffer old = new StringTextBuffer("@Code @foo End Code");
- RunPartialParseTest(new TextChange(10, 0, old, 1, changed),
- new MarkupBlock(
- factory.EmptyHtml(),
- new StatementBlock(
- factory.CodeTransition(),
- factory.MetaCode("Code").Accepts(AcceptedCharacters.None),
- factory.Code(" ").AsStatement(),
- new ExpressionBlock(
- factory.CodeTransition(),
- factory.Code("foo.")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords, acceptTrailingDot: true)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- factory.Code(" ").AsStatement(),
- factory.MetaCode("End Code").Accepts(AcceptedCharacters.None)),
- factory.EmptyHtml()));
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfFunctionsKeywordTyped()
- {
- RunTypeKeywordTest("functions");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfCodeKeywordTyped()
- {
- RunTypeKeywordTest("code");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfSectionKeywordTyped()
- {
- RunTypeKeywordTest("section");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfDoKeywordTyped()
- {
- RunTypeKeywordTest("do");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfWhileKeywordTyped()
- {
- RunTypeKeywordTest("while");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfIfKeywordTyped()
- {
- RunTypeKeywordTest("if");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfSelectKeywordTyped()
- {
- RunTypeKeywordTest("select");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfForKeywordTyped()
- {
- RunTypeKeywordTest("for");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfTryKeywordTyped()
- {
- RunTypeKeywordTest("try");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfWithKeywordTyped()
- {
- RunTypeKeywordTest("with");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfSyncLockKeywordTyped()
- {
- RunTypeKeywordTest("synclock");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfUsingKeywordTyped()
- {
- RunTypeKeywordTest("using");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfImportsKeywordTyped()
- {
- RunTypeKeywordTest("imports");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfInheritsKeywordTyped()
- {
- RunTypeKeywordTest("inherits");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfOptionKeywordTyped()
- {
- RunTypeKeywordTest("option");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfHelperKeywordTyped()
- {
- RunTypeKeywordTest("helper");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfNamespaceKeywordTyped()
- {
- RunTypeKeywordTest("namespace");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfClassKeywordTyped()
- {
- RunTypeKeywordTest("class");
- }
-
- [Fact]
- public void ImplicitExpressionCorrectlyTriggersReparseIfLayoutKeywordTyped()
- {
- RunTypeKeywordTest("layout");
- }
- }
-}
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/VB/VBAutoCompleteTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/VB/VBAutoCompleteTest.cs
deleted file mode 100644
index d27b6b2255..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/Parser/VB/VBAutoCompleteTest.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using Microsoft.AspNet.Razor.Generator;
-using Microsoft.AspNet.Razor.Parser;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Resources;
-using Microsoft.AspNet.Razor.Test.Framework;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.AspNet.Razor.Tokenizer.Symbols;
-using Microsoft.TestCommon;
-
-namespace Microsoft.AspNet.Razor.Test.Parser.VB
-{
- public class VBAutoCompleteTest : VBHtmlCodeParserTestBase
- {
- [Fact]
- public void FunctionsDirective_AutoComplete_At_EOF()
- {
- ParseBlockTest("@Functions",
- new FunctionsBlock(
- Factory.CodeTransition("@")
- .Accepts(AcceptedCharacters.None),
- Factory.MetaCode("Functions")
- .Accepts(AcceptedCharacters.None),
- Factory.EmptyVB()
- .AsFunctionsBody()
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString)
- {
- AutoCompleteString = SyntaxConstants.VB.EndFunctionsKeyword
- })),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Functions", "End Functions"),
- 1, 0, 1));
- }
-
- [Fact]
- public void HelperDirective_AutoComplete_At_EOF()
- {
- ParseBlockTest("@Helper Strong(value As String)",
- new HelperBlock(new HelperCodeGenerator(new LocationTagged("Strong(value As String)", 8, 0, 8), headerComplete: true),
- Factory.CodeTransition(),
- Factory.MetaCode("Helper ")
- .Accepts(AcceptedCharacters.None),
- Factory.Code("Strong(value As String)")
- .Hidden()
- .Accepts(AcceptedCharacters.None)
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = SyntaxConstants.VB.EndHelperKeyword }),
- new StatementBlock()),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Helper", "End Helper"),
- 1, 0, 1));
- }
-
- [Fact]
- public void SectionDirective_AutoComplete_At_EOF()
- {
- ParseBlockTest("@Section Header",
- new SectionBlock(new SectionCodeGenerator("Header"),
- Factory.CodeTransition(),
- Factory.MetaCode("Section Header")
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = SyntaxConstants.VB.EndSectionKeyword }),
- new MarkupBlock()),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Section", "End Section"),
- 1, 0, 1));
- }
-
- [Fact]
- public void VerbatimBlock_AutoComplete_At_EOF()
- {
- ParseBlockTest("@Code",
- new StatementBlock(
- Factory.CodeTransition(),
- Factory.MetaCode("Code").Accepts(AcceptedCharacters.None),
- Factory.Span(SpanKind.Code, new VBSymbol(5, 0, 5, String.Empty, VBSymbolType.Unknown))
- .With(new StatementCodeGenerator())
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = SyntaxConstants.VB.EndCodeKeyword })),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Code", "End Code"),
- 1, 0, 1));
- }
-
- [Fact]
- public void FunctionsDirective_AutoComplete_At_StartOfFile()
- {
- ParseBlockTest("@Functions" + Environment.NewLine
- + "foo",
- new FunctionsBlock(
- Factory.CodeTransition("@").Accepts(AcceptedCharacters.None),
- Factory.MetaCode("Functions").Accepts(AcceptedCharacters.None),
- Factory.Code("\r\nfoo")
- .AsFunctionsBody()
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString)
- {
- AutoCompleteString = SyntaxConstants.VB.EndFunctionsKeyword
- })),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Functions", "End Functions"),
- 1, 0, 1));
- }
-
- [Fact]
- public void HelperDirective_AutoComplete_At_StartOfFile()
- {
- ParseBlockTest("@Helper Strong(value As String)" + Environment.NewLine
- + "Foo",
- new HelperBlock(new HelperCodeGenerator(new LocationTagged("Strong(value As String)", 8, 0, 8), headerComplete: true),
- Factory.CodeTransition(),
- Factory.MetaCode("Helper ")
- .Accepts(AcceptedCharacters.None),
- Factory.Code("Strong(value As String)")
- .Hidden()
- .Accepts(AcceptedCharacters.None)
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = SyntaxConstants.VB.EndHelperKeyword }),
- new StatementBlock(
- Factory.Code("\r\nFoo").AsStatement())),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Helper", "End Helper"),
- 1, 0, 1));
- }
-
- [Fact]
- public void SectionDirective_AutoComplete_At_StartOfFile()
- {
- ParseBlockTest("@Section Header" + Environment.NewLine
- + "Foo",
- new SectionBlock(new SectionCodeGenerator("Header"),
- Factory.CodeTransition(),
- Factory.MetaCode("Section Header")
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = SyntaxConstants.VB.EndSectionKeyword }),
- new MarkupBlock(
- Factory.Markup("\r\nFoo")
- .With(new MarkupCodeGenerator()))),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Section", "End Section"),
- 1, 0, 1));
- }
-
- [Fact]
- public void VerbatimBlock_AutoComplete_At_StartOfFile()
- {
- ParseBlockTest("@Code" + Environment.NewLine
- + "Foo",
- new StatementBlock(
- Factory.CodeTransition(),
- Factory.MetaCode("Code").Accepts(AcceptedCharacters.None),
- Factory.Code("\r\nFoo")
- .AsStatement()
- .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = SyntaxConstants.VB.EndCodeKeyword })),
- new RazorError(
- String.Format(RazorResources.ParseError_BlockNotTerminated, "Code", "End Code"),
- 1, 0, 1));
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/VB/VBBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/VB/VBBlockTest.cs
deleted file mode 100644
index c7b4601f41..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/Parser/VB/VBBlockTest.cs
+++ /dev/null
@@ -1,367 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-using System;
-using Microsoft.AspNet.Razor.Parser;
-using Microsoft.AspNet.Razor.Parser.SyntaxTree;
-using Microsoft.AspNet.Razor.Resources;
-using Microsoft.AspNet.Razor.Test.Framework;
-using Microsoft.AspNet.Razor.Text;
-using Microsoft.TestCommon;
-
-namespace Microsoft.AspNet.Razor.Test.Parser.VB
-{
- public class VBBlockTest : VBHtmlCodeParserTestBase
- {
- [Fact]
- public void ParseBlockMethodThrowsArgNullExceptionOnNullContext()
- {
- // Arrange
- VBCodeParser parser = new VBCodeParser();
-
- // Act and Assert
- Assert.Throws(() => parser.ParseBlock(), RazorResources.Parser_Context_Not_Set);
- }
-
- [Fact]
- public void ParseBlockAcceptsImplicitExpression()
- {
- ParseBlockTest("If True Then" + Environment.NewLine
- + " @foo" + Environment.NewLine
- + "End If",
- new StatementBlock(
- Factory.Code("If True Then\r\n ").AsStatement(),
- new ExpressionBlock(
- Factory.CodeTransition(),
- Factory.Code("foo")
- .AsImplicitExpression(VBCodeParser.DefaultKeywords, acceptTrailingDot: true)
- .Accepts(AcceptedCharacters.NonWhiteSpace)),
- Factory.Code("\r\nEnd If")
- .AsStatement()
- .Accepts(AcceptedCharacters.None)));
- }
-
- [Fact]
- public void ParseBlockAcceptsIfStatementWithinCodeBlockIfInDesignTimeMode()
- {
- ParseBlockTest("If True Then" + Environment.NewLine
- + " @If True Then" + Environment.NewLine
- + " End If" + Environment.NewLine
- + "End If",
- new StatementBlock(
- Factory.Code("If True Then\r\n ").AsStatement(),
- new StatementBlock(
- Factory.CodeTransition(),
- Factory.Code("If True Then\r\n End If\r\n")
- .AsStatement()
- .Accepts(AcceptedCharacters.None)),
- Factory.Code(@"End If")
- .AsStatement()
- .Accepts(AcceptedCharacters.None)));
- }
-
- [Fact]
- public void ParseBlockSupportsSpacesInStrings()
- {
- ParseBlockTest("for each p in db.Query(\"SELECT * FROM PRODUCTS\")" + Environment.NewLine
- + " @
@p.Name
" + Environment.NewLine
- + "next",
- new StatementBlock(
- Factory.Code("for each p in db.Query(\"SELECT * FROM PRODUCTS\")\r\n")
- .AsStatement(),
- new MarkupBlock(
- Factory.Markup(" "),
- Factory.MarkupTransition(),
- Factory.Markup("
" + Environment.NewLine
- + " This is code!" + Environment.NewLine
- + " End If" + Environment.NewLine
- + endSequence,
- new StatementBlock(
- Factory.Code(keyword + "\r\n If True Then\r\n").AsStatement(),
- new MarkupBlock(
- Factory.Markup(" "),
- Factory.MarkupTransition(),
- Factory.MetaMarkup(":", HtmlSymbolType.Colon),
- Factory.Markup("
It's True!
\r\n")
- .With(new SingleLineMarkupEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString))
- .Accepts(AcceptedCharacters.None)),
- Factory.Code(" This is code!\r\n End If\r\n" + endSequence)
- .AsStatement()
- .Accepts(acceptedCharacters)));
- }
- }
-}
diff --git a/test/Microsoft.AspNet.Razor.Test/RazorCodeLanguageTest.cs b/test/Microsoft.AspNet.Razor.Test/RazorCodeLanguageTest.cs
index c2663d8a17..48973e428f 100644
--- a/test/Microsoft.AspNet.Razor.Test/RazorCodeLanguageTest.cs
+++ b/test/Microsoft.AspNet.Razor.Test/RazorCodeLanguageTest.cs
@@ -12,7 +12,6 @@ namespace Microsoft.AspNet.Razor.Test
// Assert
Assert.Equal(2, RazorCodeLanguage.Languages.Count);
Assert.IsType(RazorCodeLanguage.Languages["cshtml"]);
- Assert.IsType(RazorCodeLanguage.Languages["vbhtml"]);
}
[Fact]
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Blocks.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Blocks.vb
deleted file mode 100644
index d0dc84d572..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Blocks.vb
+++ /dev/null
@@ -1,255 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class Blocks
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("Blocks.vbhtml",1)
-
- Dim i as Integer = 1
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Blocks.vbhtml",5)
- While i <= 10
-
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral("
Some random memory stream will be disposed after rendering this block
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Blocks.vbhtml",46)
-End Using
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/CodeBlock.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/CodeBlock.vb
deleted file mode 100644
index b77904b3c6..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/CodeBlock.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class CodeBlock
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("CodeBlock.vbhtml",1)
-
- Test()
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/CodeBlockAtEOF.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/CodeBlockAtEOF.vb
deleted file mode 100644
index 4550554d69..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/CodeBlockAtEOF.vb
+++ /dev/null
@@ -1,29 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class CodeBlockAtEOF
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("CodeBlockAtEOF.vbhtml",1)
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Comments.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Comments.vb
deleted file mode 100644
index b6cabd32d3..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Comments.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class Comments
-Public Overrides Sub Execute()
-
-
-#ExternalSource("Comments.vbhtml",1)
- 'This is not going to be rendered
-
-
-#End ExternalSource
-WriteLiteral("
This is going to be rendered
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-
-#ExternalSource("Comments.vbhtml",3)
- REM Neither is this
-
-
-#End ExternalSource
-
-
-#ExternalSource("Comments.vbhtml",4)
- rem nor this
-
-
-#End ExternalSource
-
-
-#ExternalSource("Comments.vbhtml",5)
- rEm nor this
-
-#End ExternalSource
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ConditionalAttributes.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ConditionalAttributes.vb
deleted file mode 100644
index 157413314c..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ConditionalAttributes.vb
+++ /dev/null
@@ -1,187 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ConditionalAttributes
-
-#ExternalSource("ConditionalAttributes.vbhtml", 1)
-Public Shared Function Link(ByVal url As String, text As String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("ConditionalAttributes.vbhtml", 1)
-
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("ConditionalAttributes.vbhtml", 2)
-WriteTo(__razor_helper_writer, text)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ConditionalAttributes.vbhtml", 3)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ConditionalAttributes.vbhtml",5)
-
- Dim ch = True
- Dim cls = "bar"
-
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ConditionalAttributes.vbhtml",16)
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/DesignTime.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/DesignTime.vb
deleted file mode 100644
index 59041bd7c4..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/DesignTime.vb
+++ /dev/null
@@ -1,101 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class DesignTime
-Private Shared __o As Object
-
-#ExternalSource("DesignTime.vbhtml", 9)
-Public Shared Function Foo() As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("DesignTime.vbhtml", 10)
-
- If True Then
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml", 11)
-
- End If
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("DesignTime.vbhtml",1)
- For i = 1 to 10
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml",2)
- __o = i
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml",3)
-
- Next
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml",4)
-__o = Foo(Bar.Baz)
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml",5)
-__o = Foo(Function (item) New Template(Sub (__razor_template_writer)
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml",6)
- __o = baz
-
-
-#End ExternalSource
-
-#ExternalSource("DesignTime.vbhtml",7)
- End Sub))
-
-
-#End ExternalSource
-DefineSection("Footer", Sub ()
-
-
-#ExternalSource("DesignTime.vbhtml",8)
-__o = bar
-
-
-#End ExternalSource
-End Sub)
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyExplicitExpression.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyExplicitExpression.vb
deleted file mode 100644
index ce8fc4c1a3..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyExplicitExpression.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class EmptyExplicitExpression
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("EmptyExplicitExpression.vbhtml",1)
-__o =
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyImplicitExpression.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyImplicitExpression.vb
deleted file mode 100644
index 786c049dac..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyImplicitExpression.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class EmptyImplicitExpression
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("EmptyImplicitExpression.vbhtml",1)
-__o =
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyImplicitExpressionInCode.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyImplicitExpressionInCode.vb
deleted file mode 100644
index 9e4b2b1cf7..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptyImplicitExpressionInCode.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class EmptyImplicitExpressionInCode
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("EmptyImplicitExpressionInCode.vbhtml",1)
-
-
-
-#End ExternalSource
-
-#ExternalSource("EmptyImplicitExpressionInCode.vbhtml",2)
-__o =
-
-
-#End ExternalSource
-
-#ExternalSource("EmptyImplicitExpressionInCode.vbhtml",3)
-
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptySection.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptySection.vb
deleted file mode 100644
index be6bb88f4d..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/EmptySection.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class EmptySection
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-DefineSection("anything", Sub ()
-
-WriteLiteral(" ")
-
-End Sub)
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExplicitExpression.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExplicitExpression.vb
deleted file mode 100644
index d2e7a9fdc8..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExplicitExpression.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ExplicitExpression
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("ExplicitExpression.vbhtml",1)
-Write(Foo(Bar.Baz))
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExplicitExpressionAtEOF.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExplicitExpressionAtEOF.vb
deleted file mode 100644
index 7fb5bd7777..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExplicitExpressionAtEOF.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ExplicitExpressionAtEOF
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("ExplicitExpressionAtEOF.vbhtml",1)
-__o =
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExpressionsInCode.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExpressionsInCode.vb
deleted file mode 100644
index bbbd62b2a4..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ExpressionsInCode.vb
+++ /dev/null
@@ -1,86 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ExpressionsInCode
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("ExpressionsInCode.vbhtml",1)
-
- Dim foo As Object = Nothing
- Dim bar as String = "Foo"
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ExpressionsInCode.vbhtml",6)
- If foo IsNot Nothing Then
-
-
-#End ExternalSource
-
-#ExternalSource("ExpressionsInCode.vbhtml",7)
-Write(foo)
-
-
-#End ExternalSource
-
-#ExternalSource("ExpressionsInCode.vbhtml",7)
-
-Else
-
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral("
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ExpressionsInCode.vbhtml",13)
- If Not String.IsNullOrEmpty(bar) Then
-
-
-#End ExternalSource
-
-#ExternalSource("ExpressionsInCode.vbhtml",14)
-Write(bar.Replace("F", "B"))
-
-
-#End ExternalSource
-
-#ExternalSource("ExpressionsInCode.vbhtml",14)
-
-End If
-
-
-#End ExternalSource
-WriteLiteral("
")
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.DesignTime.Tabs.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.DesignTime.Tabs.vb
deleted file mode 100644
index cd737ed9f6..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.DesignTime.Tabs.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class FunctionsBlock
-Private Shared __o As Object
-
-#ExternalSource("FunctionsBlock.vbhtml",1)
-
-
-
-#End ExternalSource
-
-#ExternalSource("FunctionsBlock.vbhtml",2)
-
- Private _rand as New Random()
- Private Function RandomInt() as Integer
- Return _rand.Next()
- End Function
-
-#End ExternalSource
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("FunctionsBlock.vbhtml",3)
- __o = RandomInt()
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.DesignTime.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.DesignTime.vb
deleted file mode 100644
index 3ade673952..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.DesignTime.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class FunctionsBlock
-Private Shared __o As Object
-
-#ExternalSource("FunctionsBlock.vbhtml",1)
-
-
-
-#End ExternalSource
-
-#ExternalSource("FunctionsBlock.vbhtml",2)
-
- Private _rand as New Random()
- Private Function RandomInt() as Integer
- Return _rand.Next()
- End Function
-
-#End ExternalSource
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("FunctionsBlock.vbhtml",3)
- __o = RandomInt()
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.vb
deleted file mode 100644
index b14fedc3c1..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/FunctionsBlock.vb
+++ /dev/null
@@ -1,50 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class FunctionsBlock
-
-#ExternalSource("FunctionsBlock.vbhtml",1)
-
-
-
-#End ExternalSource
-
-#ExternalSource("FunctionsBlock.vbhtml",5)
-
- Private _rand as New Random()
- Private Function RandomInt() as Integer
- Return _rand.Next()
- End Function
-
-#End ExternalSource
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"Here's a random number: ")
-
-
-#ExternalSource("FunctionsBlock.vbhtml",12)
- Write(RandomInt())
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Helpers.Instance.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Helpers.Instance.vb
deleted file mode 100644
index 8442d9432d..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Helpers.Instance.vb
+++ /dev/null
@@ -1,99 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class Helpers
-
-#ExternalSource("Helpers.vbhtml", 1)
-Public Function Bold(s as String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("Helpers.vbhtml", 1)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("Helpers.vbhtml", 3)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Helpers.vbhtml", 4)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-#ExternalSource("Helpers.vbhtml", 6)
-Public Function Italic(s as String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("Helpers.vbhtml", 6)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("Helpers.vbhtml", 8)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Helpers.vbhtml", 9)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Helpers.vbhtml",11)
-Write(Bold("Hello"))
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Helpers.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Helpers.vb
deleted file mode 100644
index 4a129fe467..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Helpers.vb
+++ /dev/null
@@ -1,99 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class Helpers
-
-#ExternalSource("Helpers.vbhtml", 1)
-Public Shared Function Bold(s as String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("Helpers.vbhtml", 1)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("Helpers.vbhtml", 3)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Helpers.vbhtml", 4)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-#ExternalSource("Helpers.vbhtml", 6)
-Public Shared Function Italic(s as String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("Helpers.vbhtml", 6)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("Helpers.vbhtml", 8)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Helpers.vbhtml", 9)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Helpers.vbhtml",11)
-Write(Bold("Hello"))
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingCloseParen.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingCloseParen.vb
deleted file mode 100644
index f9cc177410..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingCloseParen.vb
+++ /dev/null
@@ -1,66 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class HelpersMissingCloseParen
-
-#ExternalSource("HelpersMissingCloseParen.vbhtml", 1)
-Public Shared Function Bold(s as String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("HelpersMissingCloseParen.vbhtml", 1)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("HelpersMissingCloseParen.vbhtml", 3)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("HelpersMissingCloseParen.vbhtml", 4)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-#ExternalSource("HelpersMissingCloseParen.vbhtml", 6)
-Public Shared Function Italic(s as String
-
-@Bold("Hello")
-#End ExternalSource
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingName.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingName.vb
deleted file mode 100644
index 79c3c00d0f..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingName.vb
+++ /dev/null
@@ -1,24 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class HelpersMissingName
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingOpenParen.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingOpenParen.vb
deleted file mode 100644
index a199de01ec..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/HelpersMissingOpenParen.vb
+++ /dev/null
@@ -1,72 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class HelpersMissingOpenParen
-
-#ExternalSource("HelpersMissingOpenParen.vbhtml", 1)
-Public Shared Function Bold(s as String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("HelpersMissingOpenParen.vbhtml", 1)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("HelpersMissingOpenParen.vbhtml", 3)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("HelpersMissingOpenParen.vbhtml", 4)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-#ExternalSource("HelpersMissingOpenParen.vbhtml", 6)
-Public Shared Function Italic
-#End ExternalSource
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("HelpersMissingOpenParen.vbhtml",8)
-Write(Bold("Hello"))
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ImplicitExpression.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ImplicitExpression.vb
deleted file mode 100644
index dd9e756fe9..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ImplicitExpression.vb
+++ /dev/null
@@ -1,56 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ImplicitExpression
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("ImplicitExpression.vbhtml",1)
- For i = 1 To 10
-
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral("
This is item #")
-
-
-#ExternalSource("ImplicitExpression.vbhtml",2)
- Write(i)
-
-
-#End ExternalSource
-WriteLiteral("
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ImplicitExpression.vbhtml",3)
-Next
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ImplicitExpression.vbhtml",5)
-Write(SyntaxSampleHelpers.CodeForLink(Me))
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ImplicitExpressionAtEOF.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ImplicitExpressionAtEOF.vb
deleted file mode 100644
index debff90d32..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ImplicitExpressionAtEOF.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ImplicitExpressionAtEOF
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("ImplicitExpressionAtEOF.vbhtml",1)
-__o =
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Imports.DesignTime.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Imports.DesignTime.vb
deleted file mode 100644
index 5868d5ab1f..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Imports.DesignTime.vb
+++ /dev/null
@@ -1,41 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports Foo = System.Text.Encoding
-
-Imports System
-Imports System.IO
-
-
-Namespace TestOutput
-Public Class [Imports]
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("Imports.vbhtml",4)
- __o = GetType(Path).FullName
-
-
-#End ExternalSource
-
-#ExternalSource("Imports.vbhtml",5)
- __o = GetType(Foo).FullName
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Imports.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Imports.vb
deleted file mode 100644
index d35ce2ab4c..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Imports.vb
+++ /dev/null
@@ -1,46 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports Foo = System.Text.Encoding
-
-Imports System
-Imports System.IO
-
-
-Namespace TestOutput
-Public Class [Imports]
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"
Path's full type name is ")
-
-
-#ExternalSource("Imports.vbhtml",5)
- Write(GetType(Path).FullName)
-
-
-#End ExternalSource
-WriteLiteral("
Foo's actual full type name is ")
-
-
-#ExternalSource("Imports.vbhtml",6)
- Write(GetType(Foo).FullName)
-
-
-#End ExternalSource
-WriteLiteral("
")
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Inherits.Designtime.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Inherits.Designtime.vb
deleted file mode 100644
index fc62324b67..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Inherits.Designtime.vb
+++ /dev/null
@@ -1,35 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class [Inherits]
-Inherits System.Web.WebPages.WebPage
-Public Sub New()
-MyBase.New
-End Sub
-Private Sub __RazorDesignTimeHelpers__()
-
-
-#ExternalSource("Inherits.vbhtml",1)
-Dim __inheritsHelper As System.Web.WebPages.WebPage = Nothing
-
-
-#End ExternalSource
-
-End Sub
-Public Overrides Sub Execute()
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Inherits.Runtime.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Inherits.Runtime.vb
deleted file mode 100644
index 1395dac155..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Inherits.Runtime.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class [Inherits]
-Inherits System.Web.WebPages.WebPage
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Instrumented.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Instrumented.vb
deleted file mode 100644
index d800bbe45d..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Instrumented.vb
+++ /dev/null
@@ -1,511 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class Instrumented
-
-#ExternalSource("Instrumented.vbhtml", 1)
-Public Shared Function Strong(s As String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("Instrumented.vbhtml", 1)
-
-
-
-#End ExternalSource
-BeginContext(__razor_helper_writer, "~/Instrumented.vbhtml", 29, 4, true)
-
-WriteLiteralTo(__razor_helper_writer, " ")
-
-EndContext(__razor_helper_writer, "~/Instrumented.vbhtml", 29, 4, true)
-
-BeginContext(__razor_helper_writer, "~/Instrumented.vbhtml", 34, 8, true)
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-EndContext(__razor_helper_writer, "~/Instrumented.vbhtml", 34, 8, true)
-
-BeginContext(__razor_helper_writer, "~/Instrumented.vbhtml", 43, 1, false)
-
-
-#ExternalSource("Instrumented.vbhtml", 2)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-EndContext(__razor_helper_writer, "~/Instrumented.vbhtml", 43, 1, false)
-
-BeginContext(__razor_helper_writer, "~/Instrumented.vbhtml", 44, 11, true)
-
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-EndContext(__razor_helper_writer, "~/Instrumented.vbhtml", 44, 11, true)
-
-
-#ExternalSource("Instrumented.vbhtml", 3)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-BeginContext("~/Instrumented.vbhtml", 65, 4, true)
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-EndContext("~/Instrumented.vbhtml", 65, 4, true)
-
-
-#ExternalSource("Instrumented.vbhtml",5)
-
- Dim i As Integer = 1
- Dim foo =
-
-#End ExternalSource
-Function (item) New Template(Sub (__razor_template_writer)
-
-BeginContext(__razor_template_writer, "~/Instrumented.vbhtml", 118, 12, true)
-
-WriteLiteralTo(__razor_template_writer, "
Some random memory stream will be disposed after rendering this block
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-EndContext("~/Instrumented.vbhtml", 968, 78, true)
-
-
-#ExternalSource("Instrumented.vbhtml",53)
-End Using
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/LayoutDirective.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/LayoutDirective.vb
deleted file mode 100644
index fb7bdbdd02..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/LayoutDirective.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class LayoutDirective
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-Layout = "~/Foo/Bar/Baz"
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/MarkupInCodeBlock.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/MarkupInCodeBlock.vb
deleted file mode 100644
index c70fd0bf37..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/MarkupInCodeBlock.vb
+++ /dev/null
@@ -1,51 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class MarkupInCodeBlock
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("MarkupInCodeBlock.vbhtml",1)
-
- For i = 1 To 10
-
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral("
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("MarkupInCodeBlock.vbhtml",4)
- Next i
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NestedCodeBlocks.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NestedCodeBlocks.vb
deleted file mode 100644
index 1ea3d48b2f..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NestedCodeBlocks.vb
+++ /dev/null
@@ -1,42 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class NestedCodeBlocks
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("NestedCodeBlocks.vbhtml",1)
- If True Then
-
-
-#End ExternalSource
-
-#ExternalSource("NestedCodeBlocks.vbhtml",2)
- If True Then
- End If
-
-
-#End ExternalSource
-
-#ExternalSource("NestedCodeBlocks.vbhtml",4)
-End If
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NestedHelpers.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NestedHelpers.vb
deleted file mode 100644
index 071708e84a..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NestedHelpers.vb
+++ /dev/null
@@ -1,103 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class NestedHelpers
-
-#ExternalSource("NestedHelpers.vbhtml", 3)
-Public Shared Function Bold(s As String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("NestedHelpers.vbhtml", 3)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("NestedHelpers.vbhtml", 5)
-WriteTo(__razor_helper_writer, s)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("NestedHelpers.vbhtml", 6)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-#ExternalSource("NestedHelpers.vbhtml", 1)
-Public Shared Function Italic(s As String) As Template
-
-#End ExternalSource
-Return New Template(Sub (__razor_helper_writer)
-
-#ExternalSource("NestedHelpers.vbhtml", 1)
-
- s = s.ToUpper()
-
-
-#End ExternalSource
-
-#ExternalSource("NestedHelpers.vbhtml", 6)
-
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, " ")
-
-WriteLiteralTo(__razor_helper_writer, "")
-
-
-#ExternalSource("NestedHelpers.vbhtml", 7)
-WriteTo(__razor_helper_writer, Bold(s))
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_helper_writer, ""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("NestedHelpers.vbhtml", 8)
-
-
-#End ExternalSource
-End Sub)
-End Function
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("NestedHelpers.vbhtml",10)
-Write(Italic("Hello"))
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NoLinePragmas.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NoLinePragmas.vb
deleted file mode 100644
index fea6867646..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/NoLinePragmas.vb
+++ /dev/null
@@ -1,143 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class NoLinePragmas
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
- Dim i as Integer = 1
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- While i <= 10
-
-WriteLiteral(" ")
-
-WriteLiteral("
Hello from VB.Net, #")
-
- Write(i)
-
-WriteLiteral("
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- i += 1
- 'End While
-End While
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- If i = 11 Then
-
-WriteLiteral(" ")
-
-WriteLiteral("
We wrote 10 lines!
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- Dim s = "End If"
-End If
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- Select Case i
- Case 11
-
-WriteLiteral(" ")
-
-WriteLiteral("
No really, we wrote 10 lines!
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- Case Else
-
-WriteLiteral(" ")
-
-WriteLiteral("
Actually, we didn't...
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Select
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- For j as Integer = 1 to 10 Step 2
-
-WriteLiteral(" ")
-
-WriteLiteral("
Hello again from VB.Net, #")
-
- Write(j)
-
-WriteLiteral("
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Try
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- With i
-
-WriteLiteral(" ")
-
-WriteLiteral("
i is now ")
-
- Write(.ToString())
-
-WriteLiteral("
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End With
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- SyncLock New Object()
-
-WriteLiteral(" ")
-
-WriteLiteral("
This block is locked, for your security!
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End SyncLock
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
- Using New System.IO.MemoryStream()
-
-WriteLiteral(" ")
-
-WriteLiteral("
Some random memory stream will be disposed after rendering this block
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Using
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-Write(SyntaxSampleHelpers.CodeForLink(Me))
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Options.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Options.vb
deleted file mode 100644
index 7f472d2020..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Options.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict On
-Option Explicit Off
-
-Imports System
-
-Namespace TestOutput
-Public Class Options
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"Hello, World!")
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ParserError.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ParserError.vb
deleted file mode 100644
index dc1c177b07..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ParserError.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ParserError
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("ParserError.vbhtml",1)
-
-Foo
-'End Code
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/RazorComments.DesignTime.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/RazorComments.DesignTime.vb
deleted file mode 100644
index 925fc5bb62..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/RazorComments.DesignTime.vb
+++ /dev/null
@@ -1,59 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class RazorComments
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("RazorComments.vbhtml",1)
-
-
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",2)
-
-
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",3)
- Dim bar As String = "@* bar *@"
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",4)
- __o = bar
-
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",5)
-__o = a _
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",6)
- b
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/RazorComments.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/RazorComments.vb
deleted file mode 100644
index 909c96fe9f..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/RazorComments.vb
+++ /dev/null
@@ -1,72 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class RazorComments
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"
This should ")
-
-WriteLiteral(" be shown
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("RazorComments.vbhtml",4)
-
-
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",5)
-
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("RazorComments.vbhtml",8)
- Dim bar As String = "@* bar *@"
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"
But this should show the comment syntax: ")
-
-
-#ExternalSource("RazorComments.vbhtml",9)
- Write(bar)
-
-
-#End ExternalSource
-WriteLiteral("
So should this: ")
-
-WriteLiteral("@* bar *")
-
-WriteLiteral("@
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("RazorComments.vbhtml",12)
-Write(a _
-
-#End ExternalSource
-
-#ExternalSource("RazorComments.vbhtml",12)
- b)
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ResolveUrl.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ResolveUrl.vb
deleted file mode 100644
index 6e876b1dfc..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/ResolveUrl.vb
+++ /dev/null
@@ -1,183 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class ResolveUrl
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral("Foo"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"")
-
-
-#ExternalSource("ResolveUrl.vbhtml",2)
- Write(product.Name)
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"Details"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"Crazy Url!"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ResolveUrl.vbhtml",6)
-
-
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" Foo"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" ")
-
-
-#ExternalSource("ResolveUrl.vbhtml",9)
- Write(product.Name)
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" Details"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" Crazy Url!"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" ")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("ResolveUrl.vbhtml",13)
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-DefineSection("Foo", Sub ()
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" Foo"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" ")
-
-
-#ExternalSource("ResolveUrl.vbhtml",17)
- Write(product.Name)
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" Details"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" Crazy Url!"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Sub)
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Sections.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Sections.vb
deleted file mode 100644
index 8b9b34d0ff..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Sections.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class Sections
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("Sections.vbhtml",1)
-
- Layout = "_SectionTestLayout.vbhtml"
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"
This is in the Body>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-DefineSection("Section2", Sub ()
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-End Sub)
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Templates.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Templates.vb
deleted file mode 100644
index 8d4bcdd3b2..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/Templates.vb
+++ /dev/null
@@ -1,169 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-Imports System.Web.Helpers
-
-
-Namespace TestOutput
-Public Class Templates
-
-#ExternalSource("Templates.vbhtml",3)
-
- Public Function Repeat(times As Integer, template As Func(Of Integer, object)) As HelperResult
- Return New HelperResult(Sub(writer)
- For i = 0 to times
- DirectCast(template(i), HelperResult).WriteTo(writer)
- Next i
- End Sub)
- End Function
-
-#End ExternalSource
-
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Templates.vbhtml",13)
-
- Dim foo As Func(Of Object, Object) =
-
-#End ExternalSource
-WriteLiteral(" ")
-
-WriteLiteral("This works ")
-
-
-#ExternalSource("Templates.vbhtml",14)
- Write(item)
-
-
-#End ExternalSource
-WriteLiteral("!")
-
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Templates.vbhtml",15)
-
-
-#End ExternalSource
-
-#ExternalSource("Templates.vbhtml",15)
-Write(foo("too"))
-
-
-#End ExternalSource
-
-#ExternalSource("Templates.vbhtml",15)
-
-
-
-#End ExternalSource
-WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"
"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
-
-
-#ExternalSource("Templates.vbhtml",19)
-Write(Repeat(10, Function (item) New Template(Sub (__razor_template_writer)
-
-
-#End ExternalSource
-WriteLiteralTo(__razor_template_writer, "
")
-
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/UnfinishedExpressionInCode.vb b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/UnfinishedExpressionInCode.vb
deleted file mode 100644
index a2cccc0fe8..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Output/UnfinishedExpressionInCode.vb
+++ /dev/null
@@ -1,43 +0,0 @@
-'------------------------------------------------------------------------------
-'
-' This code was generated by a tool.
-' Runtime Version:N.N.NNNNN.N
-'
-' Changes to this file may cause incorrect behavior and will be lost if
-' the code is regenerated.
-'
-'------------------------------------------------------------------------------
-
-Option Strict Off
-Option Explicit On
-
-Imports System
-
-Namespace TestOutput
-Public Class UnfinishedExpressionInCode
-Private Shared __o As Object
-Public Sub New()
-MyBase.New
-End Sub
-Public Overrides Sub Execute()
-
-#ExternalSource("UnfinishedExpressionInCode.vbhtml",1)
-
-
-
-#End ExternalSource
-
-#ExternalSource("UnfinishedExpressionInCode.vbhtml",2)
-__o = DateTime.
-
-
-#End ExternalSource
-
-#ExternalSource("UnfinishedExpressionInCode.vbhtml",3)
-
-
-
-#End ExternalSource
-End Sub
-End Class
-End Namespace
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Blocks.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Blocks.vbhtml
deleted file mode 100644
index e2e02a6943..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Blocks.vbhtml
+++ /dev/null
@@ -1,46 +0,0 @@
-@Code
- Dim i as Integer = 1
-End Code
-
-@While i <= 10
- @
Hello from VB.Net, #@(i)
- i += 1
-End While
-
-@If i = 11 Then
- @
We wrote 10 lines!
-End If
-
-@Do
- @
Hello again: @i
- i -= 1
-Loop While i > 0
-
-@Select Case i
- Case 11
- @
No really, we wrote 10 lines!
- Case Else
- @
We wrote a bunch more lines too!
-End Select
-
-@For j as Integer = 1 to 10 Step 2
- @
Hello again from VB.Net, #@(j)
-Next j
-
-@Try
- @
That time, we wrote 5 lines!
-Catch ex as Exception
- @
Oh no! An error occurred: @(ex.Message)
-End Try
-
-@With i
- @
i is now @(.ToString())
-End With
-
-@SyncLock New Object()
- @
This block is locked, for your security!
-End SyncLock
-
-@Using New System.IO.MemoryStream()
- @
Some random memory stream will be disposed after rendering this block
-End Using
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/CodeBlock.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/CodeBlock.vbhtml
deleted file mode 100644
index c710eaf1cc..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/CodeBlock.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@Code
- Test()
-End Code
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/CodeBlockAtEOF.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/CodeBlockAtEOF.vbhtml
deleted file mode 100644
index 011d09a1f4..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/CodeBlockAtEOF.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-This is markup
-
-@Code
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ConditionalAttributes.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ConditionalAttributes.vbhtml
deleted file mode 100644
index ca77d2d792..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ConditionalAttributes.vbhtml
+++ /dev/null
@@ -1,16 +0,0 @@
-@Helper Link(ByVal url As String, text As String)
- @@text
-End Helper
-
-@Code
- Dim ch = True
- Dim cls = "bar"
- @
- @
- @
- @
- @
- @
- @
- @
-End Code
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/DesignTime.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/DesignTime.vbhtml
deleted file mode 100644
index cfd33e714d..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/DesignTime.vbhtml
+++ /dev/null
@@ -1,21 +0,0 @@
-
- @For i = 1 to 10
-@
This is item #@i
- Next
-
-
-
-@(Foo(Bar.Baz))
-@Foo(@@
Bar @baz Biz
)
-
-
-@Section Footer
-
Foo
- @bar
-End Section
-
-@Helper Foo()
- If True Then
- @
Foo
- End If
-End Helper
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyExplicitExpression.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyExplicitExpression.vbhtml
deleted file mode 100644
index 6790c7eba2..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyExplicitExpression.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-This is markup
-
-@()
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyImplicitExpression.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyImplicitExpression.vbhtml
deleted file mode 100644
index 021306da6b..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyImplicitExpression.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-This is markup
-
-@!
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyImplicitExpressionInCode.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyImplicitExpressionInCode.vbhtml
deleted file mode 100644
index deb98d53ec..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptyImplicitExpressionInCode.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@Code
- @
-End Code
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptySection.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptySection.vbhtml
deleted file mode 100644
index c63cd4666a..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/EmptySection.vbhtml
+++ /dev/null
@@ -1 +0,0 @@
-@section anything End
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExplicitExpression.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExplicitExpression.vbhtml
deleted file mode 100644
index b65eee5641..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExplicitExpression.vbhtml
+++ /dev/null
@@ -1 +0,0 @@
-@(Foo(Bar.Baz))
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExplicitExpressionAtEOF.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExplicitExpressionAtEOF.vbhtml
deleted file mode 100644
index a0fdfc9a21..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExplicitExpressionAtEOF.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-This is markup
-
-@(
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExpressionsInCode.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExpressionsInCode.vbhtml
deleted file mode 100644
index 3416ee9adf..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ExpressionsInCode.vbhtml
+++ /dev/null
@@ -1,16 +0,0 @@
-@Code
- Dim foo As Object = Nothing
- Dim bar as String = "Foo"
-End Code
-
-@If foo IsNot Nothing Then
- @foo
-Else
- @
Foo is Null!
-End If
-
-
-@If Not String.IsNullOrEmpty(bar) Then
- @(bar.Replace("F", "B"))
-End If
-
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/FunctionsBlock.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/FunctionsBlock.vbhtml
deleted file mode 100644
index bcb78211ee..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/FunctionsBlock.vbhtml
+++ /dev/null
@@ -1,12 +0,0 @@
-@Functions
-
-End Functions
-
-@Functions
- Private _rand as New Random()
- Private Function RandomInt() as Integer
- Return _rand.Next()
- End Function
-End Functions
-
-Here's a random number: @RandomInt()
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Helpers.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Helpers.vbhtml
deleted file mode 100644
index 6fead0cc77..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Helpers.vbhtml
+++ /dev/null
@@ -1,11 +0,0 @@
-@Helper Bold(s as String)
- s = s.ToUpper()
- @@s
-End Helper
-
-@Helper Italic(s as String)
- s = s.ToUpper()
- @@s
-End Helper
-
-@Bold("Hello")
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingCloseParen.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingCloseParen.vbhtml
deleted file mode 100644
index d81d24b29e..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingCloseParen.vbhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-@Helper Bold(s as String)
- s = s.ToUpper()
- @@s
-End Helper
-
-@Helper Italic(s as String
-
-@Bold("Hello")
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingName.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingName.vbhtml
deleted file mode 100644
index 36ec5a7ece..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingName.vbhtml
+++ /dev/null
@@ -1 +0,0 @@
-@Helper
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingOpenParen.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingOpenParen.vbhtml
deleted file mode 100644
index 145bda6855..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/HelpersMissingOpenParen.vbhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-@Helper Bold(s as String)
- s = s.ToUpper()
- @@s
-End Helper
-
-@Helper Italic
-
-@Bold("Hello")
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ImplicitExpression.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ImplicitExpression.vbhtml
deleted file mode 100644
index fb6f52816d..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ImplicitExpression.vbhtml
+++ /dev/null
@@ -1,5 +0,0 @@
-@For i = 1 To 10
- @
This is item #@i
-Next
-
-@SyntaxSampleHelpers.CodeForLink(Me)
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ImplicitExpressionAtEOF.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ImplicitExpressionAtEOF.vbhtml
deleted file mode 100644
index 365d20e003..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ImplicitExpressionAtEOF.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-This is markup
-
-@
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Imports.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Imports.vbhtml
deleted file mode 100644
index da3f0ec179..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Imports.vbhtml
+++ /dev/null
@@ -1,6 +0,0 @@
-@Imports System.IO
-@Imports Foo = System.Text.Encoding
-@Imports System
-
-
Path's full type name is @GetType(Path).FullName
-
Foo's actual full type name is @GetType(Foo).FullName
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Inherits.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Inherits.vbhtml
deleted file mode 100644
index cc0a2d2aa1..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Inherits.vbhtml
+++ /dev/null
@@ -1 +0,0 @@
-@Inherits System.Web.WebPages.WebPage
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Instrumented.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Instrumented.vbhtml
deleted file mode 100644
index 510aae4ba5..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Instrumented.vbhtml
+++ /dev/null
@@ -1,53 +0,0 @@
-@Helper Strong(s As String)
- @@s
-End Helper
-
-@Code
- Dim i As Integer = 1
- Dim foo = @@
Foo
- @:Hello, World!
- @
Hello, World!
-End Code
-
-@While i <= 10
- @
Hello from VB.Net, #@(i)
- i += 1
-End While
-
-@If i = 11 Then
- @
We wrote 10 lines!
-End If
-
-@Do
- @
Hello again: @i
- i -= 1
-Loop While i > 0
-
-@Select Case i
- Case 11
- @
No really, we wrote 10 lines!
- Case Else
- @
We wrote a bunch more lines too!
-End Select
-
-@For j as Integer = 1 to 10 Step 2
- @
Hello again from VB.Net, #@(j)
-Next j
-
-@Try
- @
That time, we wrote 5 lines!
-Catch ex as Exception
- @
Oh no! An error occurred: @(ex.Message)
-End Try
-
-@With i
- @
i is now @(.ToString())
-End With
-
-@SyncLock New Object()
- @
This block is locked, for your security!
-End SyncLock
-
-@Using New System.IO.MemoryStream()
- @
Some random memory stream will be disposed after rendering this block
-End Using
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/LayoutDirective.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/LayoutDirective.vbhtml
deleted file mode 100644
index 58904f11db..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/LayoutDirective.vbhtml
+++ /dev/null
@@ -1 +0,0 @@
-@Layout ~/Foo/Bar/Baz
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/MarkupInCodeBlock.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/MarkupInCodeBlock.vbhtml
deleted file mode 100644
index 832891345b..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/MarkupInCodeBlock.vbhtml
+++ /dev/null
@@ -1,5 +0,0 @@
-@Code
- For i = 1 To 10
- @
Hello from VB.Net, #@(i.ToString())
- Next i
-End Code
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NestedCodeBlocks.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NestedCodeBlocks.vbhtml
deleted file mode 100644
index 83f518ac19..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NestedCodeBlocks.vbhtml
+++ /dev/null
@@ -1,4 +0,0 @@
-@If True Then
- @If True Then
- End If
-End If
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NestedHelpers.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NestedHelpers.vbhtml
deleted file mode 100644
index 4c52502b91..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NestedHelpers.vbhtml
+++ /dev/null
@@ -1,10 +0,0 @@
-@Helper Italic(s As String)
- s = s.ToUpper()
- @Helper Bold(s As String)
- s = s.ToUpper()
- @@s
- End Helper
- @@Bold(s)
-End Helper
-
-@Italic("Hello")
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NoLinePragmas.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NoLinePragmas.vbhtml
deleted file mode 100644
index 4e9df78849..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/NoLinePragmas.vbhtml
+++ /dev/null
@@ -1,45 +0,0 @@
-@Code
- Dim i as Integer = 1
-End Code
-
-@While i <= 10
- @
Hello from VB.Net, #@(i)
- i += 1
- 'End While
-End While
-
-@If i = 11 Then
- @
We wrote 10 lines!
- Dim s = "End If"
-End If
-
-@Select Case i
- Case 11
- @
No really, we wrote 10 lines!
- Case Else
- @
Actually, we didn't...
-End Select
-
-@For j as Integer = 1 to 10 Step 2
- @
Hello again from VB.Net, #@(j)
-Next
-
-@Try
- @
That time, we wrote 5 lines!
-Catch ex as Exception
- @
Oh no! An error occurred: @(ex.Message)
-End Try
-
-@With i
- @
i is now @(.ToString())
-End With
-
-@SyncLock New Object()
- @
This block is locked, for your security!
-End SyncLock
-
-@Using New System.IO.MemoryStream()
- @
Some random memory stream will be disposed after rendering this block
-End Using
-
-@SyntaxSampleHelpers.CodeForLink(Me)
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Options.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Options.vbhtml
deleted file mode 100644
index 0cd49aa337..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Options.vbhtml
+++ /dev/null
@@ -1,4 +0,0 @@
-@Option Strict On
-@Option Explicit Off
-
-Hello, World!
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ParserError.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ParserError.vbhtml
deleted file mode 100644
index 2d2e4227db..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ParserError.vbhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@Code
-Foo
-'End Code
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/RazorComments.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/RazorComments.vbhtml
deleted file mode 100644
index 7c638d63b7..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/RazorComments.vbhtml
+++ /dev/null
@@ -1,12 +0,0 @@
-@*This is not going to be rendered*@
-
This should @* not *@ be shown
-
-@Code
- @* Throw new Exception("Oh no!") *@
-End Code
-
-@Code Dim bar As String = "@* bar *@" End Code
-
But this should show the comment syntax: @bar
-
So should this: @@* bar *@@
-
-@(a@**@b)
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ResolveUrl.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ResolveUrl.vbhtml
deleted file mode 100644
index dc20f64488..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/ResolveUrl.vbhtml
+++ /dev/null
@@ -1,20 +0,0 @@
-Foo
-@product.Name
-Details
-Crazy Url!
-
-@Code
- @
- Foo
- @product.Name
- Details
- Crazy Url!
-
-End Code
-
-@Section Foo
- Foo
- @product.Name
- Details
- Crazy Url!
-End Section
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Sections.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Sections.vbhtml
deleted file mode 100644
index ad05f5cd28..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Sections.vbhtml
+++ /dev/null
@@ -1,13 +0,0 @@
-@Code
- Layout = "_SectionTestLayout.vbhtml"
-End Code
-
-
This is in the Body>
-
-@Section Section2
-
This is in Section 2
-End Section
-
-@Section Section1
-
This is in Section 1
-End Section
\ No newline at end of file
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Templates.vbhtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Templates.vbhtml
deleted file mode 100644
index 80e17703e5..0000000000
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/VB/Source/Templates.vbhtml
+++ /dev/null
@@ -1,36 +0,0 @@
-@Imports System.Web.Helpers
-
-@Functions
- Public Function Repeat(times As Integer, template As Func(Of Integer, object)) As HelperResult
- Return New HelperResult(Sub(writer)
- For i = 0 to times
- DirectCast(template(i), HelperResult).WriteTo(writer)
- Next i
- End Sub)
- End Function
-End Functions
-
-@Code
- Dim foo As Func(Of Object, Object) = @This works @item!
- @foo("too")
-End Code
-
-
-@(Repeat(10, @@
Item #@item
))
-
-
-
-@Repeat(10,
- @@: This is line#@item of markup
-)
-
-
-
- @Repeat(10, @@
- Item #@item
- @Code Dim parent = item End Code
-