From 6ee2c06c47a905b11ee5b674710df187126203bc Mon Sep 17 00:00:00 2001 From: SimplyTheOther Date: Sun, 13 Dec 2020 15:47:32 +0800 Subject: Attempt to fix array parsing errors --- gcc/rust/parse/rust-parse-impl.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/rust/parse/rust-parse-impl.h') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 3315da3..bade40c 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -8431,6 +8431,8 @@ Parser::parse_array_expr ( return nullptr; } + skip_token (RIGHT_SQUARE); + std::unique_ptr copied_array_elems ( new AST::ArrayElemsCopied (std::move (initial_expr), std::move (copy_amount))); @@ -8447,6 +8449,8 @@ Parser::parse_array_expr ( exprs.push_back (std::move (initial_expr)); exprs.shrink_to_fit (); + skip_token (RIGHT_SQUARE); + std::unique_ptr array_elems ( new AST::ArrayElemsValues (std::move (exprs))); return std::unique_ptr ( @@ -13709,8 +13713,8 @@ Parser::parse_field_access_expr ( std::vector outer_attrs, ParseRestrictions restrictions ATTRIBUTE_UNUSED) { - // get field name identifier (assume that this is a field access expr and not - // say await) + /* get field name identifier (assume that this is a field access expr and not + * await, for instance) */ const_TokenPtr ident_tok = expect_token (IDENTIFIER); Identifier ident = ident_tok->get_str (); -- cgit v1.1