Exemplo n.º 1
0
 public override void CreateSyntax(Tree.Component owner, MarkdownLexer.Token reference, CreateSyntaxResult result)
 {
     if (reference is MarkdownLexer.NewLine)
     {
         new NewLine(owner, reference, reference);
     }
 }
Exemplo n.º 2
0
 public override void CreateSyntax(Tree.Component owner, Tree.Syntax reference, CreateSyntaxResult result)
 {
     if (reference is MarkdownLexer.FileText referenceFileText)
     {
         var page = new Page((Document)owner, referenceFileText);
         result.CreateSyntaxTree(page, reference.NextAll);
     }
 }
Exemplo n.º 3
0
 public override void CreateSyntax(Tree.Component owner, Tree.Syntax reference, CreateSyntaxResult result)
 {
     if (reference is Storage.FileText referenceFileText)
     {
         var fileText = new FileText((Document)owner, referenceFileText);
         result.CreateSyntaxTree(fileText, reference.NextAll);
     }
 }
Exemplo n.º 4
0
 public override void CreateSyntax(Tree.Component owner, MarkdownLexer.Token reference, CreateSyntaxResult result)
 {
     if (owner.Last is Content content)
     {
         content.Remove();
         new Content(owner, content.ReferenceBegin, reference);
     }
     else
     {
         new Content(owner, reference, reference);
     }
 }
Exemplo n.º 5
0
 public override void CreateSyntax(Tree.Component owner, MarkdownLexer.Token reference, CreateSyntaxResult result)
 {
     if (reference is MarkdownLexer.Header tokenHeader)
     {
         // Previous
         bool isNull    = tokenHeader.Previous == null;
         bool isSpace   = tokenHeader.Previous is MarkdownLexer.Space && (tokenHeader.Previous.Previous == null || tokenHeader.Previous.Previous is MarkdownLexer.NewLine);
         bool isNewLine = tokenHeader.Previous is MarkdownLexer.NewLine;
         if (isNull || isSpace || isNewLine)
         {
             var header = new Header(owner, reference);
             result.CreateSyntaxTree(header, reference.Next, SyntaxFactoryStopList());
         }
     }
 }
Exemplo n.º 6
0
 public override void CreateSyntax(Tree.Component owner, MarkdownLexer.Token reference, CreateSyntaxResult result)
 {
     if (reference is MarkdownLexer.Comment comment && comment.IsEnd == false)
     {
         MarkdownLexer.Token referenceNext = reference;
         while ((referenceNext = referenceNext.Next) != null)
         {
             if (referenceNext is MarkdownLexer.Comment commentNext && commentNext.IsEnd)
             {
                 new Comment(owner, reference, referenceNext);
                 break;
             }
         }
     }
 }
Exemplo n.º 7
0
 public override void CreateSyntax(Tree.Component owner, MarkdownLexer.Token reference, CreateSyntaxResult result)
 {
     if (reference is MarkdownLexer.Special specialOpen && specialOpen.Text == "[")
     {
         if (reference.Next is MarkdownLexer.Content contentLinkUrl)
         {
             if (reference.Next?.Next is MarkdownLexer.Special specialClose && specialClose.Text == "]")
             {
                 if (reference.Next?.Next?.Next is MarkdownLexer.Special specialOpen2 && specialOpen2.Text == "(")
                 {
                     if (reference.Next?.Next?.Next?.Next is MarkdownLexer.Content contentLinkText)
                     {
                         if (reference.Next?.Next?.Next?.Next?.Next is MarkdownLexer.Special specialClose2 && specialClose2.Text == ")")
                         {
                             new Link(owner, reference, specialClose2, LinkUrl, LinkText);
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 8
0
 public Comment(Tree.Component owner, MarkdownLexer.Token referenceBegin, MarkdownLexer.Token referenceEnd)
     : base(owner, referenceBegin, referenceEnd)
 {
 }
Exemplo n.º 9
0
 public virtual void CreateSyntax(Tree.Component owner, MarkdownLexer.Token reference, CreateSyntaxResult result)
 {
 }
Exemplo n.º 10
0
 public override void CreateSyntax(Tree.Component owner, Tree.Syntax reference, CreateSyntaxResult result)
 {
     CreateSyntax(owner, (MarkdownLexer.Token)reference, result);
 }
Exemplo n.º 11
0
 public Node(Tree.Component owner, MarkdownLexer.Token reference)
     : base(owner, reference)
 {
 }
Exemplo n.º 12
0
 public override void CreateSyntax(Tree.Component owner, Tree.Syntax reference, CreateSyntaxResult result)
 {
     CreateSyntax((FileText)owner, (Storage.Character)reference, result);
 }
Exemplo n.º 13
0
 public Link(Tree.Component owner, MarkdownLexer.Token referenceBegin, MarkdownLexer.Token referenceEnd, MarkdownLexer.Content linkUrl, MarkdownLexer.Content linkText)
     : base(owner, referenceBegin, referenceEnd)
 {
     LinkUrl  = linkUrl;
     LinkText = linkText;
 }