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

Function path_pattern

graphlite/src/ast/parser.rs:1168–1182  ·  view source on GitHub ↗

Parse path pattern: [identifier =] [path_type] node (edge node)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1166
1167/// Parse path pattern: [identifier =] [path_type] node (edge node)*
1168fn path_pattern(tokens: &[Token]) -> IResult<&[Token], PathPattern> {
1169 map(
1170 tuple((
1171 opt(tuple((identifier, expect_token(Token::Equal)))),
1172 opt(path_type_keywords),
1173 many1(pattern_element),
1174 )),
1175 |(assignment, path_type, elements)| PathPattern {
1176 assignment: assignment.map(|(id, _)| id),
1177 path_type,
1178 elements,
1179 location: Location::default(),
1180 },
1181 )(tokens)
1182}
1183
1184/// Parse path type keywords: WALK | TRAIL | SIMPLE PATH | ACYCLIC PATH
1185fn path_type_keywords(tokens: &[Token]) -> IResult<&[Token], PathType> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected