private static bool ParseMatchClause(
IList<TSqlParserToken> tokens,
ref int nextToken,
ref WMatchClause result,
ref int farestError)
{
var currentToken = nextToken;
var firstToken = nextToken;
var paths = new List<WMatchPath>();
WMatchPath path = null;
if (!ReadToken(tokens, "MATCH", ref currentToken, ref farestError))
return false;
while (ParseMatchPath(tokens, ref currentToken, ref path, ref farestError))
{
paths.Add(path);
if (!ReadToken(tokens, ",", ref currentToken, ref farestError))
break;
}
if (paths.Count == 0)
return false;
result = new WMatchClause
{
Paths = paths,
FirstTokenIndex = firstToken,
LastTokenIndex = currentToken - 1,
};
nextToken = currentToken;
return true;
}