57e806383c
Using a special value to indicate match failure instead of |null| allows actions to return |null| as a regular value. This simplifies e.g. the JSON parser. Note the special value is internal and intentionally undocumented. This means that there is currently no official way how to trigger a match failure from an action. This is a temporary state which will be fixed soon. The negative performance impact (see below) is probably caused by changing lot of comparisons against |null| (which likely check the value against a fixed constant representing |null| in the interpreter) to comparisons against the special value (which likely check the value against another value in the interpreter). Implements part of #198. Speed impact ------------ Before: 1146.82 kB/s After: 1031.25 kB/s Difference: -10.08% Size impact ----------- Before: 950817 b After: 973269 b Difference: 2.36% (Measured by /tools/impact with Node.js v0.6.18 on x86_64 GNU/Linux.) |
||
---|---|---|
.. | ||
compiler/passes | ||
vendor/jasmine | ||
generated-parser.spec.js | ||
helpers.js | ||
index.html | ||
parser.spec.js | ||
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. Make sure you have Node.js and all the development dependencies specified in package.json installed. 2. Run the following command in the PEG.js root directory (one level up from this one): make browser 3. Start a web server and make it serve the PEG.js root directory. 4. Point your browser to an URL corresponding to the index.html file. 5. Watch the specs pass (or fail). If you have Python installed, you can fulfill steps 3 and 4 by running the following command in the PEG.js root directory python -m SimpleHTTPServer and loading http://localhost:8000/spec/index.html in your browser. Running from a command-line --------------------------- 1. Make sure you have Node.js and all the development dependencies specified in package.json installed. 2. Run the following command in the PEG.js root directory (one level up from this one): make spec 3. Watch the specs pass (or fail).