mirror of
https://github.com/Dummi26/mers.git
synced 2026-03-22 23:26:33 +01:00
add #include
This commit is contained in:
@@ -23,6 +23,7 @@ pub trait Local: Default + Debug {
|
||||
fn get_var_mut(&mut self, id: &Self::VariableIdentifier) -> Option<&mut Self::VariableData>;
|
||||
// fn add_type(&mut self, id: Self::TypesIdentifier, new_type: Self::TypesType);
|
||||
// fn get_type(&self, id: Self::TypesIdentifier) -> Option<&Self::TypesType>;
|
||||
fn duplicate(&self) -> Self;
|
||||
}
|
||||
|
||||
impl<L: Local> Info<L> {
|
||||
@@ -47,6 +48,11 @@ impl<L: Local> Local for Info<L> {
|
||||
fn get_var_mut(&mut self, id: &Self::VariableIdentifier) -> Option<&mut Self::VariableData> {
|
||||
self.scopes.iter_mut().find_map(|l| l.get_var_mut(id))
|
||||
}
|
||||
fn duplicate(&self) -> Self {
|
||||
Self {
|
||||
scopes: self.scopes.iter().map(|v| v.duplicate()).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<L: Local> Default for Info<L> {
|
||||
|
||||
Reference in New Issue
Block a user