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

Function return_item

graphlite/src/ast/parser.rs:1416–1428  ·  view source on GitHub ↗

Parse return item: expression [AS alias]

(tokens: &[Token])

Source from the content-addressed store, hash-verified

1414
1415/// Parse return item: expression [AS alias]
1416fn return_item(tokens: &[Token]) -> IResult<&[Token], ReturnItem> {
1417 map(
1418 tuple((
1419 expression,
1420 opt(tuple((expect_token(Token::As), identifier))),
1421 )),
1422 |(expression, opt_alias)| ReturnItem {
1423 expression,
1424 alias: opt_alias.map(|(_, alias)| alias),
1425 location: Location::default(),
1426 },
1427 )(tokens)
1428}
1429
1430/// Parse WITH clause: WITH [DISTINCT|ALL] expr [AS alias] [, expr [AS alias]]* [WHERE condition] [ORDER BY ...] [LIMIT ...]
1431fn with_clause(tokens: &[Token]) -> IResult<&[Token], WithClause> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected