aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar/params.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/parser/src/grammar/params.rs')
-rw-r--r--crates/parser/src/grammar/params.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs
index f0da173cc..a665ffc13 100644
--- a/crates/parser/src/grammar/params.rs
+++ b/crates/parser/src/grammar/params.rs
@@ -47,20 +47,20 @@ fn list_(p: &mut Parser, flavor: Flavor) {
47 if let FnDef = flavor { 47 if let FnDef = flavor {
48 // test self_param_outer_attr 48 // test self_param_outer_attr
49 // fn f(#[must_use] self) {} 49 // fn f(#[must_use] self) {}
50 attributes::outer_attributes(p); 50 attributes::outer_attrs(p);
51 opt_self_param(p); 51 opt_self_param(p);
52 } 52 }
53 53
54 while !p.at(EOF) && !p.at(ket) { 54 while !p.at(EOF) && !p.at(ket) {
55 // test param_outer_arg 55 // test param_outer_arg
56 // fn f(#[attr1] pat: Type) {} 56 // fn f(#[attr1] pat: Type) {}
57 attributes::outer_attributes(p); 57 attributes::outer_attrs(p);
58 58
59 if !p.at_ts(VALUE_PARAMETER_FIRST) { 59 if !p.at_ts(PARAM_FIRST) {
60 p.error("expected value parameter"); 60 p.error("expected value parameter");
61 break; 61 break;
62 } 62 }
63 let param = value_parameter(p, flavor); 63 let param = param(p, flavor);
64 if !p.at(ket) { 64 if !p.at(ket) {
65 p.expect(T![,]); 65 p.expect(T![,]);
66 } 66 }
@@ -73,11 +73,11 @@ fn list_(p: &mut Parser, flavor: Flavor) {
73 m.complete(p, PARAM_LIST); 73 m.complete(p, PARAM_LIST);
74} 74}
75 75
76const VALUE_PARAMETER_FIRST: TokenSet = patterns::PATTERN_FIRST.union(types::TYPE_FIRST); 76const PARAM_FIRST: TokenSet = patterns::PATTERN_FIRST.union(types::TYPE_FIRST);
77 77
78struct Variadic(bool); 78struct Variadic(bool);
79 79
80fn value_parameter(p: &mut Parser, flavor: Flavor) -> Variadic { 80fn param(p: &mut Parser, flavor: Flavor) -> Variadic {
81 let mut res = Variadic(false); 81 let mut res = Variadic(false);
82 let m = p.start(); 82 let m = p.start();
83 match flavor { 83 match flavor {