Пример #1
0
 public void ParseBlockWithNestedCodeBlockProducesError()
 {
     ParseBlockTest("@if { @{} }",
                    new StatementBlock(
                        Factory.CodeTransition(),
                        Factory.Code("if { ")
                        .AsStatement()
                        .Accepts(AcceptedCharactersInternal.Any),
                        new StatementBlock(
                            Factory.CodeTransition(),
                            Factory.MetaCode("{").Accepts(AcceptedCharactersInternal.None),
                            Factory.EmptyCSharp()
                            .AsStatement()
                            .AutoCompleteWith(autoCompleteString: null),
                            Factory.MetaCode("}").Accepts(AcceptedCharactersInternal.None)),
                        Factory.Code(" }")
                        .AsStatement()
                        .Accepts(AcceptedCharactersInternal.Any)),
                    RazorDiagnosticFactory.CreateParsing_UnexpectedNestedCodeBlock(
                        new SourceSpan(new SourceLocation(7, 0, 7), contentLength: 1)));
 }