示例#1
0
        private static ParseResult ParseArguments(string s, int pos, string name)
        {
            var query = new FunctionAstQuery(name);

            while (pos < s.Length && !specialChars.Contains(s[pos]))
            {
                var result = Parse(s, pos);

                query.Args.Add(result.query);
                pos = result.position;

                pos = SkipWhitespace(s, pos);

                if (pos < s.Length && s[pos] != ',')
                {
                    break;
                }
                else
                {
                    ++pos;
                }
            }

            return(new ParseResult(query, pos));
        }
 private ISearchQuery CompileSeq(FunctionAstQuery func)
 {
     if (func.Args.Any(q => !(q is WordAstQuery)))
     {
         throw new Exception("Unexpected query take in phrase");
     }
     return(new PhraseQuery(func.Args.Select(Compile).ToArray()));
 }
 private ISearchQuery CompileOr(FunctionAstQuery func)
 {
     return(new OrMultiQuery(func.Args.Select(Compile).ToArray()));
 }