Add more testing from submitted user cases. (#10471)

This commit is contained in:
Fred Silberberg 2024-06-11 13:43:36 -07:00 коммит произвёл GitHub
Родитель 69799ac98a
Коммит 7345c294cf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
22 изменённых файлов: 991 добавлений и 42 удалений

Просмотреть файл

@ -44,6 +44,19 @@ public class TestTagHelperDescriptors
.Name("age")
.Metadata(PropertyName("AgeProp"))
.TypeName("System.Int32"),
builder => builder
.Name("alive")
.Metadata(PropertyName("AliveProp"))
.TypeName("System.Boolean"),
builder => builder
.Name("tag")
.Metadata(PropertyName("TagProp"))
.TypeName("System.Object"),
builder => builder
.Name("tuple-dictionary")
.Metadata(PropertyName("DictionaryOfBoolAndStringTupleProperty"))
.TypeName(typeof(IDictionary<string, int>).Namespace + ".IDictionary<System.String, (System.Boolean, System.String)>")
.AsDictionaryAttribute("tuple-prefix-", typeof((bool, string)).FullName)
})
};
}

Просмотреть файл

@ -475,6 +475,16 @@ public class TagHelperBlockRewriterTest : TagHelperRewritingTestBase
.Name("name")
.Metadata(PropertyName("Name"))
.TypeName(typeof(string).FullName))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("alive")
.Metadata(PropertyName("Alive"))
.TypeName(typeof(bool).FullName))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("tag")
.Metadata(PropertyName("Tag"))
.TypeName(typeof(object).FullName))
.Build()
];
@ -633,6 +643,61 @@ public class TagHelperBlockRewriterTest : TagHelperRewritingTestBase
""");
}
[Fact, WorkItem("https://github.com/dotnet/razor/issues/10186")]
public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes20()
{
EvaluateData(CodeTagHelperAttributes_Descriptors, """
@{
var isAlive = true;
}
<person alive="!@isAlive" />
""");
}
[Fact, WorkItem("https://github.com/dotnet/razor/issues/10186")]
public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes21()
{
EvaluateData(CodeTagHelperAttributes_Descriptors, """
@{
var obj = new { Prop = (object)1 };
}
<person age="(int)@obj.Prop" />
""");
}
[Fact, WorkItem("https://github.com/dotnet/razor/issues/10186")]
public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes22()
{
EvaluateData(CodeTagHelperAttributes_Descriptors, """
@{
var obj = new { Prop = (object)1 };
}
<person tag="new { @params = 1 }" />
""");
}
[Fact, WorkItem("https://github.com/dotnet/razor/issues/10186")]
public void CreatesMarkupCodeSpansForNonStringTagHelperAttributes23()
{
EvaluateData(
[TagHelperDescriptorBuilder
.Create("InputTagHelper", "SomeAssembly")
.TagMatchingRuleDescriptor(rule => rule.RequireTagName("input"))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("tuple-dictionary")
.Metadata(PropertyName("DictionaryOfBoolAndStringTupleProperty"))
.TypeName(typeof(IDictionary<string, int>).Namespace + ".IDictionary<System.String, (System.Boolean, System.String)>")
.AsDictionaryAttribute("tuple-prefix-", typeof((bool, string)).FullName))
.Build()],
"""
@{
var item = new { Items = new System.List<string>() { "one", "two" } };
}
<input tuple-prefix-test='(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))' />
""");
}
[Fact]
public void TagHelperParseTreeRewriter_CreatesErrorForIncompleteTagHelper1()
{

Просмотреть файл

@ -2,5 +2,10 @@
@{
var count = "1";
var alive = true;
var obj = new { age = (object)1 };
var item = new { Items = new System.List<string>() { "one", "two" } };
}
<input age="Convert.ToInt32(@count)" />
<input age="Convert.ToInt32(@count)" alive="!@alive" />
<input age="(int)@obj.age" tag="new { @params = 1 }" />
<input tuple-prefix-test='(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))' />

Просмотреть файл

@ -35,15 +35,50 @@ global::System.Object __typeHelper = "*, TestAssembly";
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
var count = "1";
var alive = true;
var obj = new { age = (object)1 };
var item = new { Items = new System.List<string>() { "one", "two" } };
#line default
#line hidden
#nullable disable
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
#nullable restore
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
__InputTagHelper.AgeProp = Convert.ToInt32(@count);
#line default
#line hidden
#nullable disable
#nullable restore
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
__InputTagHelper.AliveProp = !@alive;
#line default
#line hidden
#nullable disable
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
#nullable restore
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
__InputTagHelper.AgeProp = (int)@obj.age;
#line default
#line hidden
#nullable disable
#nullable restore
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
__InputTagHelper.TagProp = new { @params = 1 };
#line default
#line hidden
#nullable disable
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
#nullable restore
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
__InputTagHelper.DictionaryOfBoolAndStringTupleProperty["test"] = (@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""));
#line default
#line hidden
#nullable disable

Просмотреть файл

@ -2,5 +2,10 @@
~~
~~~ ~~~~~ ~ ~~~~
~~~ ~~~~~ ~ ~~~~~
~~~ ~~~ ~ ~~~ ~ ~~~ ~ ~~~~~~~~~ ~~
~~~ ~~~~ ~ ~~~ ~ ~~~~~ ~ ~~~ ~~~~~~~~~~~~~~~~~~~~~ ~ ~~~~~~ ~~~~~ ~ ~~
~
<input age="~~~~~~~~~~~~~~~~~~~~~~~" />
<input age="~~~~~~~~~~~~~~~~~~~~~~~" alive="~~~~~~~" />
<input age="~~~~~~~~~~~~~" tag="~~~ ~ ~~~~~~~ ~ ~ ~" />
<input tuple-prefix-test='~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~' />

Просмотреть файл

@ -12,17 +12,41 @@ Generated Location: (31:0,31 [4] )
|
Source Location: (62:4,1 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
Source Location: (201:7,1 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|
<input age="|
Generated Location: (62:4,1 [14] )
Generated Location: (201:7,1 [14] )
|
<input age="|
Source Location: (99:5,35 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
Source Location: (238:8,35 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|" alive="|
Generated Location: (238:8,35 [9] )
|" alive="|
Source Location: (254:8,51 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|" />
<input age="|
Generated Location: (254:8,51 [18] )
|" />
<input age="|
Source Location: (285:9,25 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|" tag="|
Generated Location: (285:9,25 [7] )
|" tag="|
Source Location: (311:9,51 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|" />
<input tuple-prefix-test='|
Generated Location: (311:9,51 [32] )
|" />
<input tuple-prefix-test='|
Source Location: (467:10,150 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|' />
|
Generated Location: (99:5,35 [6] )
|" />
Generated Location: (467:10,150 [6] )
|' />
|

Просмотреть файл

@ -14,16 +14,58 @@
MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (31:0,31 [4] EscapedIdentifier.cshtml)
LazyIntermediateToken - (31:0,31 [4] EscapedIdentifier.cshtml) - Html - \n\n
CSharpCode - (37:2,2 [24] EscapedIdentifier.cshtml)
LazyIntermediateToken - (37:2,2 [24] EscapedIdentifier.cshtml) - CSharp - \n var count = "1";\n
TagHelper - (64:5,0 [39] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
CSharpCode - (37:2,2 [163] EscapedIdentifier.cshtml)
LazyIntermediateToken - (37:2,2 [163] EscapedIdentifier.cshtml) - CSharp - \n var count = "1";\n var alive = true;\n var obj = new { age = (object)1 };\n var item = new { Items = new System.List<string>() { "one", "two" } };\n
TagHelper - (203:8,0 [55] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTagHelper
DefaultTagHelperProperty - (76:5,12 [23] EscapedIdentifier.cshtml) - age - int InputTagHelper.AgeProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (76:5,12 [16] EscapedIdentifier.cshtml) - CSharp - Convert.ToInt32(
CSharpExpression - (92:5,28 [6] EscapedIdentifier.cshtml)
LazyIntermediateToken - (92:5,28 [6] EscapedIdentifier.cshtml) - CSharp - @count
LazyIntermediateToken - (98:5,34 [1] EscapedIdentifier.cshtml) - CSharp - )
DefaultTagHelperProperty - (215:8,12 [23] EscapedIdentifier.cshtml) - age - int InputTagHelper.AgeProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (215:8,12 [16] EscapedIdentifier.cshtml) - CSharp - Convert.ToInt32(
CSharpExpression - (231:8,28 [6] EscapedIdentifier.cshtml)
LazyIntermediateToken - (231:8,28 [6] EscapedIdentifier.cshtml) - CSharp - @count
LazyIntermediateToken - (237:8,34 [1] EscapedIdentifier.cshtml) - CSharp - )
DefaultTagHelperProperty - (247:8,44 [7] EscapedIdentifier.cshtml) - alive - bool InputTagHelper.AliveProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (247:8,44 [1] EscapedIdentifier.cshtml) - CSharp - !
CSharpExpression - (248:8,45 [6] EscapedIdentifier.cshtml)
LazyIntermediateToken - (248:8,45 [6] EscapedIdentifier.cshtml) - CSharp - @alive
DefaultTagHelperExecute -
HtmlContent - (103:5,39 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (103:5,39 [2] EscapedIdentifier.cshtml) - Html - \n
HtmlContent - (258:8,55 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (258:8,55 [2] EscapedIdentifier.cshtml) - Html - \n
TagHelper - (260:9,0 [55] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTagHelper
DefaultTagHelperProperty - (272:9,12 [13] EscapedIdentifier.cshtml) - age - int InputTagHelper.AgeProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (272:9,12 [5] EscapedIdentifier.cshtml) - CSharp - (int)
CSharpExpression - (277:9,17 [8] EscapedIdentifier.cshtml)
LazyIntermediateToken - (277:9,17 [8] EscapedIdentifier.cshtml) - CSharp - @obj.age
DefaultTagHelperProperty - (292:9,32 [19] EscapedIdentifier.cshtml) - tag - object InputTagHelper.TagProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (292:9,32 [3] EscapedIdentifier.cshtml) - CSharp - new
LazyIntermediateToken - (295:9,35 [2] EscapedIdentifier.cshtml) - CSharp - {
LazyIntermediateToken - (297:9,37 [1] EscapedIdentifier.cshtml) - CSharp -
CSharpExpression - (298:9,38 [7] EscapedIdentifier.cshtml)
LazyIntermediateToken - (298:9,38 [7] EscapedIdentifier.cshtml) - CSharp - @params
LazyIntermediateToken - (305:9,45 [2] EscapedIdentifier.cshtml) - CSharp - =
LazyIntermediateToken - (307:9,47 [2] EscapedIdentifier.cshtml) - CSharp - 1
LazyIntermediateToken - (309:9,49 [2] EscapedIdentifier.cshtml) - CSharp - }
DefaultTagHelperExecute -
HtmlContent - (315:9,55 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (315:9,55 [2] EscapedIdentifier.cshtml) - Html - \n
TagHelper - (317:10,0 [154] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTagHelper
DefaultTagHelperProperty - (343:10,26 [124] EscapedIdentifier.cshtml) - tuple-prefix-test - System.Collections.Generic.IDictionary<System.String, (System.Boolean, System.String)> InputTagHelper.DictionaryOfBoolAndStringTupleProperty - HtmlAttributeValueStyle.SingleQuotes
LazyIntermediateToken - (343:10,26 [1] EscapedIdentifier.cshtml) - CSharp - (
CSharpExpression - (344:10,27 [5] EscapedIdentifier.cshtml)
LazyIntermediateToken - (344:10,27 [5] EscapedIdentifier.cshtml) - CSharp - @item
LazyIntermediateToken - (349:10,32 [1] EscapedIdentifier.cshtml) - CSharp - .
LazyIntermediateToken - (350:10,33 [35] EscapedIdentifier.cshtml) - CSharp - Items.Where(i=>i.Contains("one")).
LazyIntermediateToken - (385:10,68 [11] EscapedIdentifier.cshtml) - CSharp - Count()>0,
LazyIntermediateToken - (396:10,79 [1] EscapedIdentifier.cshtml) - CSharp -
CSharpExpression - (397:10,80 [5] EscapedIdentifier.cshtml)
LazyIntermediateToken - (397:10,80 [5] EscapedIdentifier.cshtml) - CSharp - @item
LazyIntermediateToken - (402:10,85 [1] EscapedIdentifier.cshtml) - CSharp - .
LazyIntermediateToken - (403:10,86 [45] EscapedIdentifier.cshtml) - CSharp - Items.FirstOrDefault(i=>i.Contains("one"))?.
LazyIntermediateToken - (448:10,131 [19] EscapedIdentifier.cshtml) - CSharp - Replace("one",""))
DefaultTagHelperExecute -
HtmlContent - (471:10,154 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (471:10,154 [2] EscapedIdentifier.cshtml) - Html - \n

Просмотреть файл

@ -3,27 +3,138 @@
Generated Location: (1009:18,37 [17] )
|"*, TestAssembly"|
Source Location: (37:2,2 [24] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
Source Location: (37:2,2 [163] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|
var count = "1";
var alive = true;
var obj = new { age = (object)1 };
var item = new { Items = new System.List<string>() { "one", "two" } };
|
Generated Location: (1500:35,2 [24] )
Generated Location: (1500:35,2 [163] )
|
var count = "1";
var alive = true;
var obj = new { age = (object)1 };
var item = new { Items = new System.List<string>() { "one", "two" } };
|
Source Location: (76:5,12 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
Source Location: (215:8,12 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|Convert.ToInt32(|
Generated Location: (1788:44,27 [16] )
Generated Location: (1927:47,27 [16] )
|Convert.ToInt32(|
Source Location: (92:5,28 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
Source Location: (231:8,28 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|@count|
Generated Location: (1804:44,43 [6] )
Generated Location: (1943:47,43 [6] )
|@count|
Source Location: (98:5,34 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
Source Location: (237:8,34 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|)|
Generated Location: (1810:44,49 [1] )
Generated Location: (1949:47,49 [1] )
|)|
Source Location: (247:8,44 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|!|
Generated Location: (2159:54,44 [1] )
|!|
Source Location: (248:8,45 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|@alive|
Generated Location: (2160:54,45 [6] )
|@alive|
Source Location: (272:9,12 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|(int)|
Generated Location: (2510:63,27 [5] )
|(int)|
Source Location: (277:9,17 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|@obj.age|
Generated Location: (2515:63,32 [8] )
|@obj.age|
Source Location: (292:9,32 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|new|
Generated Location: (2721:70,32 [3] )
|new|
Source Location: (295:9,35 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| {|
Generated Location: (2724:70,35 [2] )
| {|
Source Location: (297:9,37 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| |
Generated Location: (2726:70,37 [1] )
| |
Source Location: (298:9,38 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|@params|
Generated Location: (2727:70,38 [7] )
|@params|
Source Location: (305:9,45 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| =|
Generated Location: (2734:70,45 [2] )
| =|
Source Location: (307:9,47 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| 1|
Generated Location: (2736:70,47 [2] )
| 1|
Source Location: (309:9,49 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| }|
Generated Location: (2738:70,49 [2] )
| }|
Source Location: (343:10,26 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|(|
Generated Location: (3123:79,66 [1] )
|(|
Source Location: (344:10,27 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|@item|
Generated Location: (3124:79,67 [5] )
|@item|
Source Location: (349:10,32 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|.|
Generated Location: (3129:79,72 [1] )
|.|
Source Location: (350:10,33 [35] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| Items.Where(i=>i.Contains("one")).|
Generated Location: (3130:79,73 [35] )
| Items.Where(i=>i.Contains("one")).|
Source Location: (385:10,68 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| Count()>0,|
Generated Location: (3165:79,108 [11] )
| Count()>0,|
Source Location: (396:10,79 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| |
Generated Location: (3176:79,119 [1] )
| |
Source Location: (397:10,80 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|@item|
Generated Location: (3177:79,120 [5] )
|@item|
Source Location: (402:10,85 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
|.|
Generated Location: (3182:79,125 [1] )
|.|
Source Location: (403:10,86 [45] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| Items.FirstOrDefault(i=>i.Contains("one"))?.|
Generated Location: (3183:79,126 [45] )
| Items.FirstOrDefault(i=>i.Contains("one"))?.|
Source Location: (448:10,131 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml)
| Replace("one",""))|
Generated Location: (3228:79,171 [19] )
| Replace("one",""))|

Просмотреть файл

@ -1,11 +1,11 @@
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "56fbfd01b420ab12628e8f5c23b2e88ef109db5398f18d87931cf424410b93c8"
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8fc172b55ced462a1746f1082869701d161cf36fd24dacd8d9fa98cc66d744ad"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")]
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles
{
#line hidden
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"56fbfd01b420ab12628e8f5c23b2e88ef109db5398f18d87931cf424410b93c8", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"8fc172b55ced462a1746f1082869701d161cf36fd24dacd8d9fa98cc66d744ad", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")]
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_Runtime
{
#line hidden
@ -34,9 +34,12 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles
{
WriteLiteral("\r\n");
#nullable restore
#line (3,3)-(5,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line (3,3)-(8,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
var count = "1";
var alive = true;
var obj = new { age = (object)1 };
var item = new { Items = new System.List<string>() { "one", "two" } };
#line default
#line hidden
@ -49,21 +52,21 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.AgeProp =
#nullable restore
#line (6,13)-(6,29) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line (9,13)-(9,29) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
Convert.ToInt32(
#line default
#line hidden
#nullable disable
#nullable restore
#line (6,29)-(6,35) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line (9,29)-(9,35) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
@count
#line default
#line hidden
#nullable disable
#nullable restore
#line (6,35)-(6,36) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line (9,35)-(9,36) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
)
#line default
@ -71,6 +74,195 @@ Convert.ToInt32(
#nullable disable
;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __InputTagHelper.AgeProp, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__InputTagHelper.AliveProp =
#nullable restore
#line (9,45)-(9,46) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
!
#line default
#line hidden
#nullable disable
#nullable restore
#line (9,46)-(9,52) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
@alive
#line default
#line hidden
#nullable disable
;
__tagHelperExecutionContext.AddTagHelperAttribute("alive", __InputTagHelper.AliveProp, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => {
}
);
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.AgeProp =
#nullable restore
#line (10,13)-(10,18) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
(int)
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,18)-(10,26) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
@obj.age
#line default
#line hidden
#nullable disable
;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __InputTagHelper.AgeProp, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__InputTagHelper.TagProp =
#nullable restore
#line (10,33)-(10,36) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
new
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,36)-(10,38) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
{
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,38)-(10,39) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,39)-(10,46) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
@params
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,46)-(10,48) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
=
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,48)-(10,50) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
1
#line default
#line hidden
#nullable disable
#nullable restore
#line (10,50)-(10,52) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
}
#line default
#line hidden
#nullable disable
;
__tagHelperExecutionContext.AddTagHelperAttribute("tag", __InputTagHelper.TagProp, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => {
}
);
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
if (__InputTagHelper.DictionaryOfBoolAndStringTupleProperty == null)
{
throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("tuple-prefix-test", "InputTagHelper", "DictionaryOfBoolAndStringTupleProperty"));
}
__InputTagHelper.DictionaryOfBoolAndStringTupleProperty["test"] =
#nullable restore
#line (11,27)-(11,28) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
(
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,28)-(11,33) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
@item
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,33)-(11,34) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
.
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,34)-(11,69) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
Items.Where(i=>i.Contains("one")).
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,69)-(11,80) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
Count()>0,
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,80)-(11,81) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,81)-(11,86) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
@item
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,86)-(11,87) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
.
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,87)-(11,132) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
Items.FirstOrDefault(i=>i.Contains("one"))?.
#line default
#line hidden
#nullable disable
#nullable restore
#line (11,132)-(11,151) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml"
Replace("one",""))
#line default
#line hidden
#nullable disable
;
__tagHelperExecutionContext.AddTagHelperAttribute("tuple-prefix-test", __InputTagHelper.DictionaryOfBoolAndStringTupleProperty["test"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.SingleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{

Просмотреть файл

@ -8,16 +8,58 @@
MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync
HtmlContent - (33:1,0 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (33:1,0 [2] EscapedIdentifier.cshtml) - Html - \n
CSharpCode - (37:2,2 [24] EscapedIdentifier.cshtml)
LazyIntermediateToken - (37:2,2 [24] EscapedIdentifier.cshtml) - CSharp - \n var count = "1";\n
TagHelper - (64:5,0 [39] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
CSharpCode - (37:2,2 [163] EscapedIdentifier.cshtml)
LazyIntermediateToken - (37:2,2 [163] EscapedIdentifier.cshtml) - CSharp - \n var count = "1";\n var alive = true;\n var obj = new { age = (object)1 };\n var item = new { Items = new System.List<string>() { "one", "two" } };\n
TagHelper - (203:8,0 [55] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTagHelper
DefaultTagHelperProperty - (76:5,12 [23] EscapedIdentifier.cshtml) - age - int InputTagHelper.AgeProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (76:5,12 [16] EscapedIdentifier.cshtml) - CSharp - Convert.ToInt32(
CSharpExpression - (92:5,28 [6] EscapedIdentifier.cshtml)
LazyIntermediateToken - (92:5,28 [6] EscapedIdentifier.cshtml) - CSharp - @count
LazyIntermediateToken - (98:5,34 [1] EscapedIdentifier.cshtml) - CSharp - )
DefaultTagHelperProperty - (215:8,12 [23] EscapedIdentifier.cshtml) - age - int InputTagHelper.AgeProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (215:8,12 [16] EscapedIdentifier.cshtml) - CSharp - Convert.ToInt32(
CSharpExpression - (231:8,28 [6] EscapedIdentifier.cshtml)
LazyIntermediateToken - (231:8,28 [6] EscapedIdentifier.cshtml) - CSharp - @count
LazyIntermediateToken - (237:8,34 [1] EscapedIdentifier.cshtml) - CSharp - )
DefaultTagHelperProperty - (247:8,44 [7] EscapedIdentifier.cshtml) - alive - bool InputTagHelper.AliveProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (247:8,44 [1] EscapedIdentifier.cshtml) - CSharp - !
CSharpExpression - (248:8,45 [6] EscapedIdentifier.cshtml)
LazyIntermediateToken - (248:8,45 [6] EscapedIdentifier.cshtml) - CSharp - @alive
DefaultTagHelperExecute -
HtmlContent - (103:5,39 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (103:5,39 [2] EscapedIdentifier.cshtml) - Html - \n
HtmlContent - (258:8,55 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (258:8,55 [2] EscapedIdentifier.cshtml) - Html - \n
TagHelper - (260:9,0 [55] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTagHelper
DefaultTagHelperProperty - (272:9,12 [13] EscapedIdentifier.cshtml) - age - int InputTagHelper.AgeProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (272:9,12 [5] EscapedIdentifier.cshtml) - CSharp - (int)
CSharpExpression - (277:9,17 [8] EscapedIdentifier.cshtml)
LazyIntermediateToken - (277:9,17 [8] EscapedIdentifier.cshtml) - CSharp - @obj.age
DefaultTagHelperProperty - (292:9,32 [19] EscapedIdentifier.cshtml) - tag - object InputTagHelper.TagProp - HtmlAttributeValueStyle.DoubleQuotes
LazyIntermediateToken - (292:9,32 [3] EscapedIdentifier.cshtml) - CSharp - new
LazyIntermediateToken - (295:9,35 [2] EscapedIdentifier.cshtml) - CSharp - {
LazyIntermediateToken - (297:9,37 [1] EscapedIdentifier.cshtml) - CSharp -
CSharpExpression - (298:9,38 [7] EscapedIdentifier.cshtml)
LazyIntermediateToken - (298:9,38 [7] EscapedIdentifier.cshtml) - CSharp - @params
LazyIntermediateToken - (305:9,45 [2] EscapedIdentifier.cshtml) - CSharp - =
LazyIntermediateToken - (307:9,47 [2] EscapedIdentifier.cshtml) - CSharp - 1
LazyIntermediateToken - (309:9,49 [2] EscapedIdentifier.cshtml) - CSharp - }
DefaultTagHelperExecute -
HtmlContent - (315:9,55 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (315:9,55 [2] EscapedIdentifier.cshtml) - Html - \n
TagHelper - (317:10,0 [154] EscapedIdentifier.cshtml) - input - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTagHelper
DefaultTagHelperProperty - (343:10,26 [124] EscapedIdentifier.cshtml) - tuple-prefix-test - System.Collections.Generic.IDictionary<System.String, (System.Boolean, System.String)> InputTagHelper.DictionaryOfBoolAndStringTupleProperty - HtmlAttributeValueStyle.SingleQuotes
LazyIntermediateToken - (343:10,26 [1] EscapedIdentifier.cshtml) - CSharp - (
CSharpExpression - (344:10,27 [5] EscapedIdentifier.cshtml)
LazyIntermediateToken - (344:10,27 [5] EscapedIdentifier.cshtml) - CSharp - @item
LazyIntermediateToken - (349:10,32 [1] EscapedIdentifier.cshtml) - CSharp - .
LazyIntermediateToken - (350:10,33 [35] EscapedIdentifier.cshtml) - CSharp - Items.Where(i=>i.Contains("one")).
LazyIntermediateToken - (385:10,68 [11] EscapedIdentifier.cshtml) - CSharp - Count()>0,
LazyIntermediateToken - (396:10,79 [1] EscapedIdentifier.cshtml) - CSharp -
CSharpExpression - (397:10,80 [5] EscapedIdentifier.cshtml)
LazyIntermediateToken - (397:10,80 [5] EscapedIdentifier.cshtml) - CSharp - @item
LazyIntermediateToken - (402:10,85 [1] EscapedIdentifier.cshtml) - CSharp - .
LazyIntermediateToken - (403:10,86 [45] EscapedIdentifier.cshtml) - CSharp - Items.FirstOrDefault(i=>i.Contains("one"))?.
LazyIntermediateToken - (448:10,131 [19] EscapedIdentifier.cshtml) - CSharp - Replace("one",""))
DefaultTagHelperExecute -
HtmlContent - (471:10,154 [2] EscapedIdentifier.cshtml)
LazyIntermediateToken - (471:10,154 [2] EscapedIdentifier.cshtml) - Html - \n

Просмотреть файл

@ -0,0 +1,8 @@
Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [61] )
Transition span at (0:0,0 [1] ) - Parent: Statement block at (0:0,0 [31] )
MetaCode span at (1:0,1 [1] ) - Parent: Statement block at (0:0,0 [31] )
Code span at (2:0,2 [28] ) - Parent: Statement block at (0:0,0 [31] )
MetaCode span at (30:2,0 [1] ) - Parent: Statement block at (0:0,0 [31] )
Markup span at (31:2,1 [2] ) - Parent: Markup block at (0:0,0 [61] )
Code span at (48:3,15 [1] ) - Parent: Markup block at (48:3,15 [9] )
Code span at (49:3,16 [8] ) - Parent: Expression block at (49:3,16 [8] )

Просмотреть файл

@ -0,0 +1,61 @@
RazorDocument - [0..61)::61 - [@{ LF var isAlive = true;LF}LF<person alive="!@isAlive" />]
MarkupBlock - [0..61)::61
MarkupTextLiteral - [0..0)::0 - [] - Gen<Markup>
Marker;[];
CSharpCodeBlock - [0..31)::31
CSharpStatement - [0..31)::31
CSharpTransition - [0..1)::1 - Gen<None>
Transition;[@];
CSharpStatementBody - [1..31)::30
RazorMetaCode - [1..2)::1 - Gen<None>
LeftBrace;[{];
CSharpCodeBlock - [2..30)::28
CSharpStatementLiteral - [2..30)::28 - [ LF var isAlive = true;LF] - Gen<Stmt>
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
Identifier;[var];
Whitespace;[ ];
Identifier;[isAlive];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
Keyword;[true];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [30..31)::1 - Gen<None>
RightBrace;[}];
MarkupEphemeralTextLiteral - [31..33)::2 - [LF] - Gen<None>
NewLine;[LF];
MarkupTagHelperElement - [33..61)::28 - person[SelfClosing] - PersonTagHelper
MarkupTagHelperStartTag - [33..61)::28 - [<person alive="!@isAlive" />] - Gen<Markup>
OpenAngle;[<];
Text;[person];
MarkupTagHelperAttribute - [40..58)::18 - alive - DoubleQuotes - Bound - [ alive="!@isAlive"]
MarkupTextLiteral - [40..41)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
MarkupTextLiteral - [41..46)::5 - [alive] - Gen<Markup>
Text;[alive];
Equals;[=];
MarkupTextLiteral - [47..48)::1 - ["] - Gen<Markup>
DoubleQuote;["];
MarkupTagHelperAttributeValue - [48..57)::9
CSharpExpressionLiteral - [48..49)::1 - [!] - Gen<None>
Bang;[!];
MarkupBlock - [49..57)::8
CSharpCodeBlock - [49..57)::8
CSharpImplicitExpression - [49..57)::8
CSharpTransition - [49..49)::0
Transition;[<Missing>];
CSharpImplicitExpressionBody - [49..57)::8
CSharpCodeBlock - [49..57)::8
CSharpExpressionLiteral - [49..57)::8 - [@isAlive] - Gen<Expr>
Identifier;[@isAlive];
MarkupTextLiteral - [57..58)::1 - ["] - Gen<Markup>
DoubleQuote;["];
MarkupMiscAttributeContent - [58..59)::1
MarkupTextLiteral - [58..59)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
ForwardSlash;[/];
CloseAngle;[>];
EndOfFile;[];

Просмотреть файл

@ -0,0 +1 @@
TagHelper span at (33:3,0 [28] ) - PersonTagHelper

Просмотреть файл

@ -0,0 +1,8 @@
Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [80] )
Transition span at (0:0,0 [1] ) - Parent: Statement block at (0:0,0 [47] )
MetaCode span at (1:0,1 [1] ) - Parent: Statement block at (0:0,0 [47] )
Code span at (2:0,2 [44] ) - Parent: Statement block at (0:0,0 [47] )
MetaCode span at (46:2,0 [1] ) - Parent: Statement block at (0:0,0 [47] )
Markup span at (47:2,1 [2] ) - Parent: Markup block at (0:0,0 [80] )
Code span at (62:3,13 [5] ) - Parent: Markup block at (62:3,13 [14] )
Code span at (67:3,18 [9] ) - Parent: Expression block at (67:3,18 [9] )

Просмотреть файл

@ -0,0 +1,76 @@
RazorDocument - [0..80)::80 - [@{ LF var obj = new { Prop = (object)1 };LF}LF<person age="(int)@obj.Prop" />]
MarkupBlock - [0..80)::80
MarkupTextLiteral - [0..0)::0 - [] - Gen<Markup>
Marker;[];
CSharpCodeBlock - [0..47)::47
CSharpStatement - [0..47)::47
CSharpTransition - [0..1)::1 - Gen<None>
Transition;[@];
CSharpStatementBody - [1..47)::46
RazorMetaCode - [1..2)::1 - Gen<None>
LeftBrace;[{];
CSharpCodeBlock - [2..46)::44
CSharpStatementLiteral - [2..46)::44 - [ LF var obj = new { Prop = (object)1 };LF] - Gen<Stmt>
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
Identifier;[var];
Whitespace;[ ];
Identifier;[obj];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
Keyword;[new];
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
Identifier;[Prop];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
LeftParenthesis;[(];
Keyword;[object];
RightParenthesis;[)];
IntegerLiteral;[1];
Whitespace;[ ];
RightBrace;[}];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [46..47)::1 - Gen<None>
RightBrace;[}];
MarkupEphemeralTextLiteral - [47..49)::2 - [LF] - Gen<None>
NewLine;[LF];
MarkupTagHelperElement - [49..80)::31 - person[SelfClosing] - PersonTagHelper
MarkupTagHelperStartTag - [49..80)::31 - [<person age="(int)@obj.Prop" />] - Gen<Markup>
OpenAngle;[<];
Text;[person];
MarkupTagHelperAttribute - [56..77)::21 - age - DoubleQuotes - Bound - [ age="(int)@obj.Prop"]
MarkupTextLiteral - [56..57)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
MarkupTextLiteral - [57..60)::3 - [age] - Gen<Markup>
Text;[age];
Equals;[=];
MarkupTextLiteral - [61..62)::1 - ["] - Gen<Markup>
DoubleQuote;["];
MarkupTagHelperAttributeValue - [62..76)::14
CSharpExpressionLiteral - [62..67)::5 - [(int)] - Gen<None>
Text;[(int)];
MarkupBlock - [67..76)::9
CSharpCodeBlock - [67..76)::9
CSharpImplicitExpression - [67..76)::9
CSharpTransition - [67..67)::0
Transition;[<Missing>];
CSharpImplicitExpressionBody - [67..76)::9
CSharpCodeBlock - [67..76)::9
CSharpExpressionLiteral - [67..76)::9 - [@obj.Prop] - Gen<Expr>
Identifier;[@obj];
Dot;[.];
Identifier;[Prop];
MarkupTextLiteral - [76..77)::1 - ["] - Gen<Markup>
DoubleQuote;["];
MarkupMiscAttributeContent - [77..78)::1
MarkupTextLiteral - [77..78)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
ForwardSlash;[/];
CloseAngle;[>];
EndOfFile;[];

Просмотреть файл

@ -0,0 +1 @@
TagHelper span at (49:3,0 [31] ) - PersonTagHelper

Просмотреть файл

@ -0,0 +1,13 @@
Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [85] )
Transition span at (0:0,0 [1] ) - Parent: Statement block at (0:0,0 [47] )
MetaCode span at (1:0,1 [1] ) - Parent: Statement block at (0:0,0 [47] )
Code span at (2:0,2 [44] ) - Parent: Statement block at (0:0,0 [47] )
MetaCode span at (46:2,0 [1] ) - Parent: Statement block at (0:0,0 [47] )
Markup span at (47:2,1 [2] ) - Parent: Markup block at (0:0,0 [85] )
Code span at (62:3,13 [3] ) - Parent: Markup block at (62:3,13 [19] )
Code span at (65:3,16 [2] ) - Parent: Markup block at (62:3,13 [19] )
Code span at (67:3,18 [1] ) - Parent: Markup block at (67:3,18 [8] )
Code span at (68:3,19 [7] ) - Parent: Expression block at (68:3,19 [7] )
Code span at (75:3,26 [2] ) - Parent: Markup block at (62:3,13 [19] )
Code span at (77:3,28 [2] ) - Parent: Markup block at (62:3,13 [19] )
Code span at (79:3,30 [2] ) - Parent: Markup block at (62:3,13 [19] )

Просмотреть файл

@ -0,0 +1,88 @@
RazorDocument - [0..85)::85 - [@{ LF var obj = new { Prop = (object)1 };LF}LF<person tag="new { @params = 1 }" />]
MarkupBlock - [0..85)::85
MarkupTextLiteral - [0..0)::0 - [] - Gen<Markup>
Marker;[];
CSharpCodeBlock - [0..47)::47
CSharpStatement - [0..47)::47
CSharpTransition - [0..1)::1 - Gen<None>
Transition;[@];
CSharpStatementBody - [1..47)::46
RazorMetaCode - [1..2)::1 - Gen<None>
LeftBrace;[{];
CSharpCodeBlock - [2..46)::44
CSharpStatementLiteral - [2..46)::44 - [ LF var obj = new { Prop = (object)1 };LF] - Gen<Stmt>
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
Identifier;[var];
Whitespace;[ ];
Identifier;[obj];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
Keyword;[new];
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
Identifier;[Prop];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
LeftParenthesis;[(];
Keyword;[object];
RightParenthesis;[)];
IntegerLiteral;[1];
Whitespace;[ ];
RightBrace;[}];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [46..47)::1 - Gen<None>
RightBrace;[}];
MarkupEphemeralTextLiteral - [47..49)::2 - [LF] - Gen<None>
NewLine;[LF];
MarkupTagHelperElement - [49..85)::36 - person[SelfClosing] - PersonTagHelper
MarkupTagHelperStartTag - [49..85)::36 - [<person tag="new { @params = 1 }" />] - Gen<Markup>
OpenAngle;[<];
Text;[person];
MarkupTagHelperAttribute - [56..82)::26 - tag - DoubleQuotes - Bound - [ tag="new { @params = 1 }"]
MarkupTextLiteral - [56..57)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
MarkupTextLiteral - [57..60)::3 - [tag] - Gen<Markup>
Text;[tag];
Equals;[=];
MarkupTextLiteral - [61..62)::1 - ["] - Gen<Markup>
DoubleQuote;["];
MarkupTagHelperAttributeValue - [62..81)::19
CSharpExpressionLiteral - [62..65)::3 - [new] - Gen<None>
Text;[new];
CSharpExpressionLiteral - [65..67)::2 - [ {] - Gen<None>
Whitespace;[ ];
Text;[{];
MarkupBlock - [67..75)::8
CSharpExpressionLiteral - [67..68)::1 - [ ] - Gen<Expr>
Whitespace;[ ];
CSharpCodeBlock - [68..75)::7
CSharpImplicitExpression - [68..75)::7
CSharpTransition - [68..68)::0
Transition;[<Missing>];
CSharpImplicitExpressionBody - [68..75)::7
CSharpCodeBlock - [68..75)::7
CSharpExpressionLiteral - [68..75)::7 - [@params] - Gen<Expr>
Keyword;[@params];
CSharpExpressionLiteral - [75..77)::2 - [ =] - Gen<None>
Whitespace;[ ];
Equals;[=];
CSharpExpressionLiteral - [77..79)::2 - [ 1] - Gen<None>
Whitespace;[ ];
Text;[1];
CSharpExpressionLiteral - [79..81)::2 - [ }] - Gen<None>
Whitespace;[ ];
Text;[}];
MarkupTextLiteral - [81..82)::1 - ["] - Gen<Markup>
DoubleQuote;["];
MarkupMiscAttributeContent - [82..83)::1
MarkupTextLiteral - [82..83)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
ForwardSlash;[/];
CloseAngle;[>];
EndOfFile;[];

Просмотреть файл

@ -0,0 +1 @@
TagHelper span at (49:3,0 [36] ) - PersonTagHelper

Просмотреть файл

@ -0,0 +1,16 @@
Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [238] )
Transition span at (0:0,0 [1] ) - Parent: Statement block at (0:0,0 [82] )
MetaCode span at (1:0,1 [1] ) - Parent: Statement block at (0:0,0 [82] )
Code span at (2:0,2 [79] ) - Parent: Statement block at (0:0,0 [82] )
MetaCode span at (81:2,0 [1] ) - Parent: Statement block at (0:0,0 [82] )
Markup span at (82:2,1 [2] ) - Parent: Markup block at (0:0,0 [238] )
Code span at (110:3,26 [1] ) - Parent: Markup block at (110:3,26 [124] )
Code span at (111:3,27 [5] ) - Parent: Expression block at (111:3,27 [5] )
Code span at (116:3,32 [1] ) - Parent: Markup block at (110:3,26 [124] )
Code span at (117:3,33 [35] ) - Parent: Markup block at (110:3,26 [124] )
Code span at (152:3,68 [11] ) - Parent: Markup block at (110:3,26 [124] )
Code span at (163:3,79 [1] ) - Parent: Markup block at (163:3,79 [6] )
Code span at (164:3,80 [5] ) - Parent: Expression block at (164:3,80 [5] )
Code span at (169:3,85 [1] ) - Parent: Markup block at (110:3,26 [124] )
Code span at (170:3,86 [45] ) - Parent: Markup block at (110:3,26 [124] )
Code span at (215:3,131 [19] ) - Parent: Markup block at (110:3,26 [124] )

Просмотреть файл

@ -0,0 +1,141 @@
RazorDocument - [0..238)::238 - [@{ LF var item = new { Items = new System.List<string>() { "one", "two" } };LF}LF<input tuple-prefix-test='(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))' />]
MarkupBlock - [0..238)::238
MarkupTextLiteral - [0..0)::0 - [] - Gen<Markup>
Marker;[];
CSharpCodeBlock - [0..82)::82
CSharpStatement - [0..82)::82
CSharpTransition - [0..1)::1 - Gen<None>
Transition;[@];
CSharpStatementBody - [1..82)::81
RazorMetaCode - [1..2)::1 - Gen<None>
LeftBrace;[{];
CSharpCodeBlock - [2..81)::79
CSharpStatementLiteral - [2..81)::79 - [ LF var item = new { Items = new System.List<string>() { "one", "two" } };LF] - Gen<Stmt>
Whitespace;[ ];
NewLine;[LF];
Whitespace;[ ];
Identifier;[var];
Whitespace;[ ];
Identifier;[item];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
Keyword;[new];
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
Identifier;[Items];
Whitespace;[ ];
Assign;[=];
Whitespace;[ ];
Keyword;[new];
Whitespace;[ ];
Identifier;[System];
Dot;[.];
Identifier;[List];
LessThan;[<];
Keyword;[string];
GreaterThan;[>];
LeftParenthesis;[(];
RightParenthesis;[)];
Whitespace;[ ];
LeftBrace;[{];
Whitespace;[ ];
StringLiteral;["one"];
Comma;[,];
Whitespace;[ ];
StringLiteral;["two"];
Whitespace;[ ];
RightBrace;[}];
Whitespace;[ ];
RightBrace;[}];
Semicolon;[;];
NewLine;[LF];
RazorMetaCode - [81..82)::1 - Gen<None>
RightBrace;[}];
MarkupEphemeralTextLiteral - [82..84)::2 - [LF] - Gen<None>
NewLine;[LF];
MarkupTagHelperElement - [84..238)::154 - input[SelfClosing] - InputTagHelper
MarkupTagHelperStartTag - [84..238)::154 - [<input tuple-prefix-test='(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))' />] - Gen<Markup>
OpenAngle;[<];
Text;[input];
MarkupTagHelperAttribute - [90..235)::145 - tuple-prefix-test - SingleQuotes - Bound - [ tuple-prefix-test='(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))']
MarkupTextLiteral - [90..91)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
MarkupTextLiteral - [91..108)::17 - [tuple-prefix-test] - Gen<Markup>
Text;[tuple-prefix-test];
Equals;[=];
MarkupTextLiteral - [109..110)::1 - ['] - Gen<Markup>
SingleQuote;['];
MarkupTagHelperAttributeValue - [110..234)::124
CSharpExpressionLiteral - [110..111)::1 - [(] - Gen<None>
Text;[(];
MarkupBlock - [111..116)::5
CSharpCodeBlock - [111..116)::5
CSharpImplicitExpression - [111..116)::5
CSharpTransition - [111..111)::0
Transition;[<Missing>];
CSharpImplicitExpressionBody - [111..116)::5
CSharpCodeBlock - [111..116)::5
CSharpExpressionLiteral - [111..116)::5 - [@item] - Gen<Expr>
Identifier;[@item];
CSharpExpressionLiteral - [116..117)::1 - [.] - Gen<None>
Text;[.];
CSharpExpressionLiteral - [117..152)::35 - [ Items.Where(i=>i.Contains("one")).] - Gen<None>
Whitespace;[ ];
Text;[Items.Where(i];
Equals;[=];
CloseAngle;[>];
Text;[i.Contains(];
DoubleQuote;["];
Text;[one];
DoubleQuote;["];
Text;[)).];
CSharpExpressionLiteral - [152..163)::11 - [ Count()>0,] - Gen<None>
Whitespace;[ ];
Text;[Count()];
CloseAngle;[>];
Text;[0,];
MarkupBlock - [163..169)::6
CSharpExpressionLiteral - [163..164)::1 - [ ] - Gen<Expr>
Whitespace;[ ];
CSharpCodeBlock - [164..169)::5
CSharpImplicitExpression - [164..169)::5
CSharpTransition - [164..164)::0
Transition;[<Missing>];
CSharpImplicitExpressionBody - [164..169)::5
CSharpCodeBlock - [164..169)::5
CSharpExpressionLiteral - [164..169)::5 - [@item] - Gen<Expr>
Identifier;[@item];
CSharpExpressionLiteral - [169..170)::1 - [.] - Gen<None>
Text;[.];
CSharpExpressionLiteral - [170..215)::45 - [ Items.FirstOrDefault(i=>i.Contains("one"))?.] - Gen<None>
Whitespace;[ ];
Text;[Items.FirstOrDefault(i];
Equals;[=];
CloseAngle;[>];
Text;[i.Contains(];
DoubleQuote;["];
Text;[one];
DoubleQuote;["];
Text;[))];
QuestionMark;[?];
Text;[.];
CSharpExpressionLiteral - [215..234)::19 - [ Replace("one",""))] - Gen<None>
Whitespace;[ ];
Text;[Replace(];
DoubleQuote;["];
Text;[one];
DoubleQuote;["];
Text;[,];
DoubleQuote;["];
DoubleQuote;["];
Text;[))];
MarkupTextLiteral - [234..235)::1 - ['] - Gen<Markup>
SingleQuote;['];
MarkupMiscAttributeContent - [235..236)::1
MarkupTextLiteral - [235..236)::1 - [ ] - Gen<Markup>
Whitespace;[ ];
ForwardSlash;[/];
CloseAngle;[>];
EndOfFile;[];

Просмотреть файл

@ -0,0 +1 @@
TagHelper span at (84:3,0 [154] ) - InputTagHelper