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

Function property_map

graphlite/src/ast/parser.rs:1341–1365  ·  view source on GitHub ↗

Parse property map: {property, ...}

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1339
1340/// Parse property map: {property, ...}
1341fn property_map(tokens: &[Token]) -> IResult<&[Token], PropertyMap> {
1342 map(
1343 delimited(
1344 expect_token(Token::LeftBrace),
1345 opt(tuple((
1346 property_pair,
1347 many0(tuple((expect_token(Token::Comma), property_pair))),
1348 ))),
1349 expect_token(Token::RightBrace),
1350 ),
1351 |opt_props| {
1352 let properties = if let Some((first, rest)) = opt_props {
1353 let mut props = vec![first];
1354 props.extend(rest.into_iter().map(|(_, prop)| prop));
1355 props
1356 } else {
1357 vec![]
1358 };
1359 PropertyMap {
1360 properties,
1361 location: Location::default(),
1362 }
1363 },
1364 )(tokens)
1365}
1366
1367/// Parse property pair: key: value
1368/// Supports regular identifiers, backtick-delimited identifiers, and keywords

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected