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

Function property_access_as_string

graphlite/src/ast/parser.rs:1090–1112  ·  view source on GitHub ↗

Parse property access as string (for procedure names like gql.list_schemas)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1088
1089/// Parse property access as string (for procedure names like gql.list_schemas)
1090fn property_access_as_string(tokens: &[Token]) -> IResult<&[Token], String> {
1091 if let Some(Token::PropertyAccess(prop_access)) = tokens.first() {
1092 // Handle PropertyAccess token (e.g., "gql.list_schemas")
1093 Ok((&tokens[1..], prop_access.clone()))
1094 } else if let Some(Token::Identifier(name)) = tokens.first() {
1095 let rest = &tokens[1..];
1096
1097 // Check if this is a property access (name.property)
1098 if let Some(Token::Dot) = rest.first() {
1099 if let Some(Token::Identifier(property)) = rest.get(1) {
1100 return Ok((&rest[2..], format!("{}.{}", name, property)));
1101 }
1102 }
1103
1104 // Simple identifier
1105 Ok((rest, name.clone()))
1106 } else {
1107 Err(nom::Err::Error(nom::error::Error::new(
1108 tokens,
1109 nom::error::ErrorKind::Tag,
1110 )))
1111 }
1112}
1113
1114/// Parse YIELD clause: YIELD item1 [AS alias1], item2 [AS alias2], ...
1115fn yield_clause(tokens: &[Token]) -> IResult<&[Token], YieldClause> {

Callers

nothing calls this directly

Calls 4

ErrorEnum · 0.85
cloneMethod · 0.80
firstMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected