summaryrefslogtreecommitdiff
path: root/src/ast/ast.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/ast.hpp')
-rw-r--r--src/ast/ast.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp
index 2f6ab45f..671a0aa9 100644
--- a/src/ast/ast.hpp
+++ b/src/ast/ast.hpp
@@ -823,6 +823,26 @@ public:
}
+class GenericResolveClosure
+{
+ const AST::TypeParams& m_params;
+ const ::std::vector<TypeRef>& m_args;
+public:
+ GenericResolveClosure(const AST::TypeParams& params, const ::std::vector<TypeRef>& args):
+ m_params(params),
+ m_args(args)
+ {}
+ TypeRef operator()(const char *argname) {
+ for(unsigned int i = 0; i < m_params.ty_params().size(); i ++)
+ {
+ if( m_params.ty_params()[i].name() == argname ) {
+ return m_args.at(i);
+ }
+ }
+ throw ::std::runtime_error("BUGCHECK - Unknown arg in field type");
+ }
+};
+
extern AST::Module g_compiler_module;
extern void AST_InitProvidedModule();