diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2020-12-13 15:47:32 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2020-12-13 15:47:32 +0800 |
commit | 6ee2c06c47a905b11ee5b674710df187126203bc (patch) | |
tree | 255f82f294ec703fe6b53e6413e4c1f449f5911e /gcc/rust/parse | |
parent | e21c9fe1657303605efeacd4890430e7d40c4c3c (diff) | |
download | gcc-6ee2c06c47a905b11ee5b674710df187126203bc.zip gcc-6ee2c06c47a905b11ee5b674710df187126203bc.tar.gz gcc-6ee2c06c47a905b11ee5b674710df187126203bc.tar.bz2 |
Attempt to fix array parsing errors
Diffstat (limited to 'gcc/rust/parse')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 8 |
1 files changed, 6 insertions, 2 deletions
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<ManagedTokenSource>::parse_array_expr ( return nullptr; } + skip_token (RIGHT_SQUARE); + std::unique_ptr<AST::ArrayElemsCopied> copied_array_elems ( new AST::ArrayElemsCopied (std::move (initial_expr), std::move (copy_amount))); @@ -8447,6 +8449,8 @@ Parser<ManagedTokenSource>::parse_array_expr ( exprs.push_back (std::move (initial_expr)); exprs.shrink_to_fit (); + skip_token (RIGHT_SQUARE); + std::unique_ptr<AST::ArrayElemsValues> array_elems ( new AST::ArrayElemsValues (std::move (exprs))); return std::unique_ptr<AST::ArrayExpr> ( @@ -13709,8 +13713,8 @@ Parser<ManagedTokenSource>::parse_field_access_expr ( std::vector<AST::Attribute> 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 (); |