Parse property access as string (for procedure names like gql.list_schemas)
(tokens: &[Token])
| 1088 | |
| 1089 | /// Parse property access as string (for procedure names like gql.list_schemas) |
| 1090 | fn 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], ... |
| 1115 | fn yield_clause(tokens: &[Token]) -> IResult<&[Token], YieldClause> { |