More responsibility for computing |resultIndex| to node's parent
Before this commit, each node was responsible for computing the value of its |resultIndex| property in the |computeVarIndices| pass. This was possible because |resultIndex| was always equal to |index.result|, meaning that nodes always wrote their match results to the top of the stack. This behavior would cause problems in the future where nodes will use the stack also for storing positions. Parent nodes storing position on the stack would have to copy their childs' match results from the top of the stack to some position below where parent's match result would be expected. There would be no way to tell the children to place their match result somewhere else than the top of the stack and avoid copying. This commit fixes the described problem by shifting the responsibility for setting the value of node's |resultIndex| property to its parent. This way it can direct its child to place its result wherever it wants to.redux
parent
2c8b323ade
commit
890140d73b
Loading…
Reference in New Issue