Add position info for closures.
This commit is contained in:
@@ -376,7 +376,7 @@ pub enum Stmt {
|
||||
/// This variant does not map to any language structure. It is currently only used only to
|
||||
/// convert a normal variable into a shared variable when the variable is _captured_ by a closure.
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
Share(crate::Identifier),
|
||||
Share(crate::Identifier, Position),
|
||||
}
|
||||
|
||||
impl Default for Stmt {
|
||||
@@ -427,7 +427,7 @@ impl Stmt {
|
||||
Self::Export(.., pos) => *pos,
|
||||
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
Self::Share(..) => Position::NONE,
|
||||
Self::Share(.., pos) => *pos,
|
||||
}
|
||||
}
|
||||
/// Override the [position][Position] of this statement.
|
||||
@@ -458,7 +458,7 @@ impl Stmt {
|
||||
Self::Export(.., pos) => *pos = new_pos,
|
||||
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
Self::Share(..) => (),
|
||||
Self::Share(.., pos) => *pos = new_pos,
|
||||
}
|
||||
|
||||
self
|
||||
|
Reference in New Issue
Block a user