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 7 years ago
parent 03cc2eae95
commit 1b20aa5427

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

@ -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:

@ -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 generated vendored

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

@ -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;

@ -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;

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

@ -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,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 );

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

@ -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,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,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,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,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,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 );

@ -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