Skip to content

Commit

Permalink
Merge pull request #507 from leifg/convert-to-peggy
Browse files Browse the repository at this point in the history
Migrate to peggy
  • Loading branch information
leifg authored Apr 17, 2021
2 parents 4cbaa10 + 71a100a commit c054a7b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .scripts/make-pegjs.js → .scripts/make-peggy.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const { generate } = require('pegjs');
const { generate } = require('peggy');
const glob = require('glob');
const { basename } = require('path');
const { readFileSync, writeFileSync } = require('fs');

glob('grammars/**/*.pegjs', {},(err, files) => {
glob('grammars/**/*.peggy', {},(err, files) => {
if(err) {
console.error(err);
process.exit(1);
}
files.forEach(f => {
const grammar = readFileSync(f, 'utf8');
const outputName = basename(f, '.pegjs');
const outputName = basename(f, '.peggy');
writeFileSync(
`src/${outputName}.grammar.js`,
`export default ${generate(grammar, Object.assign({ output: 'source' }, {}))};`
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"build": "yarn compile:parser && yarn rollup -c",
"compile:parser": "node .scripts/make-pegjs",
"compile:parser": "node .scripts/make-peggy",
"test": "mocha --require @babel/register --recursive --grep @integration --invert",
"test:integration": "mocha --require @babel/register --recursive --grep @integration",
"lint": "eslint --ignore-path .gitignore .",
Expand Down Expand Up @@ -41,7 +41,7 @@
"eslint-plugin-import": "^2.20.2",
"glob": "^7.1.6",
"mocha": "^8.0.1",
"pegjs": "^0.10.0",
"peggy": "^1.0.0",
"rollup": "^2.26.5",
"rollup-plugin-terser": "^7.0.0",
"semantic-release": "^17.0.4"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5952,10 +5952,10 @@ pathval@^1.1.1:
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d"
integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==

pegjs@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd"
integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=
peggy@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/peggy/-/peggy-1.0.0.tgz#df6c7816c9df0ef35e071aaf96836cb866fe7eb4"
integrity sha512-lH12sxAXj4Aug+vH6IGoByIQOREIlhH+x4Uzb9kce6DD8wcGeidkC0JYEOwHormKrLt5BFLTbR4PuD/tiMOirQ==

performance-now@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit c054a7b

Please sign in to comment.