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

Function comparison_operator

graphlite/src/ast/parser.rs:2430–2451  ·  view source on GitHub ↗

Parse comparison operator

(tokens: &[Token])

Source from the content-addressed store, hash-verified

2428
2429/// Parse comparison operator
2430fn comparison_operator(tokens: &[Token]) -> IResult<&[Token], Operator> {
2431 alt((
2432 value(Operator::Equal, expect_token(Token::Equal)),
2433 value(Operator::NotEqual, expect_token(Token::NotEqual)),
2434 value(Operator::LessThan, expect_token(Token::LessThan)),
2435 value(Operator::LessEqual, expect_token(Token::LessEqual)),
2436 value(Operator::GreaterThan, expect_token(Token::GreaterThan)),
2437 value(Operator::GreaterEqual, expect_token(Token::GreaterEqual)),
2438 value(Operator::Within, expect_token(Token::Within)),
2439 value(Operator::Like, expect_token(Token::Like)),
2440 value(Operator::Contains, expect_token(Token::Contains)),
2441 // Handle compound operators
2442 value(
2443 Operator::Starts,
2444 tuple((expect_token(Token::Starts), expect_token(Token::With))),
2445 ),
2446 value(
2447 Operator::Ends,
2448 tuple((expect_token(Token::Ends), expect_token(Token::With))),
2449 ),
2450 ))(tokens)
2451}
2452
2453/// Parse quantifier
2454fn quantifier(tokens: &[Token]) -> IResult<&[Token], Quantifier> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected