//! This module describes hir-level representation of expressions.
//!
-//! This representaion is:
+//! This representation is:
//!
//! 1. Identity-based. Each expression has an `id`, so we can distinguish
//! between different `1` in `1 + 1`.
//!
//! See also a neighboring `body` module.
-use arena::{Idx, RawId};
use hir_expand::name::Name;
+use la_arena::{Idx, RawIdx};
use syntax::ast::RangeOp;
use crate::{
pub type ExprId = Idx<Expr>;
pub(crate) fn dummy_expr_id() -> ExprId {
- ExprId::from_raw(RawId::from(!0))
+ ExprId::from_raw(RawIdx::from(!0))
}
pub type PatId = Idx<Pat>;
Return {
expr: Option<ExprId>,
},
+ Yield {
+ expr: Option<ExprId>,
+ },
RecordLit {
path: Option<Path>,
fields: Vec<RecordLitField>,
}
}
Expr::Continue { .. } => {}
- Expr::Break { expr, .. } | Expr::Return { expr } => {
+ Expr::Break { expr, .. } | Expr::Return { expr } | Expr::Yield { expr } => {
if let Some(expr) = expr {
f(*expr);
}