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

◆ ParseIdKeyPattern()

AstNode MS.Internal.Xml.XPath.XPathParser.ParseIdKeyPattern ( )
inlineprivate

Definition at line 610 of file XPathParser.cs.

611 {
613 if (_scanner.Prefix.Length == 0)
614 {
615 if (_scanner.Name == "id")
616 {
617 ParamInfo paramInfo = s_functionTable["id"];
618 NextLex();
619 PassToken(XPathScanner.LexKind.LParens);
620 CheckToken(XPathScanner.LexKind.String);
621 list.Add(new Operand(_scanner.StringValue));
622 NextLex();
623 PassToken(XPathScanner.LexKind.RParens);
624 return new Function(paramInfo.FType, list);
625 }
626 if (_scanner.Name == "key")
627 {
628 NextLex();
629 PassToken(XPathScanner.LexKind.LParens);
630 CheckToken(XPathScanner.LexKind.String);
631 list.Add(new Operand(_scanner.StringValue));
632 NextLex();
633 PassToken(XPathScanner.LexKind.Comma);
634 CheckToken(XPathScanner.LexKind.String);
635 list.Add(new Operand(_scanner.StringValue));
636 NextLex();
637 PassToken(XPathScanner.LexKind.RParens);
638 return new Function("", "key", list);
639 }
640 }
641 return null;
642 }
static readonly Dictionary< string, ParamInfo > s_functionTable
void PassToken(XPathScanner.LexKind t)
void CheckToken(XPathScanner.LexKind t)

References MS.Internal.Xml.XPath.XPathParser._scanner, MS.Internal.Xml.XPath.XPathParser.CheckToken(), System.list, MS.Internal.Xml.XPath.XPathScanner.Name, MS.Internal.Xml.XPath.XPathParser.NextLex(), MS.Internal.Xml.XPath.XPathParser.PassToken(), MS.Internal.Xml.XPath.XPathScanner.Prefix, MS.Internal.Xml.XPath.XPathParser.s_functionTable, and MS.Internal.Xml.XPath.XPathScanner.StringValue.

Referenced by MS.Internal.Xml.XPath.XPathParser.ParseLocationPathPattern().