Browse Source

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'
master
Futago-za Ryuu 4 years ago
parent
commit
1b20aa5427
  1. 2
      bin/options.js
  2. 2
      test/README.md
  3. 2
      test/benchmark/runner.js
  4. 3
      test/node_modules/pegjs-dev.js
  5. 2
      test/spec/api/generated-parser-api.spec.js
  6. 2
      test/spec/api/pegjs-api.spec.js
  7. 2
      test/spec/api/plugin-api.spec.js
  8. 2
      test/spec/behavior/generated-parser-behavior.spec.js
  9. 2
      test/spec/unit/compiler/passes/generate-bytecode.spec.js
  10. 2
      test/spec/unit/compiler/passes/helpers.js
  11. 2
      test/spec/unit/compiler/passes/remove-proxy-rules.spec.js
  12. 2
      test/spec/unit/compiler/passes/report-duplicate-labels.spec.js
  13. 2
      test/spec/unit/compiler/passes/report-duplicate-rules.spec.js
  14. 2
      test/spec/unit/compiler/passes/report-infinite-recursion.spec.js
  15. 2
      test/spec/unit/compiler/passes/report-infinite-repetition.spec.js
  16. 2
      test/spec/unit/compiler/passes/report-undefined-rules.spec.js
  17. 2
      test/spec/unit/parser.spec.js

2
bin/options.js

@ -2,7 +2,7 @@
const fs = require( "fs" );
const path = require( "path" );
const peg = require( "../" );
const peg = require( "../lib/peg" );
// Options

2
test/README.md

@ -6,6 +6,8 @@ This directory contains various test suites and scripts to ensure PEG.js works c
* [Benchmark Suite](benchmark): It measures speed of the parsers generated by PEG.js on various inputs. Its main goal is to provide data for code generator optimizations.
* [Impact Script](impact): Measures impact of a Git commit (or multiple commits) on generated parsers speed and size.
> Note: The package `pegjs-dev`, used by the benchmark and spec modules within this directory, points to '[test/node_modules/pegjs-dev.js](node_modules/pegjs-dev.js)', which is an alias module for '[lib/peg.js](../lib/peg.js)'
## Download and Install
To run the PEG.js test suites you most download the and install the module via the git repository:

2
test/benchmark/runner.js

@ -1,6 +1,6 @@
"use strict";
const peg = require( "../../lib/peg" );
const peg = require( "pegjs-dev" );
const Runner = {
run( benchmarks, runCount, options, callbacks ) {

3
test/node_modules/pegjs-dev.js

@ -0,0 +1,3 @@
"use strict";
module.exports = require( "../../lib/peg" );

2
test/spec/api/generated-parser-api.spec.js

@ -1,7 +1,7 @@
"use strict";
const chai = require( "chai" );
const peg = require( "../../../lib/peg" );
const peg = require( "pegjs-dev" );
const sinon = require( "sinon" );
const expect = chai.expect;

2
test/spec/api/pegjs-api.spec.js

@ -1,7 +1,7 @@
"use strict";
const chai = require( "chai" );
const peg = require( "../../../lib/peg" );
const peg = require( "pegjs-dev" );
const sinon = require( "sinon" );
const expect = chai.expect;

2
test/spec/api/plugin-api.spec.js

@ -1,7 +1,7 @@
"use strict";
const chai = require( "chai" );
const peg = require( "../../../lib/peg" );
const peg = require( "pegjs-dev" );
const expect = chai.expect;

2
test/spec/behavior/generated-parser-behavior.spec.js

@ -1,7 +1,7 @@
"use strict";
const chai = require( "chai" );
const peg = require( "../../../lib/peg" );
const peg = require( "pegjs-dev" );
const sinon = require( "sinon" );
const expect = chai.expect;

2
test/spec/unit/compiler/passes/generate-bytecode.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/generate-bytecode" );
const pass = require( "pegjs-dev" ).compiler.passes.generate.generateBytecode;
chai.use( helpers );

2
test/spec/unit/compiler/passes/helpers.js

@ -1,6 +1,6 @@
"use strict";
const parser = require( "../../../../../lib/parser" );
const parser = require( "pegjs-dev" ).parser;
module.exports = function ( chai, utils ) {

2
test/spec/unit/compiler/passes/remove-proxy-rules.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/remove-proxy-rules" );
const pass = require( "pegjs-dev" ).compiler.passes.transform.removeProxyRules;
chai.use( helpers );

2
test/spec/unit/compiler/passes/report-duplicate-labels.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/report-duplicate-labels" );
const pass = require( "pegjs-dev" ).compiler.passes.check.reportDuplicateLabels;
chai.use( helpers );

2
test/spec/unit/compiler/passes/report-duplicate-rules.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/report-duplicate-rules" );
const pass = require( "pegjs-dev" ).compiler.passes.check.reportDuplicateRules;
chai.use( helpers );

2
test/spec/unit/compiler/passes/report-infinite-recursion.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/report-infinite-recursion" );
const pass = require( "pegjs-dev" ).compiler.passes.check.reportInfiniteRecursion;
chai.use( helpers );

2
test/spec/unit/compiler/passes/report-infinite-repetition.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/report-infinite-repetition" );
const pass = require( "pegjs-dev" ).compiler.passes.check.reportInfiniteRepetition;
chai.use( helpers );

2
test/spec/unit/compiler/passes/report-undefined-rules.spec.js

@ -2,7 +2,7 @@
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "../../../../../lib/compiler/passes/report-undefined-rules" );
const pass = require( "pegjs-dev" ).compiler.passes.check.reportUndefinedRules;
chai.use( helpers );

2
test/spec/unit/parser.spec.js

@ -1,7 +1,7 @@
"use strict";
const chai = require( "chai" );
const parser = require( "../../../lib/parser" );
const parser = require( "pegjs-dev" ).parser;
const expect = chai.expect;

Loading…
Cancel
Save