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

Function property_access

graphlite/src/ast/parser.rs:2286–2307  ·  view source on GitHub ↗

Parse property access: object.property

(tokens: &[Token])

Source from the content-addressed store, hash-verified

2284
2285/// Parse property access: object.property
2286fn property_access(tokens: &[Token]) -> IResult<&[Token], PropertyAccess> {
2287 map(
2288 tuple((
2289 identifier,
2290 expect_token(Token::Dot),
2291 identifier,
2292 many0(tuple((expect_token(Token::Dot), identifier))),
2293 )),
2294 |(object, _, first_property, additional_properties)| {
2295 // Build the full property path: object.property1.property2...
2296 let mut property_path = first_property;
2297 for (_, prop) in additional_properties {
2298 property_path = format!("{}.{}", property_path, prop);
2299 }
2300 PropertyAccess {
2301 object,
2302 property: property_path,
2303 location: Location::default(),
2304 }
2305 },
2306 )(tokens)
2307}
2308
2309/// Parse property access that starts with a PropertyAccess token: PropertyAccess.Dot.Identifier...
2310fn property_access_continued(tokens: &[Token]) -> IResult<&[Token], PropertyAccess> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected