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

Function match_clause

graphlite/src/ast/parser.rs:1149–1165  ·  view source on GitHub ↗

Parse MATCH clause

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1147
1148/// Parse MATCH clause
1149fn match_clause(tokens: &[Token]) -> IResult<&[Token], MatchClause> {
1150 map(
1151 tuple((
1152 expect_token(Token::Match),
1153 path_pattern,
1154 many0(tuple((expect_token(Token::Comma), path_pattern))),
1155 )),
1156 |(_, first_pattern, additional_patterns)| {
1157 let mut patterns = vec![first_pattern];
1158 patterns.extend(additional_patterns.into_iter().map(|(_, pattern)| pattern));
1159 MatchClause {
1160 patterns,
1161 location: Location::default(),
1162 }
1163 },
1164 )(tokens)
1165}
1166
1167/// Parse path pattern: [identifier =] [path_type] node (edge node)*
1168fn path_pattern(tokens: &[Token]) -> IResult<&[Token], PathPattern> {

Callers 1

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected