From 85cd3524e28443836658615fe40599bf10a96943 Mon Sep 17 00:00:00 2001 From: Daiki Ihara Date: Thu, 14 Jan 2021 00:01:50 +0900 Subject: Add support for yiled keyword --- crates/hir_def/src/body/lower.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir_def/src/body') diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 27575c537..4ce5e5b72 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs @@ -386,6 +386,10 @@ impl ExprCollector<'_> { let expr = e.expr().map(|e| self.collect_expr(e)); self.alloc_expr(Expr::Return { expr }, syntax_ptr) } + ast::Expr::YieldExpr(e) => { + let expr = e.expr().map(|e| self.collect_expr(e)); + self.alloc_expr(Expr::Yield { expr }, syntax_ptr) + } ast::Expr::RecordExpr(e) => { let path = e.path().and_then(|path| self.expander.parse_path(path)); let mut field_ptrs = Vec::new(); -- cgit v1.2.3