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.
7134b09e50
The purpose of this change is to avoid the need to index register variables storing match results of sequences whose elements are labeled. The indexing happened when match results of labeled elements were passed to action/predicate functions. In order to avoid indexing, the register allocator needs to ensure that registers storing match results of any labeled sequence elements are still "alive" after finishing parsing of the sequence. They should not be used to store anything else at least until code of all actions and predicates that can see the labels is executed. This requires that the |allocateRegisters| pass has the knowledge of scoping. Because that knowledge was already implicitly embedded in the |coputeParams| pass, the logical step to prevent duplication was to merge it with the |allocateRegisters| pass. This is what this commit does. As a part of the merge the tests of both passes were largely refactored. This is both to accomodate the merge and to make the tests in sync with the code again (the tests became a bit out-of-sync during the last few commits -- they tested more than was needed). The speed/size impact is slightly positive: Speed impact ------------ Before: 849.86 kB/s After: 858.16 kB/s Difference: 0.97% Size impact ----------- Before: 876618 b After: 875602 b Difference: -0.12% (Measured by /tools/impact with Node.js v0.6.18 on x86_64 GNU/Linux.) |
12 years ago | |
---|---|---|
.. | ||
compiler/passes | 12 years ago | |
vendor/jasmine | 13 years ago | |
README | 13 years ago | |
generated-parser.spec.js | 13 years ago | |
helpers.js | 13 years ago | |
index.html | 12 years ago | |
parser.spec.js | 13 years ago |
README
PEG.js Spec Suite ================= This is the PEG.js spec suite. It ensures PEG.js works correctly. All specs should always pass on all supported platforms. Running in a browser -------------------- 1. Start a web server and make it serve the PEG.js root directory (one level up from this one). 2. Point your browser to an URL corresponding to the index.html file. 3. Watch the specs pass (or fail). If you have Python installed, you can just run the following command in the PEG.js root directory python -m SimpleHTTPServer and load http://localhost:8000/spec/ in your browser. Running from a command-line --------------------------- 1. Make sure you have Node.js and the "jasmine-node" npm pacakge installed. 2. Run the following command: jasmine-node --verbose . 3. Watch the specs pass (or fail).