Skip to content

Commit

Permalink
Replace cherow with meriyah
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwade committed Apr 9, 2021
1 parent 1443fa8 commit 2a93aed
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 115 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -162,10 +162,10 @@ There are several examples in the [examples] directory.

- [acorn]
- [@babel/parser]
- [cherow]
- [espree]
- [esprima]
- [flow]
- [meriyah]
- [shift-parser]

- Code generators:
Expand Down Expand Up @@ -298,7 +298,6 @@ You need [Node.js] 10 and npm 7.
[@babel/generator]: https://github.com/babel/babel/tree/master/packages/babel-generator
[@babel/parser]: https://babeljs.io/docs/en/next/babel-parser.html
[acorn]: https://github.com/ternjs/acorn
[cherow]: https://github.com/cherow/cherow
[ci-badge]: https://github.com/lydell/eslump/actions/workflows/test.yml/badge.svg
[ci-link]: https://github.com/lydell/eslump/actions
[doctoc]: https://github.com/thlorenz/doctoc/
Expand All @@ -310,6 +309,7 @@ You need [Node.js] 10 and npm 7.
[examples]: https://github.com/lydell/eslump/tree/master/examples
[flow]: https://github.com/facebook/flow
[jest]: https://jestjs.io/
[meriyah]: https://github.com/meriyah/meriyah
[node.js]: https://nodejs.org/en/
[npm]: https://www.npmjs.com/
[prettier]: https://github.com/prettier/prettier/
Expand Down
12 changes: 0 additions & 12 deletions examples/cherow.js

This file was deleted.

10 changes: 10 additions & 0 deletions examples/meriyah.js
@@ -0,0 +1,10 @@
"use strict";

const meriyah = require("meriyah");
const testParser = require("./parser");

function parse(code, { sourceType }) {
return meriyah.parse(code, { module: sourceType === "module" });
}

module.exports = testParser(parse);
109 changes: 16 additions & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -46,7 +46,6 @@
"@babel/generator": "7.13.9",
"@babel/parser": "7.13.15",
"acorn": "8.1.0",
"cherow": "1.6.8",
"doctoc": "1.4.0",
"escodegen": "1.11.0",
"eslint": "5.9.0",
Expand All @@ -58,6 +57,7 @@
"esprima": "4.0.1",
"flow-parser": "0.87.0",
"jest": "24.8.0",
"meriyah": "4.1.2",
"prettier": "2.2.1",
"rimraf": "2.6.2",
"shift-parser": "7.0.3",
Expand Down
14 changes: 7 additions & 7 deletions test/cli.test.js
Expand Up @@ -556,43 +556,43 @@ describe("parse errors", () => {
expect(
loop(
1,
run(["examples/cherow.js", "test/fixtures/repro-parse-error", "-r"])
run(["examples/meriyah.js", "test/fixtures/repro-parse-error", "-r"])
)
).toMatchInlineSnapshot(`
Array [
Object {
"code": 1,
"message": "Attempt 1: The test function returned an error:
SyntaxError: Line 4, column 14: Unexpected token 'identifier'
SyntaxError: [4:15]: Unexpected token: 'identifier'
<stack trace>
2 |
3 | function add(a, b) {
> 4 | return a ++ b;
| ^
| ^
5 | }
6 |",
},
]
`);
});

test("cherow", () => {
test("meriyah", () => {
expect(
loop(
1,
run(["examples/cherow.js", "test/fixtures/repro-parse-error", "-r"])
run(["examples/meriyah.js", "test/fixtures/repro-parse-error", "-r"])
)
).toMatchInlineSnapshot(`
Array [
Object {
"code": 1,
"message": "Attempt 1: The test function returned an error:
SyntaxError: Line 4, column 14: Unexpected token 'identifier'
SyntaxError: [4:15]: Unexpected token: 'identifier'
<stack trace>
2 |
3 | function add(a, b) {
> 4 | return a ++ b;
| ^
| ^
5 | }
6 |",
},
Expand Down

0 comments on commit 2a93aed

Please sign in to comment.