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 7 years ago
parent b0a5db1ab9
commit 4b6ceb2b46

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