chore: fix up main
This commit is contained in:
parent
86f72ee2b2
commit
f1f78e0af2
@ -32,6 +32,7 @@ using std::cout;
|
|||||||
using std::size_t;
|
using std::size_t;
|
||||||
using namespace ppc;
|
using namespace ppc;
|
||||||
using namespace ppc::comp::tree;
|
using namespace ppc::comp::tree;
|
||||||
|
using namespace ppc::comp::tree::ast;
|
||||||
|
|
||||||
void add_flags(options::parser_t &parser) {
|
void add_flags(options::parser_t &parser) {
|
||||||
parser.add_flag({
|
parser.add_flag({
|
||||||
@ -153,14 +154,17 @@ int main(int argc, const char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &file : files) {
|
for (const auto &file : files) {
|
||||||
std::ifstream f { file, std::ios_base::in };
|
try {
|
||||||
auto tokens = token_t::parse_many(msg_stack, lex::token_t::parse_file(msg_stack, file, f));
|
std::ifstream f { file, std::ios_base::in };
|
||||||
data::map_t ast;
|
auto tokens = token_t::parse_many(msg_stack, lex::token_t::parse_file(msg_stack, file, f));
|
||||||
if (!ast::ast_ctx_t::parse(msg_stack, tokens, ast)) continue;
|
auto ast = ast_ctx_t::parse(msg_stack, tokens);
|
||||||
|
|
||||||
std::cout << data::json::stringify(ast) << std::endl;
|
std::cout << data::json::stringify(ast) << std::endl;
|
||||||
|
}
|
||||||
|
catch (const messages::message_t &msg) {
|
||||||
|
msg_stack.push(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
throw 15.0f;
|
|
||||||
}
|
}
|
||||||
catch (const messages::message_t &msg) {
|
catch (const messages::message_t &msg) {
|
||||||
msg_stack.push(msg);
|
msg_stack.push(msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user