parseClause static method
Implementation
static QueryParserState? parseClause(QueryParser parser) {
var lexeme = parser.peekLexeme();
if (lexeme == null) {
return null;
}
switch (lexeme.type) {
case LexemeType.PRESENCE:
return QueryParser.parsePresence;
case LexemeType.FIELD:
return QueryParser.parseField;
case LexemeType.TERM:
return QueryParser.parseTerm;
default:
var errorMessage =
'expected either a field or a term, found ${lexeme.type}';
if (lexeme.str.isNotEmpty) {
errorMessage += "${" with value '${lexeme.str}"}'";
}
throw QueryParseError(errorMessage, lexeme.start, lexeme.end);
}
}