From 1c8db13e4a9d1d3aabe1333197e4e07301fb8bf4 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 17 Aug 2016 22:14:25 +0800 Subject: Parse - Fix many parser bugs --- src/parse/types.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/parse/types.cpp') diff --git a/src/parse/types.cpp b/src/parse/types.cpp index 6f3a3d58..34afc484 100644 --- a/src/parse/types.cpp +++ b/src/parse/types.cpp @@ -78,7 +78,7 @@ TypeRef Parse_Type_Int(TokenStream& lex, bool allow_trait_list) // TODO: Handle HRLS in fn types return Parse_Type_Fn(lex, hrls); default: - return Parse_Type_Path(lex, hrls, allow_trait_list); + return Parse_Type_Path(lex, hrls, true); } } // - Either a primitive, or a path @@ -114,12 +114,12 @@ TypeRef Parse_Type_Int(TokenStream& lex, bool allow_trait_list) } if( tok.type() == TOK_RWORD_MUT ) { // Mutable reference - return TypeRef(TypeRef::TagReference(), lex.end_span(ps), true, Parse_Type(lex)); + return TypeRef(TypeRef::TagReference(), lex.end_span(ps), true, Parse_Type(lex, false)); } else { PUTBACK(tok, lex); // Immutable reference - return TypeRef(TypeRef::TagReference(), lex.end_span(ps), false, Parse_Type(lex)); + return TypeRef(TypeRef::TagReference(), lex.end_span(ps), false, Parse_Type(lex, false)); } throw ParseError::BugCheck("Reached end of Parse_Type:AMP"); } @@ -130,10 +130,10 @@ TypeRef Parse_Type_Int(TokenStream& lex, bool allow_trait_list) { case TOK_RWORD_MUT: // Mutable pointer - return TypeRef(TypeRef::TagPointer(), lex.end_span(ps), true, Parse_Type(lex)); + return TypeRef(TypeRef::TagPointer(), lex.end_span(ps), true, Parse_Type(lex, false)); case TOK_RWORD_CONST: // Immutable pointer - return TypeRef(TypeRef::TagPointer(), lex.end_span(ps), false, Parse_Type(lex)); + return TypeRef(TypeRef::TagPointer(), lex.end_span(ps), false, Parse_Type(lex, false)); default: throw ParseError::Unexpected(lex, tok, {TOK_RWORD_CONST, TOK_RWORD_MUT}); } @@ -247,7 +247,7 @@ TypeRef Parse_Type_Fn(TokenStream& lex, ::std::vector<::std::string> hrls) TypeRef ret_type = TypeRef(TypeRef::TagUnit(), Span(tok.get_pos())); if( GET_TOK(tok, lex) == TOK_THINARROW ) { - ret_type = Parse_Type(lex); + ret_type = Parse_Type(lex, false); } else { PUTBACK(tok, lex); -- cgit v1.2.3