Add ast::ExprKind::Dummy
This commit is contained in:
parent
8c0b1fcd29
commit
a3fce72a27
18 changed files with 37 additions and 24 deletions
|
@ -1296,23 +1296,10 @@ impl Expr {
|
|||
ExprKind::Yeet(..) => ExprPrecedence::Yeet,
|
||||
ExprKind::FormatArgs(..) => ExprPrecedence::FormatArgs,
|
||||
ExprKind::Become(..) => ExprPrecedence::Become,
|
||||
ExprKind::Err => ExprPrecedence::Err,
|
||||
ExprKind::Err | ExprKind::Dummy => ExprPrecedence::Err,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn take(&mut self) -> Self {
|
||||
mem::replace(
|
||||
self,
|
||||
Expr {
|
||||
id: DUMMY_NODE_ID,
|
||||
kind: ExprKind::Err,
|
||||
span: DUMMY_SP,
|
||||
attrs: AttrVec::new(),
|
||||
tokens: None,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/// To a first-order approximation, is this a pattern?
|
||||
pub fn is_approximately_pattern(&self) -> bool {
|
||||
matches!(
|
||||
|
@ -1532,6 +1519,9 @@ pub enum ExprKind {
|
|||
|
||||
/// Placeholder for an expression that wasn't syntactically well formed in some way.
|
||||
Err,
|
||||
|
||||
/// Acts as a null expression. Lowering it will always emit a bug.
|
||||
Dummy,
|
||||
}
|
||||
|
||||
/// Used to differentiate between `for` loops and `for await` loops.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue