refactor pat parser method names/doc-comments to agree with RFC 3637
This commit is contained in:
parent
f8e50d8736
commit
35bbc45f16
5 changed files with 23 additions and 22 deletions
|
@ -2630,7 +2630,7 @@ impl<'a> Parser<'a> {
|
|||
};
|
||||
self.bump(); // Eat `let` token
|
||||
let lo = self.prev_token.span;
|
||||
let pat = self.parse_pat_allow_top_alt(
|
||||
let pat = self.parse_pat_no_top_guard(
|
||||
None,
|
||||
RecoverComma::Yes,
|
||||
RecoverColon::Yes,
|
||||
|
@ -2776,7 +2776,7 @@ impl<'a> Parser<'a> {
|
|||
};
|
||||
// Try to parse the pattern `for ($PAT) in $EXPR`.
|
||||
let pat = match (
|
||||
self.parse_pat_allow_top_alt(
|
||||
self.parse_pat_no_top_guard(
|
||||
None,
|
||||
RecoverComma::Yes,
|
||||
RecoverColon::Yes,
|
||||
|
@ -3239,7 +3239,7 @@ impl<'a> Parser<'a> {
|
|||
// then we should recover.
|
||||
let mut snapshot = this.create_snapshot_for_diagnostic();
|
||||
let pattern_follows = snapshot
|
||||
.parse_pat_allow_top_alt(
|
||||
.parse_pat_no_top_guard(
|
||||
None,
|
||||
RecoverComma::Yes,
|
||||
RecoverColon::Yes,
|
||||
|
@ -3315,7 +3315,7 @@ impl<'a> Parser<'a> {
|
|||
if self.token == token::OpenDelim(Delimiter::Parenthesis) {
|
||||
// Detect and recover from `($pat if $cond) => $arm`.
|
||||
let left = self.token.span;
|
||||
match self.parse_pat_allow_top_alt(
|
||||
match self.parse_pat_no_top_guard(
|
||||
None,
|
||||
RecoverComma::Yes,
|
||||
RecoverColon::Yes,
|
||||
|
@ -3349,7 +3349,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
} else {
|
||||
// Regular parser flow:
|
||||
let pat = self.parse_pat_allow_top_alt(
|
||||
let pat = self.parse_pat_no_top_guard(
|
||||
None,
|
||||
RecoverComma::Yes,
|
||||
RecoverColon::Yes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue