You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
David Majda 890140d73b 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.
12 years ago
..
compiler More responsibility for computing |resultIndex| to node's parent 12 years ago
compiler.js Replace variable name computations by computations of indices 12 years ago
parser.js Change ordering of "literal", "class" and "any" code 12 years ago
parser.pegjs Change ordering of "literal", "class" and "any" code 12 years ago
peg.js Add a note about semantic versioning to |PEG.VERSION| comment 12 years ago
utils.js AST: Store rules in an array instead of an object 12 years ago