Skip to content

Commit 35bf144

Browse files
committed
More fixing of the parser package
1 parent 8488af5 commit 35bf144

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

dm-lezer/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
src/parser.ts
33
src/parser.terms.ts
4+
src/*.js
5+
bin/*.js

dm-lezer/jest.config.cjs

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ const config = {
33
watchPathIgnorePatterns: [
44
"<rootDir>/src/parser.ts",
55
"<rootDir>/src/parser.terms.ts",
6+
"<rootDir>/(src|bin)/.*\.js",
67
"<rootDir>/node_modules",
78
],
89
moduleFileExtensions: ["js", "ts", "cjs", "test", "grammar"],
10+
testPathIgnorePatterns: ["/node_modules/", "test.js"],
911
extensionsToTreatAsEsm: [".ts"],
1012
resolver: "jest-ts-webcompat-resolver",
1113
};

dm-lezer/package-lock.json

+16-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dm-lezer/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"@types/node": "^20.14.10",
99
"jest": "^30.0.0-alpha.5",
1010
"jest-ts-webcompat-resolver": "^1.0.0",
11-
"tsx": "^4.16.2"
11+
"tsx": "^4.16.2",
12+
"typescript": "^5.5.3"
1213
},
1314
"dependencies": {
1415
"@lezer/lr": "^1.4.1"

dm-lezer/src/build.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { buildParserFile } from '@lezer/generator';
22
import * as fs from 'node:fs';
33
import * as path from 'node:path';
44
import { LRParser } from '@lezer/lr';
5+
import * as child_process from 'node:child_process';
56

67
export async function buildDmGrammar(): Promise<LRParser> {
78
const grammar = fs.readFileSync(
@@ -13,5 +14,6 @@ export async function buildDmGrammar(): Promise<LRParser> {
1314
});
1415
fs.writeFileSync(path.join(import.meta.dirname, 'parser.ts'), parser);
1516
fs.writeFileSync(path.join(import.meta.dirname, 'parser.terms.ts'), terms);
17+
child_process.execSync('npx tsc');
1618
return (await import(path.join(import.meta.dirname, 'parser.ts'))).parser;
1719
}

dm-lezer/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
6060
// "outDir": "./", /* Specify an output folder for all emitted files. */
6161
// "removeComments": true, /* Disable emitting comments. */
62-
"noEmit": true,
63-
/* Disable emitting files from a compilation. */
62+
// "noEmit": true, /* Disable emitting files from a compilation. */
6463
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
6564
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
6665
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

0 commit comments

Comments
 (0)