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

Function node_pattern

graphlite/src/ast/parser.rs:1248–1264  ·  view source on GitHub ↗

Parse node pattern: (identifier? :label? {properties}?)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1246
1247/// Parse node pattern: (identifier? :label? {properties}?)
1248fn node_pattern(tokens: &[Token]) -> IResult<&[Token], Node> {
1249 map(
1250 tuple((
1251 expect_token(Token::LeftParen),
1252 opt(identifier),
1253 opt(label_list),
1254 opt(property_map),
1255 expect_token(Token::RightParen),
1256 )),
1257 |(_, identifier, labels, properties, _)| Node {
1258 identifier,
1259 labels: labels.unwrap_or_default(),
1260 properties,
1261 location: Location::default(),
1262 },
1263 )(tokens)
1264}
1265
1266/// Parse edge pattern: -[:label {properties}]-
1267fn edge_pattern(tokens: &[Token]) -> IResult<&[Token], Edge> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected