From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 3BE743858006 for ; Thu, 29 Jul 2021 01:25:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3BE743858006 Received: by mail-pj1-x1029.google.com with SMTP id ds11-20020a17090b08cbb0290172f971883bso13055544pjb.1 for ; Wed, 28 Jul 2021 18:25:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=VxoZTvZJhrB0rK7FWeoySa4o+uHfBeoSL7OwTrjKmQw=; b=WHgUZ3H+g6+6mYAKFLsLGFn2EcYkAqlIDEipdEFq98pQfsySkSlVaN0qQ0HKrs67yP xGEnxKCE6Ta21du4zgoVNuvgIi8r6OIQ0w3P0FoYeffHsObij0h7KR4a7ywwomtk1e5e LLyWZKR2kzWQCZPU9T7xRlQRBSfXXZZeMycJV4ayIGviRBq+/6+xdx5Z53G8SWkmSdna sc2XW+DZ/l3qGZ5UD4m4ziJAevta/LE3tREcNg/YUEshT5dt6s7VdBa+EXV4IHILQOcG adJS56R8PDjzheM5iVVoIQFtzWaI9uyr0q+4yD29mKJicGDZbUnF5T0uuNXVtQTY+rIO b8lw== X-Gm-Message-State: AOAM5319KYNRJvFdIgPwVgOK/qF0JVPiBXaulE6S8fNi4jLNJRRZnhda /UsAOzd8toVhMGWnDzHtENzaUk3EJ+U= X-Google-Smtp-Source: ABdhPJwtiHi1ndaeXgQ9jTGYiMU87Cqk/rvJzu+5lUUOsRNss158bClsge3g9DN6joUwuyMv9h4FCw== X-Received: by 2002:a17:902:bb92:b029:12c:31cd:2400 with SMTP id m18-20020a170902bb92b029012c31cd2400mr2292092pls.16.1627521945024; Wed, 28 Jul 2021 18:25:45 -0700 (PDT) Received: from smtpclient.apple ([124.170.56.167]) by smtp.gmail.com with ESMTPSA id q18sm1277648pfj.178.2021.07.28.18.25.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jul 2021 18:25:44 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: The Other Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] Pass pratt parsed token to expr parser functions to fix expr locus Date: Thu, 29 Jul 2021 09:25:41 +0800 Message-Id: <01C0429E-15F9-45A7-B800-400EEBDF13CD@gmail.com> References: <20210728221342.77649-1-mark@klomp.org> Cc: gcc-rust@gcc.gnu.org In-Reply-To: <20210728221342.77649-1-mark@klomp.org> To: Mark Wielaard X-Mailer: iPhone Mail (18F72) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2021 01:25:50 -0000 I think the core idea of this patch (fixing locations) is very important and= useful. But isn=E2=80=99t it overkill to pass the token in instead of just the locat= ion? You can avoid a fairly expensive shared_ptr copy by doing so.=20 > On 29 Jul 2021, at 6:13 am, Mark Wielaard wrote: >=20 > =EF=BB=BFThe pratt parser skips the first token of an expression before > invoking the actual expression parsing function. This makes getting > the correct starting location of a pratt parsed expression hard. The > "correction" of the location by subtracting an integer is often wrong > (since there may be arbitrary whitespace or comments between > tokens). Fix this by passing the token to the expression parsing > functions (instead of just providing a pratt_parse boolean). Use this > token to set the start of the expression. >=20 > Before gccrs would generate the following error message: >=20 > return.rs:3:22: error: cannot =E2=80=98break=E2=80=99 outside of a loop > 3 | let x =3D 5 - break return (16 + 2); > | ^~~~~~~~~~~~~~~~~ >=20 > Now we get: >=20 > return.rs:3:17: error: cannot =E2=80=98break=E2=80=99 outside of a loop > 3 | let x =3D 5 - break return (16 + 2); > | ^ > --- > gcc/rust/parse/rust-parse-impl.h | 180 +++++++++++++------------------ > gcc/rust/parse/rust-parse.h | 58 +++++----- > 2 files changed, 103 insertions(+), 135 deletions(-) >=20 > diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-= impl.h > index 340fea70201..6241a972ff7 100644 > --- a/gcc/rust/parse/rust-parse-impl.h > +++ b/gcc/rust/parse/rust-parse-impl.h > @@ -6580,7 +6580,7 @@ Parser::parse_path_expr_segment (= ) > template > AST::QualifiedPathInExpression > Parser::parse_qualified_path_in_expression ( > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > /* Note: the Rust grammar is defined in such a way that it is impossible= to > * determine whether a prospective qualified path is a > @@ -6595,7 +6595,7 @@ Parser::parse_qualified_path_in_= expression ( >=20 > // parse the qualified path type (required) > AST::QualifiedPathType qual_path_type > - =3D parse_qualified_path_type (pratt_parse); > + =3D parse_qualified_path_type (pratt_parsed_token); > if (qual_path_type.is_error ()) > { > // TODO: should this create a parse error? > @@ -6661,12 +6661,13 @@ Parser::parse_qualified_path_i= n_expression ( > // Parses the type syntactical construction at the start of a qualified pa= th. > template > AST::QualifiedPathType > -Parser::parse_qualified_path_type (bool pratt_parse) > +Parser::parse_qualified_path_type ( > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > + Location locus; > /* TODO: should this actually be error? is there anywhere where this cou= ld be > * valid? */ > - if (!pratt_parse) > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > if (!skip_token (LEFT_ANGLE)) > @@ -6676,10 +6677,7 @@ Parser::parse_qualified_path_ty= pe (bool pratt_parse) > } > } > else > - { > - // move back by 1 if pratt parsing due to skipping '<' > - locus =3D lexer.peek_token ()->get_locus () - 1; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse type (required) > std::unique_ptr type =3D parse_type (); > @@ -7305,10 +7303,10 @@ Parser::parse_expr_without_blo= ck (AST::AttrVec outer_attrs) > template > std::unique_ptr > Parser::parse_block_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > if (!skip_token (LEFT_CURLY)) > @@ -7318,9 +7316,7 @@ Parser::parse_block_expr (AST::A= ttrVec outer_attrs, > } > } > else > - { > - locus =3D lexer.peek_token ()->get_locus () - 1; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > AST::AttrVec inner_attrs =3D parse_inner_attributes (); >=20 > @@ -7611,22 +7607,17 @@ Parser::parse_literal_expr (AS= T::AttrVec outer_attrs) > // Parses a return expression (including any expression to return). > template > std::unique_ptr > -Parser::parse_return_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > +Parser::parse_return_expr ( > + AST::AttrVec outer_attrs, const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > - > skip_token (RETURN_TOK); > } > else > - { > - // minus 7 chars for 6 in return and a space > - // or just TODO: pass in location data > - locus =3D lexer.peek_token ()->get_locus () - 7; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse expression to return, if it exists > ParseRestrictions restrictions; > @@ -7644,21 +7635,16 @@ Parser::parse_return_expr (AST= ::AttrVec outer_attrs, > template > std::unique_ptr > Parser::parse_break_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > - > skip_token (BREAK); > } > else > - { > - // minus 6 chars for 5 in return and a space > - // or just TODO: pass in location data > - locus =3D lexer.peek_token ()->get_locus () - 6; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse label (lifetime) if it exists - create dummy first > AST::Lifetime label =3D AST::Lifetime::error (); > @@ -7681,22 +7667,17 @@ Parser::parse_break_expr (AST:= :AttrVec outer_attrs, > // Parses a continue expression (including any label to continue from). > template > std::unique_ptr > -Parser::parse_continue_expr (AST::AttrVec outer_attrs= , > - bool pratt_parse) > +Parser::parse_continue_expr ( > + AST::AttrVec outer_attrs, const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > - > skip_token (CONTINUE); > } > else > - { > - // minus 9 chars for 8 in return and a space > - // or just TODO: pass in location data > - locus =3D lexer.peek_token ()->get_locus () - 9; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse label (lifetime) if it exists - create dummy first > AST::Lifetime label =3D AST::Lifetime::error (); > @@ -7740,11 +7721,11 @@ Parser::parse_loop_label () > template > std::unique_ptr > Parser::parse_if_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > // TODO: make having outer attributes an error? > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > if (!skip_token (IF)) > @@ -7754,9 +7735,7 @@ Parser::parse_if_expr (AST::Attr= Vec outer_attrs, > } > } > else > - { > - locus =3D lexer.peek_token ()->get_locus () - 1; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // detect accidental if let > if (lexer.peek_token ()->get_id () =3D=3D LET) > @@ -7901,12 +7880,12 @@ Parser::parse_if_expr (AST::At= trVec outer_attrs, > * expressions don't support them. */ > template > std::unique_ptr > -Parser::parse_if_let_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > +Parser::parse_if_let_expr ( > + AST::AttrVec outer_attrs, const_TokenPtr pratt_parsed_token) > { > // TODO: make having outer attributes an error? > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > if (!skip_token (IF)) > @@ -7916,9 +7895,7 @@ Parser::parse_if_let_expr (AST::= AttrVec outer_attrs, > } > } > else > - { > - locus =3D lexer.peek_token ()->get_locus () - 1; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // detect accidental if expr parsed as if let expr > if (lexer.peek_token ()->get_id () !=3D LET) > @@ -8094,10 +8071,10 @@ template > std::unique_ptr > Parser::parse_loop_expr (AST::AttrVec outer_attrs, > AST::LoopLabel label, > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > if (label.is_error ()) > locus =3D lexer.peek_token ()->get_locus (); > @@ -8113,7 +8090,7 @@ Parser::parse_loop_expr (AST::At= trVec outer_attrs, > else > { > if (label.is_error ()) > - locus =3D lexer.peek_token ()->get_locus () - 1; > + locus =3D pratt_parsed_token->get_locus (); > else > locus =3D label.get_locus (); > } > @@ -8138,12 +8115,12 @@ Parser::parse_loop_expr (AST::= AttrVec outer_attrs, > * via parse_labelled_loop_expr, which would call this. */ > template > std::unique_ptr > -Parser::parse_while_loop_expr (AST::AttrVec outer_att= rs, > - AST::LoopLabel label, > - bool pratt_parse) > +Parser::parse_while_loop_expr ( > + AST::AttrVec outer_attrs, AST::LoopLabel label, > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > if (label.is_error ()) > locus =3D lexer.peek_token ()->get_locus (); > @@ -8159,7 +8136,7 @@ Parser::parse_while_loop_expr (A= ST::AttrVec outer_attrs, > else > { > if (label.is_error ()) > - locus =3D lexer.peek_token ()->get_locus () - 1; > + locus =3D pratt_parsed_token->get_locus (); > else > locus =3D label.get_locus (); > } > @@ -8417,21 +8394,16 @@ Parser::parse_labelled_loop_ex= pr (AST::AttrVec outer_attrs) > template > std::unique_ptr > Parser::parse_match_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > - > skip_token (MATCH_TOK); > } > else > - { > - // TODO: probably just pass in location data as param > - // get current pos then move back 6 - 5 for match, 1 for space > - locus =3D lexer.peek_token ()->get_locus () - 6; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > /* parse scrutinee expression, which is required (and HACK to prevent st= ruct > * expr) */ > @@ -8704,17 +8676,17 @@ Parser::parse_async_block_expr= (AST::AttrVec outer_attrs) > // Parses an unsafe block expression. > template > std::unique_ptr > -Parser::parse_unsafe_block_expr (AST::AttrVec outer_a= ttrs, > - bool pratt_parse) > +Parser::parse_unsafe_block_expr ( > + AST::AttrVec outer_attrs, const_TokenPtr pratt_parsed_token) > { > Location locus; > - if (!pratt_parse) > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > skip_token (UNSAFE); > } > else > - locus =3D lexer.peek_token ()->get_locus () - 1; > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse block expression (required) > std::unique_ptr block_expr =3D parse_block_expr (); > @@ -8738,19 +8710,16 @@ Parser::parse_unsafe_block_exp= r (AST::AttrVec outer_attrs, > template > std::unique_ptr > Parser::parse_array_expr (AST::AttrVec outer_attrs, > - bool pratt_parse) > + const_TokenPtr pratt_parsed_token) > { > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > - > skip_token (LEFT_SQUARE); > } > else > - { > - locus =3D lexer.peek_token ()->get_locus () - 1; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse optional inner attributes > AST::AttrVec inner_attrs =3D parse_inner_attributes (); > @@ -8927,20 +8896,17 @@ Parser::parse_closure_param ()= > template > std::unique_ptr > Parser::parse_grouped_or_tuple_expr ( > - AST::AttrVec outer_attrs, bool pratt_parse) > + AST::AttrVec outer_attrs, const_TokenPtr pratt_parsed_token) > { > // adjustment to allow Pratt parsing to reuse function without copy-past= e > - Location locus =3D Linemap::unknown_location (); > - if (!pratt_parse) > + Location locus; > + if (pratt_parsed_token =3D=3D nullptr) > { > locus =3D lexer.peek_token ()->get_locus (); > - > skip_token (LEFT_PAREN); > } > else > - { > - locus =3D lexer.peek_token ()->get_locus () - 1; > - } > + locus =3D pratt_parsed_token->get_locus (); >=20 > // parse optional inner attributes > AST::AttrVec inner_attrs =3D parse_inner_attributes (); > @@ -12535,7 +12501,7 @@ Parser::null_denotation (const= _TokenPtr tok, > // qualified path > // HACK: add outer attrs to path > AST::QualifiedPathInExpression path > - =3D parse_qualified_path_in_expression (true); > + =3D parse_qualified_path_in_expression (tok); > path.set_outer_attrs (std::move (outer_attrs)); > return std::unique_ptr ( > new AST::QualifiedPathInExpression (std::move (path))); > @@ -12578,7 +12544,7 @@ Parser::null_denotation (const= _TokenPtr tok, > new AST::LiteralExpr ("false", AST::Literal::BOOL, > tok->get_type_hint (), {}, tok->get_locus ())); > case LEFT_PAREN: > - return parse_grouped_or_tuple_expr (std::move (outer_attrs), true);= > + return parse_grouped_or_tuple_expr (std::move (outer_attrs), tok); >=20 > /*case PLUS: { // unary plus operator > // invoke parse_expr recursively with appropriate priority, etc. for > @@ -12810,41 +12776,41 @@ Parser::null_denotation (con= st_TokenPtr tok, > return parse_range_to_inclusive_expr (tok, std::move (outer_attrs));= > case RETURN_TOK: > // FIXME: is this really a null denotation expression? > - return parse_return_expr (std::move (outer_attrs), true); > + return parse_return_expr (std::move (outer_attrs), tok); > case BREAK: > // FIXME: is this really a null denotation expression? > - return parse_break_expr (std::move (outer_attrs), true); > + return parse_break_expr (std::move (outer_attrs), tok); > case CONTINUE: > - return parse_continue_expr (std::move (outer_attrs), true); > + return parse_continue_expr (std::move (outer_attrs), tok); > case LEFT_CURLY: > // ok - this is an expression with block for once. > - return parse_block_expr (std::move (outer_attrs), true); > + return parse_block_expr (std::move (outer_attrs), tok); > case IF: > // if or if let, so more lookahead to find out > if (lexer.peek_token (1)->get_id () =3D=3D LET) > { > // if let expr > - return parse_if_let_expr (std::move (outer_attrs), true); > + return parse_if_let_expr (std::move (outer_attrs), tok); > } > else > { > // if expr > - return parse_if_expr (std::move (outer_attrs), true); > + return parse_if_expr (std::move (outer_attrs), tok); > } > case LOOP: > return parse_loop_expr (std::move (outer_attrs), AST::LoopLabel::err= or (), > - true); > + tok); > case WHILE: > return parse_while_loop_expr (std::move (outer_attrs), > - AST::LoopLabel::error (), true); > + AST::LoopLabel::error (), tok); > case MATCH_TOK: > // also an expression with block > - return parse_match_expr (std::move (outer_attrs), true); > + return parse_match_expr (std::move (outer_attrs), tok); > case LEFT_SQUARE: > // array definition expr (not indexing) > - return parse_array_expr (std::move (outer_attrs), true); > + return parse_array_expr (std::move (outer_attrs), tok); > case UNSAFE: > - return parse_unsafe_block_expr (std::move (outer_attrs), true); > + return parse_unsafe_block_expr (std::move (outer_attrs), tok); > default: > if (!restrictions.expr_can_be_null) > add_error (Error (tok->get_locus (), > diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h > index 1c7bd781b3f..78608839265 100644 > --- a/gcc/rust/parse/rust-parse.h > +++ b/gcc/rust/parse/rust-parse.h > @@ -121,8 +121,10 @@ private: > AST::PathInExpression parse_path_in_expression (); > AST::PathExprSegment parse_path_expr_segment (); > AST::QualifiedPathInExpression > - parse_qualified_path_in_expression (bool pratt_parse =3D false); > - AST::QualifiedPathType parse_qualified_path_type (bool pratt_parse =3D f= alse); > + parse_qualified_path_in_expression (const_TokenPtr pratt_parsed_token > + =3D nullptr); > + AST::QualifiedPathType > + parse_qualified_path_type (const_TokenPtr pratt_parsed_token =3D nullpt= r); > AST::QualifiedPathInType parse_qualified_path_in_type (); >=20 > // Token tree or macro related > @@ -470,32 +472,32 @@ private: > parse_expr_with_block (AST::AttrVec outer_attrs); > std::unique_ptr > parse_expr_without_block (AST::AttrVec outer_attrs =3D AST::AttrVec ());= > - std::unique_ptr parse_block_expr (AST::AttrVec outer_at= trs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > - std::unique_ptr parse_if_expr (AST::AttrVec outer_attrs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > - std::unique_ptr parse_if_let_expr (AST::AttrVec outer_a= ttrs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > + std::unique_ptr > + parse_block_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > + std::unique_ptr > + parse_if_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > + std::unique_ptr > + parse_if_let_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr > parse_loop_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > AST::LoopLabel label =3D AST::LoopLabel::error (), > - bool pratt_parse =3D false); > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr > parse_while_loop_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > AST::LoopLabel label =3D AST::LoopLabel::error (), > - bool pratt_parse =3D false); > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr > parse_while_let_loop_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (),= > AST::LoopLabel label =3D AST::LoopLabel::error ()); > std::unique_ptr > parse_for_loop_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > AST::LoopLabel label =3D AST::LoopLabel::error ()); > - std::unique_ptr parse_match_expr (AST::AttrVec outer_at= trs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > + std::unique_ptr > + parse_match_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > AST::MatchArm parse_match_arm (); > std::vector > > parse_match_arm_patterns (TokenId end_token_id); > @@ -511,24 +513,24 @@ private: > AST::ClosureParam parse_closure_param (); > std::unique_ptr parse_literal_expr (AST::AttrVec outer= _attrs > =3D AST::AttrVec ()); > - std::unique_ptr parse_return_expr (AST::AttrVec outer_= attrs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > - std::unique_ptr parse_break_expr (AST::AttrVec outer_at= trs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > + std::unique_ptr > + parse_return_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > + std::unique_ptr > + parse_break_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr > parse_continue_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > - bool pratt_parse =3D false); > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr > parse_unsafe_block_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > - bool pratt_parse =3D false); > - std::unique_ptr parse_array_expr (AST::AttrVec outer_at= trs > - =3D AST::AttrVec (), > - bool pratt_parse =3D false); > + const_TokenPtr pratt_parsed_token =3D nullptr); > + std::unique_ptr > + parse_array_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (), > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr > parse_grouped_or_tuple_expr (AST::AttrVec outer_attrs =3D AST::AttrVec (= ), > - bool pratt_parse =3D false); > + const_TokenPtr pratt_parsed_token =3D nullptr); > std::unique_ptr parse_struct_expr_field (); > bool will_be_expr_with_block (); >=20 > --=20 > 2.32.0 >=20 > --=20 > Gcc-rust mailing list > Gcc-rust@gcc.gnu.org > https://gcc.gnu.org/mailman/listinfo/gcc-rust