Browse Source

Fix plugin test that replaces parser

This test broke down aftert I intergrated the AST utils directly into the Grammar class, then I had problems importing the PEG.js parser to use the Grammar class, but found a workaround using 'process.cwd()'
master
Futago-za Ryuu 3 years ago
parent
commit
4b6ceb2b46
  1. 25
      test/spec/api/plugin-api.spec.js

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

@ -102,19 +102,20 @@ describe( "plugin API", function () {
config.parser = peg.generate( `
{
const pp = require( process.cwd() + "/lib/peg" ).parser;
}
start = .* {
return {
type: 'grammar',
rules: [{
type: 'rule',
name: 'start',
expression: {
type: 'literal',
value: text(),
ignoreCase: false
}
}]
};
return new pp.Grammar( void 0, [{
type: "rule",
name: "start",
expression: {
type: "literal",
value: text(),
ignoreCase: false
}
}] );
}
` );

Loading…
Cancel
Save