@@ -2378,10 +2378,22 @@ impl PartialPath {
23782378 if !graph[ self . end_node ] . is_jump_to ( ) {
23792379 return Ok ( ( ) ) ;
23802380 }
2381- if self . scope_stack_postcondition . contains_scopes ( ) {
2382- return Err ( PathResolutionError :: ScopeStackUnsatisfied ) ; // this path was not properly resolved
2383- }
2384- self . scope_stack_precondition . push_back ( partials, node) ;
2381+ let scope_variable = match self . scope_stack_postcondition . variable ( ) {
2382+ Some ( scope_variable) => scope_variable,
2383+ None => return Err ( PathResolutionError :: ScopeStackUnsatisfied ) ,
2384+ } ;
2385+ let mut scope_stack = PartialScopeStack :: from_variable ( scope_variable) ;
2386+ scope_stack. push_front ( partials, node) ;
2387+ let mut scope_bindings = PartialScopeStackBindings :: new ( ) ;
2388+ scope_bindings
2389+ . add ( partials, scope_variable, scope_stack)
2390+ . unwrap ( ) ;
2391+ self . scope_stack_precondition
2392+ . apply_partial_bindings ( partials, & scope_bindings)
2393+ . unwrap ( ) ;
2394+ self . scope_stack_postcondition
2395+ . apply_partial_bindings ( partials, & scope_bindings)
2396+ . unwrap ( ) ;
23852397 self . end_node = node;
23862398 Ok ( ( ) )
23872399 }
@@ -2561,9 +2573,7 @@ impl Node {
25612573 scope_stack : & mut PartialScopeStack ,
25622574 ) {
25632575 match self {
2564- Node :: DropScopes ( _) => {
2565- * scope_stack = PartialScopeStack :: empty ( ) ;
2566- }
2576+ Node :: DropScopes ( _) => { }
25672577 Node :: JumpTo ( _) => { }
25682578 Node :: PopScopedSymbol ( node) => {
25692579 let symbol = symbol_stack
0 commit comments