diff options
author | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-25 17:59:48 +0800 |
---|---|---|
committer | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-25 17:59:48 +0800 |
commit | 76f199888f65fd21ffdae7c3518748098fdc0726 (patch) | |
tree | 6f89e10613cf536e1f95d923dc451451edca67b2 /src/main.cpp | |
parent | 175b02f7934d574778c87028edc9a6ebb97d690c (diff) | |
download | mrust-76f199888f65fd21ffdae7c3518748098fdc0726.tar.gz |
Hacked in dumping as rust
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3c2a2787..9e533139 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,11 +75,12 @@ int main(int argc, char *argv[]) outfile += ".o";
}
- Serialiser_TextTree s_tt(::std::cout);
- Serialiser& s = s_tt;
+ //Serialiser_TextTree s_tt(::std::cout);
+ //Serialiser& s = s_tt;
try
{
AST::Crate crate = Parse_Crate(infile);
+ crate.post_parse();
//s << crate;
@@ -98,6 +99,8 @@ int main(int argc, char *argv[]) // > Forward pass first
Typecheck_Expr(crate);
+ Dump_Rust( FMT(outfile << ".rs").c_str(), crate );
+
if( strcmp(emit_type, "ast") == 0 )
{
::std::ofstream os(outfile);
@@ -116,5 +119,10 @@ int main(int argc, char *argv[]) ::std::cerr << "Parser Error: " << e.what() << ::std::endl;
return 2;
}
+ catch(const ::std::exception& e)
+ {
+ ::std::cerr << "Misc Error: " << e.what() << ::std::endl;
+ return 2;
+ }
return 0;
}
|