function getScope(ancestors) {
      let scope = vars;

      for (const node of ancestors) {
        if (!(node in scope)) {
          scope[node] = {};
        }

        scope = scope[node];
      }

      return scope;
    }
Traverse the [vars] tree through the path defined by [ancestors], creating nodes as needed.
@param {*} ancestors
@returns the tree of the node defined by the last of [ancestors].