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

Function property_access_token

graphlite/src/ast/parser.rs:2340–2365  ·  view source on GitHub ↗

Parse property access token: object.property

(tokens: &[Token])

Source from the content-addressed store, hash-verified

2338
2339/// Parse property access token: object.property
2340fn property_access_token(tokens: &[Token]) -> IResult<&[Token], PropertyAccess> {
2341 if let Some(Token::PropertyAccess(s)) = tokens.first() {
2342 // Parse the property access string "object.property"
2343 let parts: Vec<&str> = s.split('.').collect();
2344 if parts.len() == 2 {
2345 Ok((
2346 &tokens[1..],
2347 PropertyAccess {
2348 object: parts[0].to_string(),
2349 property: parts[1].to_string(),
2350 location: Location::default(),
2351 },
2352 ))
2353 } else {
2354 Err(nom::Err::Error(nom::error::Error::new(
2355 tokens,
2356 nom::error::ErrorKind::Tag,
2357 )))
2358 }
2359 } else {
2360 Err(nom::Err::Error(nom::error::Error::new(
2361 tokens,
2362 nom::error::ErrorKind::Tag,
2363 )))
2364 }
2365}
2366
2367/// Parse identifier (does NOT accept string literals - use identifier_or_quoted for that)
2368fn identifier(tokens: &[Token]) -> IResult<&[Token], String> {

Callers

nothing calls this directly

Calls 3

ErrorEnum · 0.85
firstMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected