diff options
author | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-18 23:09:47 +0800 |
---|---|---|
committer | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-18 23:09:47 +0800 |
commit | b9c87bb2778ead7f353049e7078672f9a6f61f25 (patch) | |
tree | e7fa77feb4365ed6cc014b5e849eed495d40e738 /src | |
parent | 99da72da61653582d8e98075a7b3a03c36fc1976 (diff) | |
download | mrust-b9c87bb2778ead7f353049e7078672f9a6f61f25.tar.gz |
Starting on (framework) for in-function inferrence
Diffstat (limited to 'src')
-rw-r--r-- | src/convert/typecheck_expr.cpp | 29 | ||||
-rw-r--r-- | src/include/main_bindings.hpp | 1 | ||||
-rw-r--r-- | src/main.cpp | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/convert/typecheck_expr.cpp b/src/convert/typecheck_expr.cpp new file mode 100644 index 00000000..83becce1 --- /dev/null +++ b/src/convert/typecheck_expr.cpp @@ -0,0 +1,29 @@ +/* + */ +#include <main_bindings.hpp> +#include "ast_iterate.hpp" +#include "../common.hpp" +#include <stdexcept> + +// === PROTOTYPES === +class CTypeChecker: + public CASTIterator +{ +public: + virtual void handle_function(AST::Path& path, AST::Function& fcn) override; +}; + + +void CTypeChecker::handle_function(AST::Path& path, AST::Function& fcn) +{ + +} + +void Typecheck_Expr(AST::Crate& crate) +{ + DEBUG(" >>>"); + CTypeChecker tc; + tc.handle_module(AST::Path({}), crate.root_module()); + DEBUG(" <<<"); +} + diff --git a/src/include/main_bindings.hpp b/src/include/main_bindings.hpp index 00b90ef3..b7161edd 100644 --- a/src/include/main_bindings.hpp +++ b/src/include/main_bindings.hpp @@ -9,6 +9,7 @@ extern AST::Crate Parse_Crate(::std::string mainfile); extern void ResolvePaths(AST::Crate& crate); extern void Typecheck_GenericBounds(AST::Crate& crate); extern void Typecheck_GenericParams(AST::Crate& crate); +extern void Typecheck_Expr(AST::Crate& crate); extern AST::Flat Convert_Flatten(const AST::Crate& crate); #endif diff --git a/src/main.cpp b/src/main.cpp index c3952a35..3c2a2787 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -96,6 +96,7 @@ int main(int argc, char *argv[]) // - Typecheck statics and consts
// - Typecheck + propagate functions
// > Forward pass first
+ Typecheck_Expr(crate);
if( strcmp(emit_type, "ast") == 0 )
{
|