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

Function set_statement

graphlite/src/ast/parser.rs:4094–4116  ·  view source on GitHub ↗

Parse SET statement: SET set_item [, set_item]

(tokens: &[Token])

Source from the content-addressed store, hash-verified

4092
4093/// Parse SET statement: SET set_item [, set_item]*
4094fn set_statement(tokens: &[Token]) -> IResult<&[Token], SetStatement> {
4095 log::debug!(
4096 "set_statement called with tokens: {:?}",
4097 tokens.get(0..10).unwrap_or(&[])
4098 );
4099 let result = map(
4100 tuple((
4101 expect_token(Token::Set),
4102 separated_list1(expect_token(Token::Comma), set_item),
4103 )),
4104 |(_, items)| {
4105 log::debug!("SET parsing succeeded");
4106 SetStatement {
4107 items,
4108 location: Location::default(),
4109 }
4110 },
4111 )(tokens);
4112 if result.is_err() {
4113 log::debug!("set_statement parsing failed: {:?}", result);
4114 }
4115 result
4116}
4117
4118/// Parse SET item: property = value | variable = value | variable:label
4119fn set_item(tokens: &[Token]) -> IResult<&[Token], SetItem> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected