//! Tools related to handling/recovering from Sway compile errors and reporting them to the user.
use crate::language::parsed::VariableDeclaration;
/// Acts as the result of parsing `Declaration`s, `Expression`s, etc.
/// Some `Expression`s need to be able to create `VariableDeclaration`s,
/// so this struct is used to "bubble up" those declarations to a viable
/// place in the AST.
#[derive(Debug, Clone)]
pub struct ParserLifter<T> {
pub var_decls: Vec<VariableDeclaration>,
pub value: T,
}
impl<T> ParserLifter<T> {
#[allow(dead_code)]
pub(crate) fn empty(value: T) -> Self {
ParserLifter {
var_decls: vec![],
value,
}
}
}