mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 13:59:54 +02:00
group jison loader and transformer
This commit is contained in:
12
jison/loader.js
Normal file
12
jison/loader.js
Normal 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();
|
||||
};
|
Reference in New Issue
Block a user