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

Function array

prqlc/prqlc-parser/src/parser/expr.rs:199–220  ·  view source on GitHub ↗
(
    expr: impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a,
)

Source from the content-addressed store, hash-verified

197}
198
199fn array<'a, I>(
200 expr: impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a,
201) -> impl Parser<'a, I, ExprKind, ParserError<'a>> + Clone + 'a
202where
203 I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a>,
204{
205 use chumsky::recovery::{skip_then_retry_until, via_parser};
206
207 sequence(expr)
208 .delimited_by(
209 ctrl('['),
210 ctrl(']')
211 .recover_with(via_parser(end()))
212 .recover_with(skip_then_retry_until(
213 any_ref().ignored(),
214 ctrl(']').ignored().or(ctrl(',').ignored()).or(end()),
215 )),
216 )
217 .map(ExprKind::Array)
218 .labelled("array")
219 .boxed()
220}
221
222fn interpolation<'a, I>() -> impl Parser<'a, I, ExprKind, ParserError<'a>> + Clone
223where

Callers 1

exprFunction · 0.85

Calls 3

sequenceFunction · 0.85
ctrlFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected