diff options
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar/params.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs index 185386569..a70f067f9 100644 --- a/crates/ra_parser/src/grammar/params.rs +++ b/crates/ra_parser/src/grammar/params.rs | |||
@@ -43,7 +43,7 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
43 | if flavor.type_required() { | 43 | if flavor.type_required() { |
44 | opt_self_param(p); | 44 | opt_self_param(p); |
45 | } | 45 | } |
46 | while !p.at(EOF) && !p.at(ket) { | 46 | while !p.at(EOF) && !p.at(ket) && !(flavor == Flavor::Normal && p.at(DOTDOTDOT)) { |
47 | if !p.at_ts(VALUE_PARAMETER_FIRST) { | 47 | if !p.at_ts(VALUE_PARAMETER_FIRST) { |
48 | p.error("expected value parameter"); | 48 | p.error("expected value parameter"); |
49 | break; | 49 | break; |
@@ -53,6 +53,11 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
53 | p.expect(COMMA); | 53 | p.expect(COMMA); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | // test param_list_vararg | ||
57 | // extern "C" { fn printf(format: *const i8, ...) -> i32; } | ||
58 | if flavor == Flavor::Normal { | ||
59 | p.eat(DOTDOTDOT); | ||
60 | } | ||
56 | p.expect(ket); | 61 | p.expect(ket); |
57 | m.complete(p, PARAM_LIST); | 62 | m.complete(p, PARAM_LIST); |
58 | } | 63 | } |