Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompileConditions()

void System.Xml.Xsl.XsltOld.ChooseAction.CompileConditions ( Compiler compiler)
inlineprivate

Definition at line 17 of file ChooseAction.cs.

18 {
19 NavigatorInput input = compiler.Input;
20 bool flag = false;
21 bool flag2 = false;
22 do
23 {
24 switch (input.NodeType)
25 {
26 case XPathNodeType.Element:
27 {
28 compiler.PushNamespaceScope();
29 string namespaceURI = input.NamespaceURI;
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 {
38 throw XsltException.Create(System.SR.Xslt_WhenAfterOtherwise);
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 {
51 throw XsltException.Create(System.SR.Xslt_DupOtherwise);
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:
63 throw XsltException.Create(System.SR.Xslt_InvalidContents, "choose");
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 {
74 throw XsltException.Create(System.SR.Xslt_NoWhen);
75 }
76 }
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

References System.Xml.Xsl.XsltOld.ContainerAction.AddAction(), System.Xml.Xsl.XsltException.Create(), System.Xml.Dictionary, System.Xml.Ref.Equal(), System.input, System.Xml.Xsl.XsltOld.NavigatorInput.NamespaceURI, System.SR.Xslt_DupOtherwise, System.SR.Xslt_InvalidContents, System.SR.Xslt_NoWhen, and System.SR.Xslt_WhenAfterOtherwise.

Referenced by System.Xml.Xsl.XsltOld.ChooseAction.Compile().