From 6e8fa812d8ab6c148213eebc716f7433e6e6b557 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 21 May 2016 09:52:21 +0800 Subject: Main - Planning next passes --- src/main.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index df8ca562..4338487c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -120,8 +120,7 @@ int main(int argc, char *argv[]) CompilePhaseV("Resolve", [&]() { Resolve_Use(crate); // - Absolutise and resolve use statements Resolve_Index(crate); // - Build up a per-module index of avalable names (faster and simpler later resolve) - Resolve_Absolutise(crate); - //Resolve_UfcsPaths(crate); + Resolve_Absolutise(crate); // - Convert all paths to Absolute or UFCS, and resolve variables // OLD resolve code, kinda bad //ResolvePaths(crate); @@ -137,31 +136,34 @@ int main(int argc, char *argv[]) hir_crate = LowerHIR_FromAST(mv$( crate )); }); - // Replace type aliases (`type`) into the actual type + // Perform type checking on items + // - Replace type aliases (`type`) into the actual type CompilePhaseV("Resolve Type Aliases", [&]() { - // + //Typecheck_ExpandAliases(hir_crate); }); - - // Perform type checking on items - - // // Typecheck / type propagate module (type annotations of all values) // - Check all generic conditions (ensure referenced trait is valid) // > Also mark parameter with applicable traits CompilePhaseV("TypecheckBounds", [&]() { //Typecheck_GenericBounds(crate); }); - - // - Check all generic parameters match required conditions + // - Check all generic parameters match required conditions (without doing full typeck) CompilePhaseV("TypecheckParams", [&]() { //Typecheck_GenericParams(crate); }); - // - Typecheck statics and consts - // - Typecheck + propagate functions - // > Forward pass first + // - Full function typeck CompilePhaseV("TypecheckExpr", [&]() { //Typecheck_Expr(crate); }); + + // Expand closures into items + CompilePhaseV("Lower Closures", [&]() { + // + }); + // Lower expressions into MIR + CompilePhaseV("Lower MIR", [&]() { + // + }); CompilePhaseV("Output", [&]() { Dump_Rust( FMT(params.outfile << ".rs").c_str(), crate ); -- cgit v1.2.3