MCPcopy Create free account
hub / github.com/PRQL/prql / unary

Function unary

prqlc/prqlc-parser/src/parser/expr.rs:267–278  ·  view source on GitHub ↗
(expr: E)

Source from the content-addressed store, hash-verified

265}
266
267fn unary<'a, I, E>(expr: E) -> impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a
268where
269 I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a>,
270 E: Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a,
271{
272 expr.clone()
273 .or(operator_unary()
274 .then(expr.map(Box::new))
275 .map(|(op, expr)| ExprKind::Unary(UnaryExpr { op, expr }))
276 .map_with(|kind, extra| ExprKind::into_expr(kind, extra.span())))
277 .boxed()
278}
279
280fn range<'a, I, E>(expr: E) -> impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a
281where

Callers 1

exprFunction · 0.85

Calls 3

operator_unaryFunction · 0.85
mapMethod · 0.80
spanMethod · 0.45

Tested by

no test coverage detected