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

Function tuple

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

Source from the content-addressed store, hash-verified

174}
175
176fn tuple<'a, I>(
177 nested_expr: impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a,
178) -> impl Parser<'a, I, ExprKind, ParserError<'a>> + Clone + 'a
179where
180 I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a>,
181{
182 use chumsky::recovery::{skip_then_retry_until, via_parser};
183
184 sequence(maybe_aliased(nested_expr))
185 .delimited_by(
186 ctrl('{'),
187 ctrl('}')
188 .recover_with(via_parser(end()))
189 .recover_with(skip_then_retry_until(
190 any_ref().ignored(),
191 ctrl('}').ignored().or(ctrl(',').ignored()).or(end()),
192 )),
193 )
194 .map(ExprKind::Tuple)
195 .labelled("tuple")
196 .boxed()
197}
198
199fn array<'a, I>(
200 expr: impl Parser<'a, I, Expr, ParserError<'a>> + Clone + 'a,

Callers 1

exprFunction · 0.85

Calls 4

sequenceFunction · 0.85
maybe_aliasedFunction · 0.85
ctrlFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected