MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / and_expression

Function and_expression

graphlite/src/ast/parser.rs:1616–1633  ·  view source on GitHub ↗

Parse AND expressions: not_expr AND not_expr

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1614
1615/// Parse AND expressions: not_expr AND not_expr
1616fn and_expression(tokens: &[Token]) -> IResult<&[Token], Expression> {
1617 map(
1618 tuple((
1619 not_expression,
1620 many0(tuple((expect_token(Token::And), not_expression))),
1621 )),
1622 |(first, rest)| {
1623 rest.into_iter().fold(first, |left, (_, right)| {
1624 Expression::Binary(BinaryExpression {
1625 left: Box::new(left),
1626 operator: Operator::And,
1627 right: Box::new(right),
1628 location: Location::default(),
1629 })
1630 })
1631 },
1632 )(tokens)
1633}
1634
1635/// Parse NOT expressions: [NOT] comparison
1636fn not_expression(tokens: &[Token]) -> IResult<&[Token], Expression> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected