Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TextAction.cs
Go to the documentation of this file.
2
4
5internal class TextAction : CompiledAction
6{
8
9 private string _text;
10
11 internal override void Compile(Compiler compiler)
12 {
15 }
16
17 internal override bool CompileAttribute(Compiler compiler)
18 {
19 string localName = compiler.Input.LocalName;
20 string value = compiler.Input.Value;
21 if (Ref.Equal(localName, compiler.Atoms.DisableOutputEscaping))
22 {
24 return true;
25 }
26 return false;
27 }
28
30 {
31 if (!compiler.Recurse())
32 {
33 return;
34 }
36 _text = string.Empty;
37 do
38 {
39 switch (input.NodeType)
40 {
41 case XPathNodeType.Text:
42 case XPathNodeType.SignificantWhitespace:
43 case XPathNodeType.Whitespace:
44 _text += input.Value;
45 break;
46 default:
47 throw compiler.UnexpectedKeyword();
48 case XPathNodeType.ProcessingInstruction:
49 case XPathNodeType.Comment:
50 break;
51 }
52 }
53 while (compiler.Advance());
54 compiler.ToParent();
55 }
56
57 internal override void Execute(Processor processor, ActionFrame frame)
58 {
59 if (frame.State == 0 && processor.TextEvent(_text, _disableOutputEscaping))
60 {
61 frame.Finished();
62 }
63 }
64}
static bool Equal(string strA, string strB)
Definition Ref.cs:5
void CompileAttributes(Compiler compiler)
void CompileContent(Compiler compiler)
Definition TextAction.cs:29
override void Execute(Processor processor, ActionFrame frame)
Definition TextAction.cs:57
override bool CompileAttribute(Compiler compiler)
Definition TextAction.cs:17
override void Compile(Compiler compiler)
Definition TextAction.cs:11