258 Commits (cf022429bb7af01eb4da1e289e88b7dd5013d160)

Author SHA1 Message Date
Futago-za Ryuu cf022429bb Cleanup and Update
- Update all dependencies
- Use '@futagoza/*' ESLint configurations
- Remove redundent '@pegjs/eslint-config'
- Add TypeScript support to the bundler
5 years ago
Futago-za Ryuu d08e8bf52d Upgrade devDependencies
- codecov: 3.3.0
- eslint: 5.16.0
- mocha: 6.1.3
- mocha-junit-reporter: 1.22.0
- nyc: 14.0.0
- vuepress: 1.0.0-alpha.47
- sinon: 7.3.2
- @babel/core: 7.4.3
- @babel/preset-env: 7.4.3
- webpack: 4.30.0
5 years ago
Futago-za Ryuu 138fb96aed Use progress reporter for faster local testing 5 years ago
Futago-za Ryuu fae001e4ed Upgrade devDependencies:
- codecov: 3.2.0
- eslint: 5.15.3
- eslint-config-futagozaryuu: 5.8.0
- eslint-plugin-vue: 5.2.2
- mocha: 6.0.3
- nyc: 13.3.0
- vuepress: 1.0.0-alpha.44
- sinon: 7.3.0
- @babel/core: 7.4.0
- @babel/preset-env: 7.4.2
- webpack: 4.29.6
- webpack-cli: 3.3.0
5 years ago
Futago-za Ryuu 703fbbf8d0 Ensure mocha only finds test files 6 years ago
Futago-za Ryuu caa8b4cf7b Use html reporter for mocha browser 6 years ago
Futago-za Ryuu fcbfa39102 Ensure mocha runs on the browser 6 years ago
Futago-za Ryuu ed6690e5bb Use mocha/mocha.js 6 years ago
Futago-za Ryuu 6525825f2e Use mocha-loader 6 years ago
Futago-za Ryuu 7a78b7cfdf Upgrade dependencies 6 years ago
Futago-za Ryuu 9906f21c57 Update output for mocha-junit-reporter 6 years ago
Futago-za Ryuu 2dc0a1b64a Upgrade dependencies 6 years ago
Futago-za Ryuu bdde25a9e4
Set up CI with Azure Pipelines (#596)
* Add support for Azure Pipelines
* Remove Travis CI support
* coverage: Generate cobertura and lcov reports only
* Add support for Code Climate
6 years ago
Futago-za Ryuu 9751980261 Remove unrequired ESLint rules 6 years ago
Futago-za Ryuu 93ceeff597 General QOL changes
- Added 'test/package.json' for dependencies used by spec tests
- Changed package names of local tools to reflect actual usage
- Removed bins for local tools (using files via 'node [file]' command)
- Updated help text for the CLIs of local tools to reflect changes
- Updated READMEs for tools
- Moved babel dependencies to 'tools/bundle/package.json'
- 'tools/bundle' now only logs created and watching
- Updated scripts in root package.json
6 years ago
Futago-za Ryuu 390478d61e Move test/spec to test 6 years ago
Futago-za Ryuu 163ff20508 Move test/benchmark to tools/benchmark 6 years ago
Futago-za Ryuu 9c039ce79b Move test/impact to tools/impact 6 years ago
Futago-za Ryuu 14b8b76a79 runInContext -> evalModule 6 years ago
Futago-za Ryuu e64118f3b7 Update src/parser.pegjs
- use value plucking
- remove helpers not needed now
- types in OPS_* are now returned by *Operator
- RESERVED_WORDS is now a `Object<Identifier,true>`
- use ES2015+ JavaScript
- cleanup source code
6 years ago
Futago-za Ryuu 460f0cc5bc Implement value plucking
Resolves #235, #427, #545
6 years ago
Futago-za Ryuu dd044b8cfb remove extronous files 6 years ago
Futago-za Ryuu dd76ff85d4 Update execution files 6 years ago
Futago-za Ryuu be88239543 Move PEG.js to packages/pegjs
* Move PEG.js from . to packages/pegjs
* Update relevanr paths
* Remove pegjs-dev; Use pegjs directly
* Generate browser files at packages/pegjs/dist
* nyc: exclude website
* website: keep packages folder
* Root package.json is private now
6 years ago
Futago-za Ryuu 5e7134936b Merge the test suites into the website 6 years ago
Futago-za Ryuu 60f69d6558 Stop ESLint warnings
- about use of eval
- whitespace before comments
6 years ago
Futago-za Ryuu b31009f73d Use peg.util.reservedWords 7 years ago
Futago-za Ryuu 30cfa29553 Provide context to parser (#517) 7 years ago
Futago-za Ryuu 6500189d58 Report unused rules (Closes #200) 7 years ago
Futago-za Ryuu 851d8edfdd Implement warning emitter (Closes #327) 7 years ago
Futago-za Ryuu f4c67993f6 Added the Session API 7 years ago
Futago-za Ryuu 5476eca59f Moved AST and visitor classes 7 years ago
Futago-za Ryuu 4b6ceb2b46 Fix plugin test that replaces parser
This test broke down aftert I intergrated the AST utils directly into the Grammar class, then I had problems importing the PEG.js parser to use the Grammar class, but found a workaround using 'process.cwd()'
7 years ago
Futago-za Ryuu 9ecb21b749 stripLocation > stripProperties 7 years ago
Mingun 0dab14d652 Add ability to extract comments from the grammar (#511)
All comments stored in the `comments` property of the `grammar` node.
Comments extracted only if the `extractComments` options set to `true` when you generate parser.
This property is object with mapping start offset of comment to comment object, that looks like:

```js
{
  text: 'text in the comment, just after // or /* and before */',
  multiline: true|false,// true for /**/ comments, false for // comments
  location: location()
}
```
7 years ago
Futago-za Ryuu f5b323b401 Report consistent errors on look ahead + cached results
This should resolve issue #452, and is based entirely on a fix @nikku did on a local branch of PEG.js v0.10.0 (Currently at https://github.com/nikku/pegjs/tree/452-peg-js-0.10-fix).

Also his test case from #555 is included.

Fixes #452, Closes #555
7 years ago
Mingun 9b90fa1d81 Move all codegeneration from `generateBytecode` pass to `generateJs` pass (#459)
* Split 'consts' collection by content types into:

  - literals: for literal expressions, like `"a"`
  - classes: for character class expressions, like `[a]`
  - expectations: for constants describing expected values when parse failed
  - functions: for constants with function code

* Move any JavaScript code generation from 'generateBytecode' to 'generateJs'.
* Rename opcode 'MATCH_REGEXP' to 'MATCH_CLASS' (name reflects purpose, not implementation).
* Replace 'PUSH' opcode with 'PUSH_EMPTY_STRING' opcode because it is only used with empty strings
7 years ago
Futago-za Ryuu 7cdfc03e9f Added utility methods for objects
Before there used to be some internal utility methods for arrays and objects, but as the code base moved to ES5+ use  case only, these were removed in favour of native alternatives, but most of these were only beneficial for arrays.

This commit add's common utility methods for objects, and also exposes these as they can be used by plugin developer's on the PEG.js AST.
7 years ago
Futago-za Ryuu b0056d7a9f Merge branch 'master' of github.com:pegjs/pegjs 7 years ago
Mingun 4cc9185a78 Improve error when reserved word used as label (#552)
Before this commit error looks like (for input `start = break:'a'`)

> Expected "!", "$", "&", "(", "*", "+", ".", "/", "/*", "//", ";", "?", character class, code block, comment, end of line, identifier, literal, or whitespace but ":" found.

After this error looks like

> Label can't be a reserved word "break".
7 years ago
Futago-za Ryuu 1434346332 Move require statement to the top 7 years ago
Mingun fde1c480f4 Use chai-like instead of own properties matcher (#550) 7 years ago
Mingun 534dc53ac2 Optimize redundant fail checks (#400)
eliminate unnecessary checks for the result of parse, when it can be statically determined
7 years ago
Futago-za Ryuu 92f1798308 Moved Babel options to .babelrc 7 years ago
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).
7 years ago
Mingun a7a0a0d9ac Bump devDependencies (#549)
- Removed: babel-preset-es2015@6.24.1
- Added: babel-preset-env@1.6.1
- Updated: gulp-mocha@5.0.0
- Updated: nyc@11.4.1
- Updated: vinyl-buffer@1.0.1
- Updated: vinyl-source-stream@2.0.0
7 years ago
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
7 years ago
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'
7 years ago
Mingun 3e89534bb7 Auto-add `allowedStartRules` to test options for `changeAST` and `reportError` methods if it not defined 7 years ago
Futago-za Ryuu 881eb67545 Removed redundant css files
The css files used in the benchmark contained 2 files for IE that contained syntax errors. These files weren't actually used by the benchmark, but were still in the repository.
7 years ago