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

Function declare_statement

graphlite/src/ast/parser.rs:4261–4272  ·  view source on GitHub ↗

Parse DECLARE statement: DECLARE variable type [= initial_value] [, variable type [= initial_value]]

(tokens: &[Token])

Source from the content-addressed store, hash-verified

4259
4260/// Parse DECLARE statement: DECLARE variable type [= initial_value] [, variable type [= initial_value]]*
4261fn declare_statement(tokens: &[Token]) -> IResult<&[Token], DeclareStatement> {
4262 map(
4263 tuple((
4264 expect_token(Token::Declare),
4265 separated_list1(expect_token(Token::Comma), variable_declaration),
4266 )),
4267 |(_, variable_declarations)| DeclareStatement {
4268 variable_declarations,
4269 location: Location::default(),
4270 },
4271 )(tokens)
4272}
4273
4274/// Parse variable declaration: variable_name type_spec [= initial_value]
4275fn variable_declaration(tokens: &[Token]) -> IResult<&[Token], VariableDeclaration> {

Callers 1

parse_queryFunction · 0.85

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected