From 2a68eb6a8ae1e1635b1d3a39bf0b3bf1a9b87ff6 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Sat, 17 Jan 2015 20:58:55 +0800 Subject: Refactor resolve.cpp AST iterating into common function --- src/ast/ast.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ast/ast.cpp') diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index be4c9400..c8cf8188 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -68,6 +68,10 @@ SERIALISE_TYPE_S(Pattern, { }); +::std::ostream& operator<<(::std::ostream& os, const Impl& impl) +{ + return os << "impl<" << impl.m_params << "> " << impl.m_trait << " for " << impl.m_type << ""; +} SERIALISE_TYPE(Impl::, "AST_Impl", { s << m_params; s << m_trait; @@ -247,13 +251,13 @@ void operator>>(::Deserialiser& s, Function::Class& fc) } SERIALISE_TYPE(Function::, "AST_Function", { s << m_fcn_class; - s << m_generic_params; + s << m_params; s << m_rettype; s << m_args; s << m_code; },{ s >> m_fcn_class; - s.item(m_generic_params); + s.item(m_params); s.item(m_rettype); s.item(m_args); s.item(m_code); -- cgit v1.2.3