feat: migrate to antlr4ng (#267)

* feat: replace antlr4ts with antlr4ng

* feat: switch caseInsensitive option on

* feat: recompile all g4 file

* feat:  update parser to fit antlr4ng

* test: update test to fit antlr4ng
This commit is contained in:
Hayden
2024-02-26 20:25:09 +08:00
committed by GitHub
parent 5ce89cb421
commit 195878da9b
112 changed files with 648433 additions and 659067 deletions

View File

@ -11,7 +11,7 @@ const outputPath = path.resolve(__dirname, '../src/lib');
const languageEntries = fs.readdirSync(grammarsPath);
const baseCmd = 'antlr4ts -visitor -listener -Xexact-output-dir -o';
const baseCmd = 'antlr4ng -Dlanguage=TypeScript -visitor -listener -Xexact-output-dir -o';
function compile(language) {
const cmd = `${baseCmd} ${outputPath}/${language} ${grammarsPath}/${language}/*.g4`;
@ -31,7 +31,7 @@ function compile(language) {
);
} else {
cleanComment(language);
console.log(chalk.greenBright(`Compile ${language} succeeded!`));
console.info(chalk.greenBright(`Compile ${language} succeeded!`));
}
});
}

View File

@ -53,15 +53,13 @@ function execStandardVersion(res) {
cmd += ` --tag-prefix ${tagPrefix} `;
cmd += ' --infile CHANGELOG.md ';
console.log(`Executing: ${cmd} \n`);
console.info(`Executing: ${cmd} \n`);
runCommand(cmd)
.then(({ message }) => {
console.log('Please checkout recent commit, and then');
console.log(
'Push branch and new tag to github, publish package to npm'
);
// message && console.log(message)
console.info('Please checkout recent commit, and then');
console.info('Push branch and new tag to github, publish package to npm');
// message && console.info(message)
})
.catch(({ error, code }) => {
code && console.error('Error: process exit code' + code);