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

Function import_def

prqlc/prqlc-parser/src/parser/stmt.rs:235–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

233}
234
235fn import_def<'a, I>() -> impl Parser<'a, I, StmtKind, ParserError<'a>> + Clone
236where
237 I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a> + chumsky::input::ValueInput<'a>,
238{
239 keyword("import")
240 .ignore_then(ident_part().then_ignore(ctrl('=')).or_not())
241 .then(ident())
242 .map(|(alias, name)| StmtKind::ImportDef(ImportDef { name, alias }))
243 .labelled("import statement")
244}
245
246#[cfg(test)]
247mod tests {

Callers 1

module_contentsFunction · 0.85

Calls 6

ctrlFunction · 0.85
identFunction · 0.85
mapMethod · 0.80
keywordFunction · 0.70
ident_partFunction · 0.70
ImportDefClass · 0.50

Tested by

no test coverage detected