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

Function variable_declaration

graphlite/src/ast/parser.rs:4275–4289  ·  view source on GitHub ↗

Parse variable declaration: variable_name type_spec [= initial_value]

(tokens: &[Token])

Source from the content-addressed store, hash-verified

4273
4274/// Parse variable declaration: variable_name type_spec [= initial_value]
4275fn variable_declaration(tokens: &[Token]) -> IResult<&[Token], VariableDeclaration> {
4276 map(
4277 tuple((
4278 identifier,
4279 type_spec,
4280 opt(preceded(expect_token(Token::Equal), expression)),
4281 )),
4282 |(variable_name, type_spec, initial_value)| VariableDeclaration {
4283 variable_name,
4284 type_spec,
4285 initial_value,
4286 location: Location::default(),
4287 },
4288 )(tokens)
4289}
4290
4291// NEXT statement parsing removed - NEXT can only appear within procedure body contexts
4292// The procedure_body_statement function handles NEXT parsing directly

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected