summaryrefslogtreecommitdiff
path: root/src/ast/path.hpp
diff options
context:
space:
mode:
authorJohn Hodge (sonata) <tpg@mutabah.net>2015-01-11 15:00:32 +0800
committerJohn Hodge (sonata) <tpg@mutabah.net>2015-01-11 15:00:32 +0800
commit86938c184b32ce004d5247ad80f924f0ae7a3c86 (patch)
tree66dfdee288a8f3806dd869a9bccb910b8c854ab6 /src/ast/path.hpp
parentd9cba0738c5fe7928ea345f510f505fe777fd8ea (diff)
downloadmrust-86938c184b32ce004d5247ad80f924f0ae7a3c86.tar.gz
Add hacky text output of AST
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r--src/ast/path.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index f990dedb..b518fc8f 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -9,6 +9,7 @@
#include <vector>
#include <initializer_list>
#include <cassert>
+#include <serialise.hpp>
class TypeRef;
@@ -21,7 +22,8 @@ class Struct;
class Function;
-class PathNode
+class PathNode:
+ public ::Serialisable
{
::std::string m_name;
::std::vector<TypeRef> m_params;
@@ -41,9 +43,12 @@ public:
}
return os;
}
+
+ SERIALISABLE_PROTOTYPES();
};
-class Path
+class Path:
+ public ::Serialisable
{
public:
enum BindingType {
@@ -145,8 +150,10 @@ public:
PathNode& operator[](size_t idx) { return m_nodes[idx]; }
const PathNode& operator[](size_t idx) const { return m_nodes[idx]; }
-
+
+ SERIALISABLE_PROTOTYPES();
friend ::std::ostream& operator<<(::std::ostream& os, const Path& path);
+ friend ::Serialiser& operator<<(Serialiser& s, Path::Class pc);
private:
void bind_module(const Module& mod);
void bind_enum(const Enum& ent, const ::std::vector<TypeRef>& args);