From 439e0fd32eb943ad7a0be37baf9a19791840ae1e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 13 Aug 2018 18:46:43 +0300 Subject: Fix some more bugs --- crates/libsyntax2/src/grammar/expressions/mod.rs | 4 +++- crates/libsyntax2/src/grammar/type_params.rs | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/libsyntax2') diff --git a/crates/libsyntax2/src/grammar/expressions/mod.rs b/crates/libsyntax2/src/grammar/expressions/mod.rs index dcbb1e2a8..30a78d0c4 100644 --- a/crates/libsyntax2/src/grammar/expressions/mod.rs +++ b/crates/libsyntax2/src/grammar/expressions/mod.rs @@ -264,7 +264,9 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { p.bump(); name_ref(p); type_args::type_arg_list(p, true); - arg_list(p); + if p.at(L_PAREN) { + arg_list(p); + } m.complete(p, METHOD_CALL_EXPR) } diff --git a/crates/libsyntax2/src/grammar/type_params.rs b/crates/libsyntax2/src/grammar/type_params.rs index 32b69dc5b..a97eeb142 100644 --- a/crates/libsyntax2/src/grammar/type_params.rs +++ b/crates/libsyntax2/src/grammar/type_params.rs @@ -118,7 +118,11 @@ fn where_predicate(p: &mut Parser) { let m = p.start(); if p.at(LIFETIME) { p.eat(LIFETIME); - lifetime_bounds(p) + if p.at(COLON) { + lifetime_bounds(p) + } else { + p.error("expected colon") + } } else { types::path_type(p); if p.at(COLON) { -- cgit v1.2.3