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

Function property_access

graphlite/src/ast/lexer.rs:1651–1666  ·  view source on GitHub ↗

Parse function calls like upper(...), count(...), etc. CRITICAL: This function was also a source of infinite loops in the original implementation PROBLEM: The original implementation tried to parse any input containing '(' as a function call, even when it wasn't actually a function call (e.g., "(a:User {id: 123})"). This caused the lexer to never advance and get stuck in an infinite loop. SOLUT

(input: &str)

Source from the content-addressed store, hash-verified

1649///
1650/// Parse property access like user.risk_score
1651fn property_access(input: &str) -> IResult<&str, &str> {
1652 recognize(tuple((
1653 // Object name (identifier)
1654 pair(
1655 alt((alpha1, tag("_"))),
1656 many0(alt((alphanumeric1, tag("_")))),
1657 ),
1658 // Dot
1659 char('.'),
1660 // Property name (identifier)
1661 pair(
1662 alt((alpha1, tag("_"))),
1663 many0(alt((alphanumeric1, tag("_")))),
1664 ),
1665 )))(input)
1666}
1667
1668/// Parse string literals
1669fn string_literal(input: &str) -> IResult<&str, &str> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected