コード例 #1
0
 private static void HandleCurrentPositionInIntIndexer(OPathParseResult parseResult, char opathChar)
 {
     if (IsNumericChar(opathChar))
     {
         parseResult.AppendToIntIndexer(opathChar);
     }
     else if (IsIndexerEndChar(opathChar))
     {
         parseResult.CurrentPosition = OPathParsePosition.InVariableOPath;
         parseResult.AddOPathIntIndexerPart();
     }
     else if (IsWhitespaceChar(opathChar))
     {
         parseResult.CurrentPosition = OPathParsePosition.PostIndexerValue;
     }
     else
     {
         throw new OPathException("Invalid character in indexer starting at position " + (parseResult.IndexerStartIndex + 1));
     }
 }
コード例 #2
0
 private static void HandleCurrentPositionPreIndexerValue(OPathParseResult parseResult, char opathChar,
                                                          int opathCharIndex)
 {
     if (IsWhitespaceChar(opathChar))
     {
         // Ignore
     }
     else if (IsStringDelimiterChar(opathChar))
     {
         parseResult.CurrentPosition        = OPathParsePosition.InStringKey;
         parseResult.CurrentStringDelimiter = opathChar;
         parseResult.StringStartIndex       = opathCharIndex;
     }
     else if (IsNumericStartChar(opathChar))
     {
         parseResult.CurrentPosition = OPathParsePosition.InIntIndexer;
         parseResult.AppendToIntIndexer(opathChar);
     }
     else
     {
         throw new OPathException("Invalid character in indexer starting at position " + (parseResult.IndexerStartIndex + 1));
     }
 }