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

Function remove_statement

graphlite/src/ast/parser.rs:4148–4167  ·  view source on GitHub ↗

Parse REMOVE statement: REMOVE remove_item [, remove_item]

(tokens: &[Token])

Source from the content-addressed store, hash-verified

4146
4147/// Parse REMOVE statement: REMOVE remove_item [, remove_item]*
4148fn remove_statement(tokens: &[Token]) -> IResult<&[Token], RemoveStatement> {
4149 log::debug!(
4150 "remove_statement called with tokens: {:?}",
4151 tokens.get(0..10).unwrap_or(&[])
4152 );
4153 let result = map(
4154 tuple((
4155 expect_token(Token::Remove),
4156 separated_list1(expect_token(Token::Comma), remove_item),
4157 )),
4158 |(_, items)| RemoveStatement {
4159 items,
4160 location: Location::default(),
4161 },
4162 )(tokens);
4163 if result.is_err() {
4164 log::debug!("remove_statement parsing failed");
4165 }
4166 result
4167}
4168
4169/// Parse REMOVE item: property | variable:label | variable
4170fn remove_item(tokens: &[Token]) -> IResult<&[Token], RemoveItem> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected