Esempio n. 1
0
 public override void VisitTagHelperPrefixDirectiveSpan(TagHelperPrefixDirectiveChunkGenerator chunkGenerator, Span span)
 {
     if (!string.IsNullOrEmpty(chunkGenerator.DirectiveText))
     {
         // We only expect to see a single one of these per file, but that's enforced at another level.
         TagHelperPrefix = chunkGenerator.DirectiveText;
     }
 }
            public override void VisitTagHelperPrefixDirectiveSpan(TagHelperPrefixDirectiveChunkGenerator chunkGenerator, Span span)
            {
                IntermediateNode directiveNode;

                if (IsMalformed(chunkGenerator.Diagnostics))
                {
                    directiveNode = new MalformedDirectiveIntermediateNode()
                    {
                        DirectiveName = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Directive,
                        Directive     = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor,
                        Source        = BuildSourceSpanFromNode(span),
                    };
                }
                else
                {
                    directiveNode = new DirectiveIntermediateNode()
                    {
                        DirectiveName = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Directive,
                        Directive     = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor,
                        Source        = BuildSourceSpanFromNode(span),
                    };
                }

                for (var i = 0; i < chunkGenerator.Diagnostics.Count; i++)
                {
                    directiveNode.Diagnostics.Add(chunkGenerator.Diagnostics[i]);
                }

                _builder.Push(directiveNode);

                _builder.Add(new DirectiveTokenIntermediateNode()
                {
                    Content        = chunkGenerator.Prefix,
                    DirectiveToken = CSharpCodeParser.TagHelperPrefixDirectiveDescriptor.Tokens.First(),
                    Source         = BuildSourceSpanFromNode(span),
                });

                _builder.Pop();
            }
Esempio n. 3
0
 public virtual void VisitTagHelperPrefixDirectiveSpan(TagHelperPrefixDirectiveChunkGenerator chunkGenerator, Span span)
 {
     VisitDefault(span);
 }
            public override void VisitTagHelperPrefixDirectiveSpan(TagHelperPrefixDirectiveChunkGenerator chunkGenerator, Span span)
            {
                var directive = CreateDirective(span, chunkGenerator.Prefix, TagHelperDirectiveType.TagHelperPrefix, chunkGenerator.Diagnostics);

                Directives.Add(directive);
            }