MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_and

Function parse_and

nodedb-sql/src/functions/fts_ops/tsquery_parser.rs:119–133  ·  view source on GitHub ↗
(tokens: &[String], pos: &mut usize)

Source from the content-addressed store, hash-verified

117}
118
119fn parse_and(tokens: &[String], pos: &mut usize) -> Result<FtsQuery> {
120 let mut left = parse_not(tokens, pos)?;
121 while *pos < tokens.len() && tokens[*pos] == "&" {
122 *pos += 1;
123 let right = parse_not(tokens, pos)?;
124 left = match left {
125 FtsQuery::And(mut parts) => {
126 parts.push(right);
127 FtsQuery::And(parts)
128 }
129 other => FtsQuery::And(vec![other, right]),
130 };
131 }
132 Ok(left)
133}
134
135fn parse_not(tokens: &[String], pos: &mut usize) -> Result<FtsQuery> {
136 if *pos < tokens.len() && tokens[*pos] == "!" {

Callers 1

parse_orFunction · 0.70

Calls 3

parse_notFunction · 0.70
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected