feat(dev): 支持 compiler --help 输出帮助信息

This commit is contained in:
Lane0218
2025-12-30 12:33:36 +08:00
parent c0c9f70f16
commit 9eefbb5ef7
5 changed files with 55 additions and 4 deletions

View File

@@ -7,11 +7,16 @@
#include "irgen/IRGen.h"
#include "sem/Sema.h"
#include "utils/CLI.h"
#include "utils/Log.h"
#include "ast/AstNodes.h"
int main(int argc, char** argv) {
try {
auto opts = ParseCLI(argc, argv);
if (opts.show_help) {
PrintHelp(std::cout);
return 0;
}
auto antlr = ParseFileWithAntlr(opts.input);
auto ast = BuildAst(antlr.tree);
ast::PrintAST(*ast); // 调试 AST