feat(dev): 支持 compiler --help 输出帮助信息
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user