aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar/params.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-13 16:58:35 +0100
committerAleksey Kladov <[email protected]>2020-08-13 16:59:27 +0100
commit6bc2633c90cedad057c5201d1ab7f67b57247004 (patch)
tree4293492e643f9a604c5f30e051289bcea182694c /crates/parser/src/grammar/params.rs
parent1b0c7701cc97cd7bef8bb9729011d4cf291a60c5 (diff)
Align parser names with grammar
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 {