Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
ChooseAction.cs
Go to the documentation of this file.
2
4
5internal sealed class ChooseAction : ContainerAction
6{
7 internal override void Compile(Compiler compiler)
8 {
10 if (compiler.Recurse())
11 {
13 compiler.ToParent();
14 }
15 }
16
18 {
20 bool flag = false;
21 bool flag2 = false;
22 do
23 {
24 switch (input.NodeType)
25 {
26 case XPathNodeType.Element:
27 {
28 compiler.PushNamespaceScope();
30 string localName = input.LocalName;
31 if (Ref.Equal(namespaceURI, input.Atoms.UriXsl))
32 {
33 IfAction ifAction = null;
34 if (Ref.Equal(localName, input.Atoms.When))
35 {
36 if (flag2)
37 {
39 }
40 ifAction = compiler.CreateIfAction(IfAction.ConditionType.ConditionWhen);
41 flag = true;
42 }
43 else
44 {
45 if (!Ref.Equal(localName, input.Atoms.Otherwise))
46 {
47 throw compiler.UnexpectedKeyword();
48 }
49 if (flag2)
50 {
52 }
53 ifAction = compiler.CreateIfAction(IfAction.ConditionType.ConditionOtherwise);
54 flag2 = true;
55 }
57 compiler.PopScope();
58 break;
59 }
60 throw compiler.UnexpectedKeyword();
61 }
62 default:
64 case XPathNodeType.SignificantWhitespace:
65 case XPathNodeType.Whitespace:
66 case XPathNodeType.ProcessingInstruction:
67 case XPathNodeType.Comment:
68 break;
69 }
70 }
71 while (compiler.Advance());
72 if (!flag)
73 {
75 }
76 }
77}
static string Xslt_InvalidContents
Definition SR.cs:2076
static string Xslt_DupOtherwise
Definition SR.cs:1966
static string Xslt_NoWhen
Definition SR.cs:1962
static string Xslt_WhenAfterOtherwise
Definition SR.cs:1964
Definition SR.cs:7
static bool Equal(string strA, string strB)
Definition Ref.cs:5
static XsltException Create(string res, params string[] args)
override void Compile(Compiler compiler)
void CompileConditions(Compiler compiler)
void CompileAttributes(Compiler compiler)