summaryrefslogtreecommitdiff
path: root/src/ast/ast.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-04-05 11:33:57 +0800
committerJohn Hodge <tpg@mutabah.net>2015-04-05 11:33:57 +0800
commit59cfce08eb46088f6fd1d4049cc8c7dbce355374 (patch)
tree6135d40eaedc41ea2ea3296887f7a59901693134 /src/ast/ast.hpp
parent1e02026fb0edb878361c1b7f59d30dae02f4abc9 (diff)
downloadmrust-59cfce08eb46088f6fd1d4049cc8c7dbce355374.tar.gz
Tag params with source, rewrite find_impl to return boolean
Diffstat (limited to 'src/ast/ast.hpp')
-rw-r--r--src/ast/ast.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp
index 2b60ba57..2f6ab45f 100644
--- a/src/ast/ast.hpp
+++ b/src/ast/ast.hpp
@@ -1,3 +1,10 @@
+/*
+ * MRustC - Rust Compiler
+ * - By John Hodge (Mutabah/thePowersGang)
+ *
+ * ast/ast.hpp
+ * - Core AST header
+ */
#ifndef AST_HPP_INCLUDED
#define AST_HPP_INCLUDED
@@ -755,7 +762,16 @@ public:
void post_parse();
- ::rust::option<Impl&> find_impl(const Path& trait, const TypeRef& type);
+ bool find_impl(const Path& trait, const TypeRef& type, Impl** out_impl);
+ ::rust::option<Impl&> find_impl(const Path& trait, const TypeRef& type) {
+ Impl* impl_ptr;
+ if( find_impl(trait, type, &impl_ptr) ) {
+ return ::rust::option<Impl&>(*impl_ptr);
+ }
+ else {
+ return ::rust::option<Impl&>();
+ }
+ }
Function& lookup_method(const TypeRef& type, const char *name);
void load_extern_crate(::std::string name);