From e60aa50103d9b24819f3dc26c783c2237f873664 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 29 Mar 2015 22:28:21 +0800 Subject: Minor tweaks to handle libcore update --- src/parse/root.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/parse/root.cpp') diff --git a/src/parse/root.cpp b/src/parse/root.cpp index cbc0ef3b..eefe0d52 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -684,9 +684,18 @@ AST::Impl Parse_Impl(TokenStream& lex, bool is_unsafe/*=false*/) if( GET_TOK(tok, lex) == TOK_RWORD_FOR ) { - // Implementing a trait for another type, get the target type trait_type = impl_type; - impl_type = Parse_Type(lex); + // Implementing a trait for another type, get the target type + if( GET_TOK(tok, lex) == TOK_DOUBLE_DOT ) + { + // Default impl + impl_type = TypeRef(); + } + else + { + lex.putback(tok); + impl_type = Parse_Type(lex); + } } else { lex.putback(tok); @@ -717,6 +726,7 @@ AST::Impl Parse_Impl(TokenStream& lex, bool is_unsafe/*=false*/) void Parse_Impl_Item(TokenStream& lex, AST::Impl& impl) { + TRACE_FUNCTION; Token tok; GET_TOK(tok, lex); -- cgit v1.2.3