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

Function label_list

graphlite/src/ast/parser.rs:1319–1338  ·  view source on GitHub ↗

Parse label list: :label (&label)* OR :label (:label)* (BNF-compliant + backward compatible) Supports ISO GQL delimited identifiers: :`Special-Label`

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1317/// Parse label list: :label (&label)* OR :label (:label)* (BNF-compliant + backward compatible)
1318/// Supports ISO GQL delimited identifiers: :`Special-Label`
1319fn label_list(tokens: &[Token]) -> IResult<&[Token], Vec<String>> {
1320 map(
1321 tuple((
1322 expect_token(Token::Colon),
1323 identifier_or_quoted,
1324 many0(tuple((
1325 alt((
1326 expect_token(Token::Ampersand), // BNF syntax: &label
1327 expect_token(Token::Colon), // Legacy syntax: :label
1328 )),
1329 identifier_or_quoted,
1330 ))),
1331 )),
1332 |(_, first_label, additional_labels)| {
1333 let mut labels = vec![first_label];
1334 labels.extend(additional_labels.into_iter().map(|(_, label)| label));
1335 labels
1336 },
1337 )(tokens)
1338}
1339
1340/// Parse property map: {property, ...}
1341fn property_map(tokens: &[Token]) -> IResult<&[Token], PropertyMap> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected