build: optimize cli and add eslint
This commit is contained in:
31
build/antlr4.js
Normal file
31
build/antlr4.js
Normal file
@ -0,0 +1,31 @@
|
||||
const path = require('path');
|
||||
const exec = require('child_process').exec;
|
||||
|
||||
const grammars = path.resolve(__dirname, '../src/grammar');
|
||||
|
||||
const languages = [
|
||||
'generic',
|
||||
'mysql',
|
||||
// 'oracle',
|
||||
// 'flink',
|
||||
// 'hive',
|
||||
// 'impala',
|
||||
// 'libra',
|
||||
// 'spark',
|
||||
// 'tidb'
|
||||
];
|
||||
|
||||
languages.forEach(language => {
|
||||
|
||||
exec(`npx antlr4-tool -l ts -o ${grammars}/${language}/parser ${grammars}/${language}/*.g4`, (error) => {
|
||||
console.log('error:', error)
|
||||
})
|
||||
|
||||
// const compiledResults = antlr4Tool.compile({
|
||||
// language: 'ts', // Only support for JavaScript & TypeScript
|
||||
// grammarFiles: [`${grammars}/${language}/*.g4`],
|
||||
// outputDirectory: `${grammars}/${language}/parser`
|
||||
// });
|
||||
|
||||
})
|
||||
|
0
build/release.js
Normal file
0
build/release.js
Normal file
Reference in New Issue
Block a user