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

◆ InvokeApplyFunction()

QilNode System.Xml.Xsl.Xslt.QilGenerator.InvokeApplyFunction ( StylesheetLevel sheet,
QilName mode,
IList< XslNode > actualArgs )
inlineprivate

Definition at line 2061 of file QilGenerator.cs.

2062 {
2063 if (!sheet.ModeFlags.TryGetValue(mode, out var value))
2064 {
2065 value = XslFlags.None;
2066 }
2067 value |= XslFlags.Current;
2070 QilFunction qilFunction = null;
2071 if (!sheet.ApplyFunctions.TryGetValue(mode, out var value2))
2072 {
2073 List<QilFunction> list2 = (sheet.ApplyFunctions[mode] = new List<QilFunction>());
2074 value2 = list2;
2075 }
2076 foreach (QilFunction item in value2)
2077 {
2078 if (FillupInvokeArgs(item.Arguments, actualArgs, qilList))
2079 {
2080 qilFunction = item;
2081 break;
2082 }
2083 }
2084 if (qilFunction == null)
2085 {
2086 qilList.Clear();
2088 for (int i = 0; i < actualArgs.Count; i++)
2089 {
2090 VarPar varPar = (VarPar)actualArgs[i];
2091 qilList.Add(varPar.Value);
2096 }
2097 qilFunction = _f.Function(qilList2, _f.Boolean((value & XslFlags.SideEffects) != 0), XmlQueryTypeFactory.NodeNotRtfS);
2098 string text = ((mode.LocalName.Length == 0) ? string.Empty : (" mode=\"" + mode.QualifiedName + "\""));
2099 qilFunction.DebugName = ((sheet is RootLevel) ? "<xsl:apply-templates" : "<xsl:apply-imports") + text + ">";
2104 QilNode qilNode = _f.Filter(qilIterator2, _f.IsType(qilIterator2, XmlQueryTypeFactory.Content));
2105 qilNode.XmlType = XmlQueryTypeFactory.ContentS;
2106 LoopFocus curLoop = _curLoop;
2109 if (IsDebug)
2110 {
2112 }
2114 _curLoop = curLoop;
2118 }
2119 return _f.Invoke(qilFunction, qilList);
2120 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void Add(TKey key, TValue value)
QilTernary Conditional(QilNode left, QilNode center, QilNode right)
virtual void Add(QilNode node)
Definition QilNode.cs:121
QilIterator For(QilNode binding)
QilNode Filter(QilIterator variable, QilNode expr)
QilNode IsType(QilNode expr, XmlQueryType t)
QilNode Invoke(QilFunction func, QilList args)
QilNode Conditional(QilNode condition, QilNode trueBranch, QilNode falseBranch)
QilParameter Parameter(XmlQueryType t)
QilFunction Function(QilList args, QilNode sideEffects, XmlQueryType resultType)
QilNode BuildMatcher(QilIterator it, IList< XslNode > actualArgs, QilNode otherwise)
void CollectPatterns(StylesheetLevel sheet, QilName mode)
QilNode InvokeApplyFunction(StylesheetLevel sheet, QilName mode, IList< XslNode > actualArgs)
readonly XsltQilFactory _f
readonly MatcherBuilder _matcherBuilder
QilName CloneName(QilName name)
bool FillupInvokeArgs(IList< QilNode > formalArgs, IList< XslNode > actualArgs, QilList invokeArgs)
readonly XmlQueryType _elementOrDocumentType
readonly XmlQueryType _textOrAttributeType
IList< XslNode > AddRemoveImplicitArgs(IList< XslNode > args, XslFlags flags)
void SetFocus(QilIterator current)
Definition LoopFocus.cs:24
QilLoop ConstructLoop(QilNode body)
Definition LoopFocus.cs:67

References System.Xml.Xsl.Xslt.QilGenerator._compiler, System.Xml.Xsl.Xslt.QilGenerator._curLoop, System.Xml.Xsl.Xslt.QilGenerator._elementOrDocumentType, System.Xml.Xsl.Xslt.QilGenerator._f, System.Xml.Xsl.Xslt.QilGenerator._functions, System.Xml.Xsl.Xslt.QilGenerator._matcherBuilder, System.Xml.Xsl.Xslt.QilGenerator._textOrAttributeType, System.Xml.Xsl.Qil.QilPatternFactory.ActualParameterList(), System.Xml.Xsl.Qil.QilNode.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Xsl.Xslt.QilGenerator.AddRemoveImplicitArgs(), System.Xml.Xsl.Qil.QilPatternFactory.BaseFactory, System.Xml.Xsl.Qil.QilPatternFactory.Boolean(), System.Xml.Xsl.Xslt.MatcherBuilder.BuildMatcher(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Xml.Xsl.Xslt.QilGenerator.CloneName(), System.Xml.Xsl.Xslt.MatcherBuilder.CollectPatterns(), System.Xml.Xsl.Qil.QilPatternFactory.Conditional(), System.Xml.Xsl.Qil.QilFactory.Conditional(), System.Xml.Xsl.Xslt.LoopFocus.ConstructLoop(), System.Xml.Xsl.Qil.QilPatternFactory.Content(), System.Xml.Xsl.XmlQueryTypeFactory.Content, System.Xml.Xsl.XmlQueryTypeFactory.ContentS, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Xsl.Xslt.QilGenerator.FillupInvokeArgs(), System.Xml.Xsl.Qil.QilPatternFactory.Filter(), System.Xml.Xsl.Qil.QilPatternFactory.For(), System.Xml.Xsl.Qil.QilPatternFactory.FormalParameterList(), System.Xml.Xsl.Qil.QilPatternFactory.Function(), System.Xml.Xsl.Qil.QilPatternFactory.Invoke(), System.Xml.Xsl.Xslt.QilGenerator.InvokeApplyFunction(), System.Xml.Xsl.Xslt.QilGenerator.InvokeOnCurrentNodeChanged(), System.Xml.Xsl.Xslt.QilGenerator.IsDebug, System.Xml.Xsl.Qil.QilPatternFactory.IsType(), System.item, System.Xml.Xsl.XmlQueryTypeFactory.NodeNotRtfS, System.Xml.Xsl.Qil.QilPatternFactory.Parameter(), System.Xml.Xsl.Xslt.Compiler.Root, System.Xml.Xsl.Qil.QilPatternFactory.Sequence(), System.Xml.Xsl.Xslt.LoopFocus.SetFocus(), System.text, System.Xml.Xsl.Qil.QilPatternFactory.TextCtor(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), System.value, and System.Xml.Xsl.Qil.QilPatternFactory.XPathNodeValue().

Referenced by System.Xml.Xsl.Xslt.QilGenerator.GenerateApply(), and System.Xml.Xsl.Xslt.QilGenerator.InvokeApplyFunction().