| 390 | } |
| 391 | |
| 392 | fn maybe_aliased<'a, I, E>(expr: E) -> impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a |
| 393 | where |
| 394 | I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a>, |
| 395 | E: Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a, |
| 396 | { |
| 397 | let aliased = ident_part() |
| 398 | .then_ignore(ctrl('=')) |
| 399 | // This is added for `maybe_aliased`; possibly we should integrate |
| 400 | // the funcs |
| 401 | .or_not() |
| 402 | .then(expr) |
| 403 | .map(|(alias, mut expr)| { |
| 404 | expr.alias = alias.or(expr.alias); |
| 405 | expr |
| 406 | }); |
| 407 | // Because `expr` accounts for parentheses, and aliased is `x=$expr`, we |
| 408 | // need to allow another layer of parentheses here. |
| 409 | aliased |
| 410 | .clone() |
| 411 | .or(aliased.delimited_by(ctrl('('), ctrl(')'))) |
| 412 | } |
| 413 | |
| 414 | fn func_call<'a, I, E>(expr: E) -> impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a |
| 415 | where |