Skip to content

Commit

Permalink
Merge pull request #458 from hildjj/update
Browse files Browse the repository at this point in the history
Update dependencies
hildjj authored Jan 27, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
2 parents 2e3cfd4 + c14e8ae commit e7e0c86
Showing 15 changed files with 371 additions and 272 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ module.exports = {
"build",
],
parserOptions: {
project: "tsconfig.json",
project: true,
},
overrides: [
{
8 changes: 4 additions & 4 deletions lib/compiler/passes/generate-bytecode.js
Original file line number Diff line number Diff line change
@@ -579,10 +579,10 @@ function generateBytecode(ast, options) {
buildCondition(
SOMETIMES_MATCH,
checkCode, // if (result.length < min) {
/* eslint-disable indent -- Clarity */
/* eslint-disable @stylistic/indent -- Clarity */
[op.POP, op.POP_CURR_POS, // currPos = savedPos; stack:[ ]
op.PUSH_FAILED], // result = peg$FAILED; stack:[ peg$FAILED ]
/* eslint-enable indent */
/* eslint-enable @stylistic/indent */
[op.NIP] // } stack:[ [elem...] ]
)
);
@@ -623,11 +623,11 @@ function generateBytecode(ast, options) {
-expressionMatch,
[op.IF_ERROR], // if (item === peg$FAILED) {
// If element FAILED, rollback currPos to saved value.
/* eslint-disable indent -- Clarity */
/* eslint-disable @stylistic/indent -- Clarity */
[op.POP, // stack:[ pos ]
op.POP_CURR_POS, // peg$currPos = pos; stack:[ ]
op.PUSH_FAILED], // item = peg$FAILED; stack:[ peg$FAILED ]
/* eslint-enable indent */
/* eslint-enable @stylistic/indent */
// Else, just drop saved currPos.
[op.NIP] // } stack:[ item ]
)
4 changes: 2 additions & 2 deletions lib/compiler/passes/generate-js.js
Original file line number Diff line number Diff line change
@@ -1413,7 +1413,7 @@ function generateJS(ast, options) {

return new SourceNode(
// This expression has a better readability when on two lines
// eslint-disable-next-line function-call-argument-newline
// eslint-disable-next-line @stylistic/function-call-argument-newline
null, null, options.grammarSource,
parts.map(s => (s instanceof SourceNode ? s : s + "\n"))
);
@@ -1653,7 +1653,7 @@ function generateJS(ast, options) {
const parts = generators[options.format || "bare"]();

return new SourceNode(
// eslint-disable-next-line function-call-argument-newline -- This expression has a better readability when on two lines
// eslint-disable-next-line @stylistic/function-call-argument-newline -- This expression has a better readability when on two lines
null, null, options.grammarSource,
parts.map(s => (s instanceof SourceNode ? s : s + "\n"))
);
24 changes: 12 additions & 12 deletions lib/peg.d.ts
Original file line number Diff line number Diff line change
@@ -125,13 +125,13 @@ declare namespace ast {
* Added by the `generateBytecode` pass and contain data for
* bytecodes to refer back to via index.
*/
literals?: string[];
classes?: GrammarCharacterClass[];
expectations?: GrammarExpectation[];
importedNames?: string[];
functions?: FunctionConst[];
locations?: LocationRange[];
}
literals?: string[];
classes?: GrammarCharacterClass[];
expectations?: GrammarExpectation[];
importedNames?: string[];
functions?: FunctionConst[];
locations?: LocationRange[];
}

/**
* Base interface for all initializer nodes with the code.
@@ -222,11 +222,11 @@ declare namespace ast {
interface Action extends CodeBlockExpr<"action"> {
expression: (
Labeled
| Prefixed
| Primary
| Repeated
| Sequence
| Suffixed
| Prefixed
| Primary
| Repeated
| Sequence
| Suffixed
);
}

467 changes: 275 additions & 192 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -53,17 +53,18 @@
"start": "cd docs && npm start"
},
"devDependencies": {
"@peggyjs/eslint-config": "^3.0.6",
"@peggyjs/eslint-config": "^3.1.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-multi-entry": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.5",
"@rollup/plugin-typescript": "^11.1.6",
"@stylistic/eslint-plugin": "1.5.4",
"@types/chai": "^4.3.11",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.7",
"@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0",
"@types/node": "^20.11.8",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"chai": "^4.3.11",
"chai-like": "^1.1.1",
"copyfiles": "^2.4.1",
@@ -72,11 +73,11 @@
"glob": "^10.3.10",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
"rollup": "^4.9.4",
"rollup": "^4.9.6",
"rollup-plugin-ignore": "1.0.10",
"source-map": "^0.8.0-beta.0",
"terser": "^5.26.0",
"ts-jest": "^29.1.1",
"terser": "^5.27.0",
"ts-jest": "^29.1.2",
"tslib": "^2.6.2",
"typescript": "^5.3.3"
},
2 changes: 1 addition & 1 deletion test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@
"mocha": true
},
"parserOptions": {
"project": ["test/tsconfig.json", "test/tsconfig-cli.json"]
"project": true
}
}
3 changes: 3 additions & 0 deletions test/cli/run.spec.ts
Original file line number Diff line number Diff line change
@@ -1126,6 +1126,8 @@ bar = '2'
error: "Error running test",
});

// Abusing template literals to ensure we have a trailing space.
/* eslint-disable @typescript-eslint/no-useless-template-literals */
await exec({
args: ["-t", ""],
stdin: "foo='1'",
@@ -1140,6 +1142,7 @@ Error: Expected "1" but end of input found.
| ^`,
});
});
/* eslint-enable @typescript-eslint/no-useless-template-literals */

it("handles stdout errors", async() => {
const stderr = new MockStream({ name: "stderr", encoding: "utf8" });
12 changes: 12 additions & 0 deletions test/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig-base.json",
"include": ["**/*.ts"],
"exclude": ["./fixtures/bad.js"],
"compilerOptions": {
"outDir": "../../build/ts-cli"
},
"references": [
{ "path": "../../bin" },
{ "path": "../../lib" }
]
}
12 changes: 0 additions & 12 deletions test/tsconfig-cli.json

This file was deleted.

3 changes: 2 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"exclude": ["./cli/**/*", "./types/**/*"],
"references": [
{ "path": "../lib" },
{ "path": "./tsconfig-cli.json" }
{ "path": "./cli" },
{ "path": "./types" }
]
}
2 changes: 1 addition & 1 deletion test/types/peg.test-d.ts
Original file line number Diff line number Diff line change
@@ -508,7 +508,7 @@ describe("peg.d.ts", () => {
// Extract the keys from the visitor object
type DefinedKeys
= typeof visit extends peggy.compiler.visitor.Visitor<infer U>
? keyof U : never;
? keyof U : never;

visit(grammar);

11 changes: 11 additions & 0 deletions test/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../tsconfig-base.json",
"include": ["**/*.ts"],
"compilerOptions": {
"outDir": "../../build/ts-cli"
},
"references": [
{ "path": "../../bin" },
{ "path": "../../lib" }
]
}
74 changes: 37 additions & 37 deletions web-test/package-lock.json
2 changes: 1 addition & 1 deletion web-test/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"author": "Joe Hildebrand <joe-github@cursive.net>",
"license": "MIT",
"devDependencies": {
"puppeteer": "^21.7.0"
"puppeteer": "^21.9.0"
},
"engines": {
"node": ">=16"

0 comments on commit e7e0c86

Please sign in to comment.