group jison loader and transformer

This commit is contained in:
Matthieu MOREL
2021-09-30 00:07:57 +02:00
committed by GitHub
parent d040883286
commit 9c48703fb1
8 changed files with 35 additions and 17 deletions

12
jison/loader.js Normal file
View File

@@ -0,0 +1,12 @@
const { Generator } = require('jison');
const { validate } = require('schema-utils');
const schema = require('./parser-options-schema.json');
module.exports = function jisonLoader(source) {
const options = this.getOptions();
validate(schema, options, {
name: 'Jison Loader',
baseDataPath: 'options',
});
return new Generator(source, options).generate();
};