1 // =================================
 2 // Copyright (c) 2025 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 using System;
 7 
 8 namespace System.Xml
 9 {
10     public class Text : CharacterData
11     {
12         public Text(const System.Lex.Span& span_, int fileIndex_) : this(NodeKind.textNode, span_, fileIndex_, "text")
13         {
14         }
15         public Text(const System.Lex.Span& span_, int fileIndex_, const string& text_) : base(NodeKind.textNode, span_, -1, "text", text_)
16         {
17         }
18         public Text(NodeKind kind_, const System.Lex.Span& span_, int fileIndex_, const string& name_) : base(kind_, span_, fileIndex_, name_)
19         {
20         }
21         public Text(NodeKind kind_, const System.Lex.Span& span_, int fileIndex_, const string& name_, const string& text_) : base(kind_, span_, fileIndex_, name_, text_)
22         {
23         }
24         public override void Accept(Visitor& visitor)
25         {
26             visitor.Visit(*this);
27         }
28         public override Node* Clone(bool deep) const
29         {
30             return new Text(Span(), FileIndex(), Data());
31         }
32     }
33 
34     public Text* MakeText(const string& text)
35     {
36         return new Text(System.Lex.Span(), -1, text);
37     }
38 }