Preserve yield position during pretty printing
This commit is contained in:
@@ -1657,7 +1657,7 @@ pub enum ExprKind {
|
||||
Try(P<Expr>),
|
||||
|
||||
/// A `yield`, with an optional value to be yielded.
|
||||
Yield(Option<P<Expr>>),
|
||||
Yield(Option<P<Expr>>, YieldKind),
|
||||
|
||||
/// A `do yeet` (aka `throw`/`fail`/`bail`/`raise`/whatever),
|
||||
/// with an optional value to be returned.
|
||||
@@ -1903,6 +1903,15 @@ pub enum MatchKind {
|
||||
Postfix,
|
||||
}
|
||||
|
||||
/// The kind of yield expression
|
||||
#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq)]
|
||||
pub enum YieldKind {
|
||||
/// yield expr { ... }
|
||||
Prefix,
|
||||
/// expr.yield { ... }
|
||||
Postfix,
|
||||
}
|
||||
|
||||
/// A literal in a meta item.
|
||||
#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)]
|
||||
pub struct MetaItemLit {
|
||||
|
||||
Reference in New Issue
Block a user