summaryrefslogtreecommitdiff
path: root/ast/ast.cpp
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2014-12-05 20:35:11 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2014-12-05 20:35:11 +0800
commit1ac5429531c195755c7e1690912291e20e9a1717 (patch)
treec3462e2d16ccb07fc022874d094d837bfdb1fc67 /ast/ast.cpp
parent7f6170e7cb156bab7b5ac39b1abbe2c5f4e26204 (diff)
downloadmrust-1ac5429531c195755c7e1690912291e20e9a1717.tar.gz
Pattern and impl parsing working
Diffstat (limited to 'ast/ast.cpp')
-rw-r--r--ast/ast.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/ast/ast.cpp b/ast/ast.cpp
index bf86649b..1683bf91 100644
--- a/ast/ast.cpp
+++ b/ast/ast.cpp
@@ -13,11 +13,17 @@ Path::Path(Path::TagAbsolute)
{
}
+
+PathNode::PathNode(::std::string name, ::std::vector<TypeRef> args):
+ m_name(name),
+ m_params(args)
+{
+}
const ::std::string& PathNode::name() const
{
return m_name;
}
-const TypeParams& PathNode::args() const
+const ::std::vector<TypeRef>& PathNode::args() const
{
return m_params;
}
@@ -28,6 +34,21 @@ Pattern::Pattern(TagMaybeBind, ::std::string name)
Pattern::Pattern(TagValue, ExprNode node)
{
}
+Pattern::Pattern(TagEnumVariant, Path path, ::std::vector<Pattern> sub_patterns)
+{
+}
+
+
+Function::Function(::std::string name, TypeParams params, TypeRef ret_type, ::std::vector<StructItem> args, Expr code)
+{
+}
+
+Impl::Impl(TypeRef impl_type, TypeRef trait_type)
+{
+}
+void Impl::add_function(bool is_public, Function fcn)
+{
+}
void Module::add_constant(bool is_public, ::std::string name, TypeRef type, Expr val)
{
@@ -41,7 +62,10 @@ void Module::add_global(bool is_public, bool is_mut, ::std::string name, TypeRef
void Module::add_struct(bool is_public, ::std::string name, TypeParams params, ::std::vector<StructItem> items)
{
}
-void Module::add_function(bool is_public, ::std::string name, TypeParams params, TypeRef ret_type, ::std::vector<StructItem> args, Expr code)
+void Module::add_function(bool is_public, Function func)
+{
+}
+void Module::add_impl(Impl impl)
{
}