Commit graph

10 commits

Author SHA1 Message Date
Mingun 534dc53ac2 Optimize redundant fail checks (#400)
eliminate unnecessary checks for the result of parse, when it can be statically determined
2018-01-05 21:28:09 +00:00
Mingun 42ec335d13 Optimize silent fails: remove checks that always false (#399)
* Optimization: do not generate unreachable calls |peg$fail| and constants for it (local to the rule).
* Optimization: do not generate unreachable calls |peg$fail| and constants for it (non-local to rule).
2018-01-01 19:35:59 +00:00
Mingun 669f782a5f Partial fix #194 - nonsenses error messages with semantic predicates (#547)
* Remove stack manipulations from FAIL opcode and rename FAIL to EXPECT
* Always save the expected values regardless of the match result of expression
* Remove unnecessary check for match result in the `named` node
* Collect and process expectations from predicates
2017-12-31 10:59:51 +00:00
Futago-za Ryuu 1b20aa5427 Ensure usage of 'lib/peg.d.ts'
This commit ensures that all modules outside 'lib' are importing 'lib/peg.js' so that VS Code automatically gets 'lib/peg.d.ts'.

An alias module for 'lib/peg.js' called 'pegjs-dev' was made for test files at 'test/node_modules/pegjs-dev.js'
2017-12-28 01:48:01 +00:00
Mingun 3e89534bb7 Auto-add allowedStartRules to test options for changeAST and reportError methods if it not defined 2017-12-19 01:38:26 +05:00
Futago-za Ryuu e6d018a88d Update code format and style
This is related to my last commit. I've updated all the JavaScript files to satisfy 'eslint-config-futagozaryuu', my eslint configuration.

I'm sure I've probally missed something, but I've run all NPM scripts and Gulp tasks, fixed any bugs that cropped up, and updated some stuff (mainly related to generated messages), so as far as I can, tell this conversion is over (I know I've probally jixed it just by saying this ;P).
2017-10-25 19:19:42 +01:00
Futago-za Ryuu 3c6523ff83 Switched eslint configuration
Was using 'eslint-config-dmajda' by @dmajda, but since it's diffucult for me to use multiple styles across multiple projects, I'm switching to my own 'eslint-config-futagozaryuu'.
2017-10-25 02:24:11 +01:00
Futago-za Ryuu abadaf4d5d Add test for empty grammars
This add's a test that ensures grammars without any rules are not accepted.
2017-10-20 19:01:19 +01:00
Futago-za Ryuu 96a386ff15 Merged documents for test suites 2017-10-15 02:36:10 +01:00
Futago-za Ryuu 5a833bd982 Moved all spec and benchmark tests
- Moved benchmark to test/benchmark
- Moved tests to test/spec
- Removed individual servers
- Implemented single test server
- Moved server assets to test/server
- Updated Gulpfile.js
- Moved tools/impact to test/impact

This commit move's nearly all code related to testing the PEG.js module into the test directory, and also ensures they run as they did before the move.
2017-10-02 04:35:46 +01:00