diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 9e533139..6aeba895 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,6 +11,17 @@ int g_debug_indent_level = 0;
+::std::string g_cur_phase;
+
+bool debug_enabled()
+{
+
+ return true;
+}
+::std::ostream& debug_output(int indent, const char* function)
+{
+ return ::std::cout << g_cur_phase << "- " << RepeatLitStr { " ", indent } << function << ": ";
+}
/// main!
int main(int argc, char *argv[])
@@ -79,26 +90,35 @@ int main(int argc, char *argv[]) //Serialiser& s = s_tt;
try
{
+ g_cur_phase = "Parse";
AST::Crate crate = Parse_Crate(infile);
+ g_cur_phase = "PostParse";
crate.post_parse();
//s << crate;
// Resolve names to be absolute names (include references to the relevant struct/global/function)
+ g_cur_phase = "Resolve";
ResolvePaths(crate);
//s << crate;
// Typecheck / type propagate module (type annotations of all values)
// - Check all generic conditions (ensure referenced trait is valid)
// > Also mark parameter with applicable traits
+ #if 0
+ g_cur_phase = "TypecheckBounds";
Typecheck_GenericBounds(crate);
// - Check all generic parameters match required conditions
+ g_cur_phase = "TypecheckParams";
Typecheck_GenericParams(crate);
// - Typecheck statics and consts
// - Typecheck + propagate functions
// > Forward pass first
- Typecheck_Expr(crate);
+ //g_cur_phase = "TypecheckExpr";
+ //Typecheck_Expr(crate);
+ #endif
+ g_cur_phase = "Output";
Dump_Rust( FMT(outfile << ".rs").c_str(), crate );
if( strcmp(emit_type, "ast") == 0 )
@@ -109,6 +129,7 @@ int main(int argc, char *argv[]) return 0;
}
// Flatten modules into "mangled" set
+ g_cur_phase = "Flatten";
AST::Flat flat_crate = Convert_Flatten(crate);
// Convert structures to C structures / tagged enums
|