()
| 233 | } |
| 234 | |
| 235 | fn import_def<'a, I>() -> impl Parser<'a, I, StmtKind, ParserError<'a>> + Clone |
| 236 | where |
| 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)] |
| 247 | mod tests { |
no test coverage detected