mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
e0aae3e31f
This reverts commit c21c026749890990482f5f80993a86a3d1c5eef6.
15 lines
360 B
JavaScript
15 lines
360 B
JavaScript
const { Generator } = require('jison');
|
|
exports.transformJison = (src) => {
|
|
const parser = new Generator(src, {
|
|
moduleType: 'js',
|
|
'token-stack': true,
|
|
});
|
|
const source = parser.generate({ moduleMain: '() => {}' });
|
|
const exporter = `
|
|
parser.parser = parser;
|
|
export { parser };
|
|
export default parser;
|
|
`;
|
|
return `${source} ${exporter}`;
|
|
};
|