Esempio n. 1
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);
     }
 }
Esempio 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);
     }
 }
Esempio n. 3
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());
         }
     }
 }