pub fn merge_delta(&mut self, mut delta: StateDelta) {
        // Take the mutable reference and extend the permanent state from the working set
        self.files.extend(delta.files);
        self.file_contents.extend(delta.file_contents);
        self.decls.extend(delta.decls);
        self.vars.extend(delta.vars);
        self.blocks.extend(delta.blocks);

        if let Some(last) = self.scope.back_mut() {
            let first = delta.scope.remove(0);
            for item in first.decls.into_iter() {
                last.decls.insert(item.0, item.1);
            }
            for item in first.vars.into_iter() {
                last.vars.insert(item.0, item.1);
            }
            for item in first.aliases.into_iter() {
                last.aliases.insert(item.0, item.1);
            }
            for item in first.modules.into_iter() {
                last.modules.insert(item.0, item.1);
            }
            last.visibility.merge_with(first.visibility);
        }
    }
/// Merges a `StateDelta` onto the current state. These deltas come from a system, like the parser, that
/// creates a new set of definitions and visible symbols in the current scope. We make this transactional
/// as there are times when we want to run the parser and immediately throw away the results (namely:
/// syntax highlighting and completions).
///
/// When we want to preserve what the parser has created, we can take its output (the `StateDelta`) and
/// use this function to merge it into the global state.
Merges a `StateDelta` onto the current state. These deltas come from a system, like the parser, that
creates a new set of definitions and visible symbols in the current scope. We make this transactional
as there are times when we want to run the parser and immediately throw away the results (namely:
syntax highlighting and completions).

When we want to preserve what the parser has created, we can take its output (the `StateDelta`) and
use this function to merge it into the global state.
Merges a ` StateDelta ` onto the current state . These deltas come from a system like the parser that creates a new set of definitions and visible symbols in the current scope . We make this transactional as there are times when we want to run the parser and immediately throw away the results ( namely : syntax highlighting and completions ) . When we want to preserve what the parser has created we can take its output ( the ` StateDelta ` ) and use this function to merge it into the global state .
pub fn merge_delta(&mut self, mut delta: StateDelta) {
        // Take the mutable reference and extend the permanent state from the working set
        self.files.extend(delta.files);
        self.file_contents.extend(delta.file_contents);
        self.decls.extend(delta.decls);
        self.vars.extend(delta.vars);
        self.blocks.extend(delta.blocks);
        if let Some(last) = self.scope.back_mut() {
            let first = delta.scope.remove(0);
            for item in first.decls.into_iter() {
                last.decls.insert(item.0, item.1);
            }
            for item in first.vars.into_iter() {
                last.vars.insert(item.0, item.1);
            }
            for item in first.aliases.into_iter() {
                last.aliases.insert(item.0, item.1);
            }
            for item in first.modules.into_iter() {
                last.modules.insert(item.0, item.1);
            }
            last.visibility.merge_with(first.visibility);
        }
    }
pub fn merge_delta ( & mut self , mut delta : StateDelta ) { // Take the mutable reference and extend the permanent state from the working set self . files . extend ( delta . files ) ; self . file_contents . extend ( delta . file_contents ) ; self . decls . extend ( delta . decls ) ; self . vars . extend ( delta . vars ) ; self . blocks . extend ( delta . blocks ) ; if let Some ( last ) = self . scope . back_mut ( ) { let first = delta . scope . remove ( 0 ) ; for item in first . decls . into_iter ( ) { last . decls . insert ( item . 0 , item . 1 ) ; } for item in first . vars . into_iter ( ) { last . vars . insert ( item . 0 , item . 1 ) ; } for item in first . aliases . into_iter ( ) { last . aliases . insert ( item . 0 , item . 1 ) ; } for item in first . modules . into_iter ( ) { last . modules . insert ( item . 0 , item . 1 ) ; } last . visibility . merge_with ( first . visibility ) ; } }
Merges a `StateDelta` onto the current state.
Merges a ` StateDelta ` onto the current state .
&mut self
delta
StateDelta